[Xfce4-commits] [apps/xfdashboard] 07/08: Adjust existing code to new window tracker interfaces
noreply at xfce.org
noreply at xfce.org
Tue Apr 4 18:41:58 CEST 2017
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit f862004f8601fbf86e9cfbcc262559d7960b13d5
Author: Stephan Haller <nomad at froevel.de>
Date: Tue Apr 4 18:31:47 2017 +0200
Adjust existing code to new window tracker interfaces
---
libxfdashboard/application-tracker.c | 46 ++++++++++++++++++---------------
libxfdashboard/live-window-simple.c | 27 +++++++++++--------
libxfdashboard/live-window.c | 29 +++++++++++----------
libxfdashboard/live-workspace.c | 46 ++++++++++++++++++++-------------
libxfdashboard/quicklaunch.c | 2 +-
libxfdashboard/stage-interface.c | 8 ++++--
libxfdashboard/stage.c | 9 +++----
libxfdashboard/windows-view.c | 29 ++++++++++++---------
libxfdashboard/x11/window-content-x11.c | 5 ++--
9 files changed, 114 insertions(+), 87 deletions(-)
diff --git a/libxfdashboard/application-tracker.c b/libxfdashboard/application-tracker.c
index 7e23e8a..af0e31d 100644
--- a/libxfdashboard/application-tracker.c
+++ b/libxfdashboard/application-tracker.c
@@ -455,7 +455,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
{
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Could not get PID for window '%s' of a running application to parse environment variables",
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
/* Return NULL result */
return(NULL);
@@ -468,7 +468,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Could not get environments for PID %d of windows '%s'",
windowPID,
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
/* Return NULL result */
return(NULL);
@@ -484,7 +484,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Missing 'GIO_LAUNCHED_DESKTOP_FILE_PID' in environment variables for PID %d of windows '%s'",
windowPID,
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
/* Release allocated resources */
if(environments) g_hash_table_destroy(environments);
@@ -500,7 +500,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
"PID %d of environment variables does not match requested window PID %d for '%s'",
checkPID,
windowPID,
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
/* Release allocated resources */
if(environments) g_hash_table_destroy(environments);
@@ -517,7 +517,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Missing 'GIO_LAUNCHED_DESKTOP_FILE' in environment variables for PID %d of windows '%s'",
windowPID,
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
/* Release allocated resources */
if(environments) g_hash_table_destroy(environments);
@@ -546,7 +546,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_environmen
*/
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Resolved enviroment variables of window '%s' to desktop ID '%s'",
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
foundAppInfo ? g_app_info_get_id(foundAppInfo) : "<nil>");
return(foundAppInfo);
@@ -636,7 +636,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Found possible application '%s' for window '%s' using pattern '%s'",
g_app_info_get_id(globAppInfo),
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
globName);
}
}
@@ -651,7 +651,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Found exactly one application named '%s' for window '%s' using pattern '%s'",
g_app_info_get_id(appInfo),
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
globName);
}
@@ -683,7 +683,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
{
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Resolved window names of '%s' are ambiguous - discarding desktop IDs '%s' and '%s'",
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
g_app_info_get_id(foundAppInfo),
g_app_info_get_id(appInfo));
@@ -717,7 +717,7 @@ static GAppInfo* _xfdashboard_application_tracker_get_desktop_id_from_window_nam
/* Return found application info */
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Resolved window names of '%s' to desktop ID '%s'",
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
foundAppInfo ? g_app_info_get_id(foundAppInfo) : "<nil>");
return(foundAppInfo);
@@ -731,6 +731,7 @@ static void _xfdashboard_application_tracker_on_window_opened(XfdashboardApplica
XfdashboardApplicationTrackerPrivate *priv;
GAppInfo *appInfo;
XfdashboardApplicationTrackerItem *item;
+ XfdashboardWindowTrackerWindowState state;
g_return_if_fail(XFDASHBOARD_IS_APPLICATION_TRACKER(self));
g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow));
@@ -738,25 +739,28 @@ static void _xfdashboard_application_tracker_on_window_opened(XfdashboardApplica
priv=self->priv;
appInfo=NULL;
+ /* Get window state */
+ state=xfdashboard_window_tracker_window_get_state(inWindow);
+
/* Check if window is "visible" and we should try to find the application
* it belongs to. To be "visible" means here that the window should not be
* skipped in any tasklist or pager. But hidden or minimized window are
* "visible" when looking up running application is meant.
*/
- if(xfdashboard_window_tracker_window_is_skip_pager(inWindow))
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_PAGER)
{
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Do not resolve window '%s' as it has skip-pager set.",
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
return;
}
- if(xfdashboard_window_tracker_window_is_skip_tasklist(inWindow))
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_TASKLIST)
{
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Do not resolve window '%s' as it has skip-tasklist set.",
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
return;
}
@@ -770,14 +774,14 @@ static void _xfdashboard_application_tracker_on_window_opened(XfdashboardApplica
{
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Could not resolve window '%s' to any desktop ID",
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
return;
}
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Window '%s' belongs to desktop ID '%s'",
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
g_app_info_get_id(appInfo));
/* Create application tracker if no one exists for application and window ... */
@@ -828,14 +832,14 @@ static void _xfdashboard_application_tracker_on_window_closed(XfdashboardApplica
{
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Could not find running application for window '%s'",
- xfdashboard_window_tracker_window_get_title(inWindow));
+ xfdashboard_window_tracker_window_get_name(inWindow));
return;
}
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Closing window '%s' for desktop ID '%s'",
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
item->desktopID);
/* Remove window from found application tracker item */
@@ -851,7 +855,7 @@ static void _xfdashboard_application_tracker_on_window_closed(XfdashboardApplica
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Closing window '%s' for desktop ID '%s' closed last window so remove application from list of running ones",
- xfdashboard_window_tracker_window_get_title(inWindow),
+ xfdashboard_window_tracker_window_get_name(inWindow),
item->desktopID);
/* Create a copy of desktop ID for signal emission because the
@@ -904,14 +908,14 @@ static void _xfdashboard_application_tracker_on_active_window_changed(Xfdashboar
{
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"Could not find running application for new active window '%s'",
- xfdashboard_window_tracker_window_get_title(inNewActiveWindow));
+ xfdashboard_window_tracker_window_get_name(inNewActiveWindow));
return;
}
XFDASHBOARD_DEBUG(self, APPLICATIONS,
"New active window is '%s' and belongs to desktop ID '%s'",
- xfdashboard_window_tracker_window_get_title(inNewActiveWindow),
+ xfdashboard_window_tracker_window_get_name(inNewActiveWindow),
item->desktopID);
/* Move new active window of found application tracker item to begin of
diff --git a/libxfdashboard/live-window-simple.c b/libxfdashboard/live-window-simple.c
index 194a971..9743910 100644
--- a/libxfdashboard/live-window-simple.c
+++ b/libxfdashboard/live-window-simple.c
@@ -91,11 +91,14 @@ static guint XfdashboardLiveWindowSimpleSignals[SIGNAL_LAST]={ 0, };
/* Check if window should be shown */
static gboolean _xfdashboard_live_window_simple_is_visible_window(XfdashboardLiveWindowSimple *self, XfdashboardWindowTrackerWindow *inWindow)
{
+ XfdashboardWindowTrackerWindowState state;
+
g_return_val_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow), FALSE);
/* Determine if windows should be shown depending on its state */
- if(xfdashboard_window_tracker_window_is_skip_pager(inWindow) ||
- xfdashboard_window_tracker_window_is_skip_tasklist(inWindow))
+ state=xfdashboard_window_tracker_window_get_state(inWindow);
+ if((state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_PAGER) ||
+ (state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_TASKLIST))
{
return(FALSE);
}
@@ -131,8 +134,9 @@ static void _xfdashboard_live_window_simple_on_state_changed(XfdashboardLiveWind
XfdashboardWindowTrackerWindow *inWindow,
gpointer inUserData)
{
- XfdashboardLiveWindowSimplePrivate *priv;
- gboolean isVisible;
+ XfdashboardLiveWindowSimplePrivate *priv;
+ gboolean isVisible;
+ XfdashboardWindowTrackerWindowState state;
g_return_if_fail(XFDASHBOARD_IS_LIVE_WINDOW_SIMPLE(self));
g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow));
@@ -151,7 +155,8 @@ static void _xfdashboard_live_window_simple_on_state_changed(XfdashboardLiveWind
}
/* Add or remove class depending on 'pinned' window state */
- if(xfdashboard_window_tracker_window_is_pinned(inWindow))
+ state=xfdashboard_window_tracker_window_get_state(inWindow);
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_PINNED)
{
xfdashboard_stylable_add_class(XFDASHBOARD_STYLABLE(self), "window-state-pinned");
}
@@ -161,7 +166,7 @@ static void _xfdashboard_live_window_simple_on_state_changed(XfdashboardLiveWind
}
/* Add or remove class depending on 'minimized' window state */
- if(xfdashboard_window_tracker_window_is_minimized(inWindow))
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_MINIMIZED)
{
xfdashboard_stylable_add_class(XFDASHBOARD_STYLABLE(self), "window-state-minimized");
}
@@ -171,7 +176,7 @@ static void _xfdashboard_live_window_simple_on_state_changed(XfdashboardLiveWind
}
/* Add or remove class depending on 'maximized' window state */
- if(xfdashboard_window_tracker_window_is_maximized(inWindow))
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_MAXIMIZED)
{
xfdashboard_stylable_add_class(XFDASHBOARD_STYLABLE(self), "window-state-maximized");
}
@@ -181,7 +186,7 @@ static void _xfdashboard_live_window_simple_on_state_changed(XfdashboardLiveWind
}
/* Add or remove class depending on 'urgent' window state */
- if(xfdashboard_window_tracker_window_is_urgent(inWindow))
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_URGENT)
{
xfdashboard_stylable_add_class(XFDASHBOARD_STYLABLE(self), "window-state-urgent");
}
@@ -235,7 +240,7 @@ static void _xfdashboard_live_window_simple_setup_content(XfdashboardLiveWindowS
switch(priv->displayType)
{
case XFDASHBOARD_LIVE_WINDOW_SIMPLE_DISPLAY_TYPE_LIVE_PREVIEW:
- content=xfdashboard_window_content_new_for_window(priv->window);
+ content=xfdashboard_window_tracker_window_get_content(priv->window);
clutter_actor_set_content(priv->actorWindow, content);
g_object_unref(content);
break;
@@ -272,7 +277,7 @@ static void _xfdashboard_live_window_simple_get_preferred_height(ClutterActor *s
{
gint windowHeight;
- xfdashboard_window_tracker_window_get_size(priv->window, NULL, &windowHeight);
+ xfdashboard_window_tracker_window_get_geometry(priv->window, NULL, NULL, NULL, &windowHeight);
if(windowHeight>minHeight) minHeight=windowHeight;
if(windowHeight>naturalHeight) naturalHeight=windowHeight;
}
@@ -299,7 +304,7 @@ static void _xfdashboard_live_window_simple_get_preferred_width(ClutterActor *se
{
gint windowWidth;
- xfdashboard_window_tracker_window_get_size(priv->window, &windowWidth, NULL);
+ xfdashboard_window_tracker_window_get_geometry(priv->window, NULL, NULL, &windowWidth, NULL);
if(windowWidth>minWidth) minWidth=windowWidth;
if(windowWidth>naturalWidth) naturalWidth=windowWidth;
}
diff --git a/libxfdashboard/live-window.c b/libxfdashboard/live-window.c
index 414b149..9e87853 100644
--- a/libxfdashboard/live-window.c
+++ b/libxfdashboard/live-window.c
@@ -121,14 +121,12 @@ static gboolean _xfdashboard_live_window_is_subwindow(XfdashboardLiveWindow *sel
g_return_val_if_fail(XFDASHBOARD_IS_LIVE_WINDOW(self), FALSE);
g_return_val_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow), FALSE);
- /* Check if window opened belong to this window (is transient for this one) */
+ /* Check if window opened belongs to this window (is transient for this one) */
thisWindow=xfdashboard_live_window_simple_get_window(XFDASHBOARD_LIVE_WINDOW_SIMPLE(self));
if(!thisWindow) return(FALSE);
- requestedWindowParent=xfdashboard_window_tracker_window_get_parent_window(inWindow);
- if(!requestedWindowParent) return(FALSE);
-
- if(requestedWindowParent!=thisWindow) return(FALSE);
+ requestedWindowParent=xfdashboard_window_tracker_window_get_parent(inWindow);
+ if(!requestedWindowParent || requestedWindowParent!=thisWindow) return(FALSE);
/* All checks succeeded so it is a sub-window and we return TRUE here */
return(TRUE);
@@ -138,6 +136,8 @@ static gboolean _xfdashboard_live_window_is_subwindow(XfdashboardLiveWindow *sel
static gboolean _xfdashboard_live_window_should_display_subwindow(XfdashboardLiveWindow *self,
XfdashboardWindowTrackerWindow *inWindow)
{
+ XfdashboardWindowTrackerWindowState state;
+
g_return_val_if_fail(XFDASHBOARD_IS_LIVE_WINDOW(self), FALSE);
g_return_val_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow), FALSE);
@@ -152,7 +152,8 @@ static gboolean _xfdashboard_live_window_should_display_subwindow(XfdashboardLiv
* the window opened is transient window of its parent and it looks like it
* will inherit the same "pin" state.
*/
- if(!xfdashboard_window_tracker_window_is_pinned(inWindow))
+ state=xfdashboard_window_tracker_window_get_state(inWindow);
+ if(!(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_PINNED))
{
XfdashboardWindowTrackerWindow *thisWindow;
XfdashboardWindowTrackerWorkspace *workspace;
@@ -383,9 +384,9 @@ static void _xfdashboard_live_window_on_actions_changed(XfdashboardLiveWindow *s
XfdashboardWindowTrackerWindow *inWindow,
gpointer inUserData)
{
- XfdashboardLiveWindowPrivate *priv;
- gboolean currentCloseVisible;
- gboolean newCloseVisible;
+ XfdashboardLiveWindowPrivate *priv;
+ gboolean currentCloseVisible;
+ gboolean newCloseVisible;
g_return_if_fail(XFDASHBOARD_IS_LIVE_WINDOW(self));
g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow));
@@ -397,8 +398,8 @@ static void _xfdashboard_live_window_on_actions_changed(XfdashboardLiveWindow *s
/* Determine current and new state of actions */
currentCloseVisible=(clutter_actor_is_visible(priv->actorClose) ? TRUE : FALSE);
- newCloseVisible=xfdashboard_window_tracker_window_has_close_action(inWindow);
-
+ newCloseVisible=((xfdashboard_window_tracker_window_get_actions(inWindow) & XFDASHBOARD_WINDOW_TRACKER_WINDOW_ACTION_CLOSE) ? TRUE : FALSE);
+
/* Show or hide close button actor */
if(newCloseVisible!=currentCloseVisible)
{
@@ -446,7 +447,7 @@ static void _xfdashboard_live_window_on_name_changed(XfdashboardLiveWindow *self
if(inWindow!=xfdashboard_live_window_simple_get_window(XFDASHBOARD_LIVE_WINDOW_SIMPLE(self))) return;
/* Set new name in title actor */
- windowName=g_markup_printf_escaped("%s", xfdashboard_window_tracker_window_get_title(inWindow));
+ windowName=g_markup_printf_escaped("%s", xfdashboard_window_tracker_window_get_name(inWindow));
xfdashboard_label_set_text(XFDASHBOARD_LABEL(priv->actorTitle), windowName);
g_free(windowName);
}
@@ -495,7 +496,7 @@ static void _xfdashboard_live_window_set_window_number(XfdashboardLiveWindow *se
window=xfdashboard_live_window_simple_get_window(XFDASHBOARD_LIVE_WINDOW_SIMPLE(self));
/* Only show close button again if window supports close action */
- if(xfdashboard_window_tracker_window_has_close_action(window))
+ if(xfdashboard_window_tracker_window_get_actions(window) & XFDASHBOARD_WINDOW_TRACKER_WINDOW_ACTION_CLOSE)
{
clutter_actor_show(priv->actorClose);
}
@@ -759,7 +760,7 @@ static void _xfdashboard_live_window_allocate(ClutterActor *self,
{
gint windowWidth, windowHeight;
- xfdashboard_window_tracker_window_get_size(window, &windowWidth, &windowHeight);
+ xfdashboard_window_tracker_window_get_geometry(window, NULL, NULL, &windowWidth, &windowHeight);
if(windowWidth>largestWidth) largestWidth=windowWidth;
if(windowHeight>largestHeight) largestHeight=windowHeight;
}
diff --git a/libxfdashboard/live-workspace.c b/libxfdashboard/live-workspace.c
index c1d1aae..0db2a05 100644
--- a/libxfdashboard/live-workspace.c
+++ b/libxfdashboard/live-workspace.c
@@ -97,18 +97,20 @@ static guint XfdashboardLiveWorkspaceSignals[SIGNAL_LAST]={ 0, };
static gboolean _xfdashboard_live_workspace_is_visible_window(XfdashboardLiveWorkspace *self,
XfdashboardWindowTrackerWindow *inWindow)
{
- XfdashboardLiveWorkspacePrivate *priv;
+ XfdashboardLiveWorkspacePrivate *priv;
+ XfdashboardWindowTrackerWindowState state;
g_return_val_if_fail(XFDASHBOARD_IS_LIVE_WORKSPACE(self), FALSE);
g_return_val_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow), FALSE);
priv=self->priv;
- /* Determine if windows should be shown depending on its state */
- if(xfdashboard_window_tracker_window_is_skip_pager(inWindow) ||
- xfdashboard_window_tracker_window_is_skip_tasklist(inWindow) ||
+ /* Determine if windows should be shown at workspace depending on its state */
+ state=xfdashboard_window_tracker_window_get_state(inWindow);
+ if((state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_PAGER) ||
+ (state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_TASKLIST) ||
!xfdashboard_window_tracker_window_is_visible(inWindow) ||
- (!priv->workspace && !xfdashboard_window_tracker_window_is_pinned(inWindow)) ||
+ (!priv->workspace && !(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_PINNED)) ||
(priv->workspace && !xfdashboard_window_tracker_window_is_on_workspace(inWindow, priv->workspace)) ||
xfdashboard_window_tracker_window_is_stage(inWindow))
{
@@ -445,6 +447,7 @@ static void _xfdashboard_live_workspace_get_preferred_height(ClutterActor *self,
XfdashboardLiveWorkspacePrivate *priv=XFDASHBOARD_LIVE_WORKSPACE(self)->priv;
gfloat minHeight, naturalHeight;
gfloat childWidth, childHeight;
+ gint w, h;
minHeight=naturalHeight=0.0f;
@@ -453,13 +456,15 @@ static void _xfdashboard_live_workspace_get_preferred_height(ClutterActor *self,
{
if(priv->monitor)
{
- childWidth=(gfloat)xfdashboard_window_tracker_monitor_get_width(priv->monitor);
- childHeight=(gfloat)xfdashboard_window_tracker_monitor_get_height(priv->monitor);
+ xfdashboard_window_tracker_monitor_get_geometry(priv->monitor, NULL, NULL, &w, &h);
+ childWidth=(gfloat)w;
+ childHeight=(gfloat)h;
}
else
{
- childWidth=(gfloat)xfdashboard_window_tracker_workspace_get_width(priv->workspace);
- childHeight=(gfloat)xfdashboard_window_tracker_workspace_get_height(priv->workspace);
+ xfdashboard_window_tracker_workspace_get_size(priv->workspace, &w, &h);
+ childWidth=(gfloat)w;
+ childHeight=(gfloat)h;
}
if(inForWidth<0.0f) naturalHeight=childHeight;
@@ -479,6 +484,7 @@ static void _xfdashboard_live_workspace_get_preferred_width(ClutterActor *self,
XfdashboardLiveWorkspacePrivate *priv=XFDASHBOARD_LIVE_WORKSPACE(self)->priv;
gfloat minWidth, naturalWidth;
gfloat childWidth, childHeight;
+ gint w, h;
minWidth=naturalWidth=0.0f;
@@ -487,13 +493,15 @@ static void _xfdashboard_live_workspace_get_preferred_width(ClutterActor *self,
{
if(priv->monitor)
{
- childWidth=(gfloat)xfdashboard_window_tracker_monitor_get_width(priv->monitor);
- childHeight=(gfloat)xfdashboard_window_tracker_monitor_get_height(priv->monitor);
+ xfdashboard_window_tracker_monitor_get_geometry(priv->monitor, NULL, NULL, &w, &h);
+ childWidth=(gfloat)w;
+ childHeight=(gfloat)h;
}
else
{
- childWidth=(gfloat)xfdashboard_window_tracker_workspace_get_width(priv->workspace);
- childHeight=(gfloat)xfdashboard_window_tracker_workspace_get_height(priv->workspace);
+ xfdashboard_window_tracker_workspace_get_size(priv->workspace, &w, &h);
+ childWidth=(gfloat)w;
+ childHeight=(gfloat)h;
}
if(inForHeight<0.0f) naturalWidth=childWidth;
@@ -561,17 +569,19 @@ static void _xfdashboard_live_workspace_allocate(ClutterActor *self,
*/
if(priv->workspace)
{
+ xfdashboard_window_tracker_workspace_get_size(priv->workspace, &w, &h);
workspaceArea.x1=0.0f;
workspaceArea.y1=0.0f;
- workspaceArea.x2=xfdashboard_window_tracker_workspace_get_width(priv->workspace);
- workspaceArea.y2=xfdashboard_window_tracker_workspace_get_height(priv->workspace);
+ workspaceArea.x2=w;
+ workspaceArea.y2=h;
}
else
{
+ xfdashboard_window_tracker_get_screen_size(priv->windowTracker, &w, &h);
workspaceArea.x1=0.0f;
workspaceArea.y1=0.0f;
- workspaceArea.x2=xfdashboard_window_tracker_get_screen_width(priv->windowTracker);
- workspaceArea.y2=xfdashboard_window_tracker_get_screen_height(priv->windowTracker);
+ workspaceArea.x2=w;
+ workspaceArea.y2=h;
}
/* Get visible area of workspace */
@@ -646,7 +656,7 @@ static void _xfdashboard_live_workspace_allocate(ClutterActor *self,
if(!window || !XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(window)) continue;
/* Get real size of child */
- xfdashboard_window_tracker_window_get_position_size(window, &x, &y, &w, &h);
+ xfdashboard_window_tracker_window_get_geometry(window, &x, &y, &w, &h);
/* Calculate translated position and size of child */
childAllocation.x1=x-visibleArea.x1;
diff --git a/libxfdashboard/quicklaunch.c b/libxfdashboard/quicklaunch.c
index 3599299..e166ef9 100644
--- a/libxfdashboard/quicklaunch.c
+++ b/libxfdashboard/quicklaunch.c
@@ -763,7 +763,7 @@ static void _xfdashboard_quicklaunch_on_favourite_popup_menu(XfdashboardQuicklau
/* Create menu item for window */
menuItem=xfdashboard_popup_menu_item_button_new();
- xfdashboard_label_set_text(XFDASHBOARD_LABEL(menuItem), xfdashboard_window_tracker_window_get_title(window));
+ xfdashboard_label_set_text(XFDASHBOARD_LABEL(menuItem), xfdashboard_window_tracker_window_get_name(window));
clutter_actor_set_x_expand(menuItem, TRUE);
xfdashboard_popup_menu_add_item(XFDASHBOARD_POPUP_MENU(popup), XFDASHBOARD_POPUP_MENU_ITEM(menuItem));
diff --git a/libxfdashboard/stage-interface.c b/libxfdashboard/stage-interface.c
index 76f6f00..07d1a45 100644
--- a/libxfdashboard/stage-interface.c
+++ b/libxfdashboard/stage-interface.c
@@ -179,6 +179,7 @@ static void _xfdashboard_stage_interface_get_preferred_height(ClutterActor *inAc
XfdashboardStageInterface *self=XFDASHBOARD_STAGE_INTERFACE(inActor);
XfdashboardStageInterfacePrivate *priv=self->priv;
gfloat minHeight, naturalHeight;
+ gint h;
ClutterActor *stage;
/* Set up default values */
@@ -187,7 +188,8 @@ static void _xfdashboard_stage_interface_get_preferred_height(ClutterActor *inAc
/* Get monitor size if available otherwise get stage size */
if(priv->monitor)
{
- minHeight=naturalHeight=xfdashboard_window_tracker_monitor_get_height(priv->monitor);
+ xfdashboard_window_tracker_monitor_get_geometry(priv->monitor, NULL, NULL, NULL, &h);
+ minHeight=naturalHeight=h;
}
else
{
@@ -208,6 +210,7 @@ static void _xfdashboard_stage_interface_get_preferred_width(ClutterActor *inAct
XfdashboardStageInterface *self=XFDASHBOARD_STAGE_INTERFACE(inActor);
XfdashboardStageInterfacePrivate *priv=self->priv;
gfloat minWidth, naturalWidth;
+ gint w;
ClutterActor *stage;
/* Set up default values */
@@ -216,7 +219,8 @@ static void _xfdashboard_stage_interface_get_preferred_width(ClutterActor *inAct
/* Get monitor size if available otherwise get stage size */
if(priv->monitor)
{
- minWidth=naturalWidth=xfdashboard_window_tracker_monitor_get_width(priv->monitor);
+ xfdashboard_window_tracker_monitor_get_geometry(priv->monitor, NULL, NULL, &w, NULL);
+ minWidth=naturalWidth=w;
}
else
{
diff --git a/libxfdashboard/stage.c b/libxfdashboard/stage.c
index 7a1d497..5d1d70a 100644
--- a/libxfdashboard/stage.c
+++ b/libxfdashboard/stage.c
@@ -568,7 +568,7 @@ static void _xfdashboard_stage_on_window_opened(XfdashboardStage *self,
priv=self->priv;
/* Check if window opened is this stage window */
- stageWindow=xfdashboard_window_tracker_window_get_stage_window(CLUTTER_STAGE(self));
+ stageWindow=xfdashboard_window_tracker_get_stage_window(priv->windowTracker, CLUTTER_STAGE(self));
if(stageWindow!=inWindow) return;
/* Set up window for use as stage window */
@@ -603,7 +603,7 @@ static void _xfdashboard_stage_on_desktop_window_opened(XfdashboardStage *self,
desktopWindow=xfdashboard_window_tracker_get_root_window(priv->windowTracker);
if(desktopWindow)
{
- windowContent=xfdashboard_window_content_new_for_window(desktopWindow);
+ windowContent=xfdashboard_window_tracker_window_get_content(desktopWindow);
clutter_actor_set_content(priv->backgroundImageLayer, windowContent);
clutter_actor_show(priv->backgroundImageLayer);
g_object_unref(windowContent);
@@ -1795,8 +1795,7 @@ static void xfdashboard_stage_init(XfdashboardStage *self)
{
gint screenWidth, screenHeight;
- screenWidth=xfdashboard_window_tracker_get_screen_width(priv->windowTracker);
- screenHeight=xfdashboard_window_tracker_get_screen_height(priv->windowTracker);
+ xfdashboard_window_tracker_get_screen_size(priv->windowTracker, &screenWidth, &screenHeight);
_xfdashboard_stage_on_screen_size_changed(self, screenWidth, screenHeight, priv->windowTracker);
g_signal_connect_swapped(priv->windowTracker,
@@ -1854,7 +1853,7 @@ void xfdashboard_stage_set_background_image_type(XfdashboardStage *self, Xfdashb
{
ClutterContent *backgroundContent;
- backgroundContent=xfdashboard_window_content_new_for_window(backgroundWindow);
+ backgroundContent=xfdashboard_window_tracker_window_get_content(backgroundWindow);
clutter_actor_show(priv->backgroundImageLayer);
clutter_actor_set_content(priv->backgroundImageLayer, backgroundContent);
g_object_unref(backgroundContent);
diff --git a/libxfdashboard/windows-view.c b/libxfdashboard/windows-view.c
index 72bb637..2eba276 100644
--- a/libxfdashboard/windows-view.c
+++ b/libxfdashboard/windows-view.c
@@ -208,20 +208,24 @@ static gboolean _xfdashboard_windows_view_update_stage_and_monitor(XfdashboardWi
static gboolean _xfdashboard_windows_view_is_visible_window(XfdashboardWindowsView *self,
XfdashboardWindowTrackerWindow *inWindow)
{
- XfdashboardWindowsViewPrivate *priv;
+ XfdashboardWindowsViewPrivate *priv;
+ XfdashboardWindowTrackerWindowState state;
g_return_val_if_fail(XFDASHBOARD_IS_WINDOWS_VIEW(self), FALSE);
g_return_val_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow), FALSE);
priv=self->priv;
+ /* Get state of window */
+ state=xfdashboard_window_tracker_window_get_state(inWindow);
+
/* Determine if windows should be shown depending on its state, size and position */
- if(xfdashboard_window_tracker_window_is_skip_pager(inWindow))
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_PAGER)
{
return(FALSE);
}
- if(xfdashboard_window_tracker_window_is_skip_tasklist(inWindow))
+ if(state & XFDASHBOARD_WINDOW_TRACKER_WINDOW_STATE_SKIP_TASKLIST)
{
return(FALSE);
}
@@ -406,7 +410,7 @@ static void _xfdashboard_windows_view_move_live_to_view(XfdashboardWindowsView *
XFDASHBOARD_DEBUG(self, ACTOR,
"Moving window '%s' from %s-monitor %d to %s-monitor %d and from workspace '%s' (%d) to '%s' (%d)",
- xfdashboard_window_tracker_window_get_title(window),
+ xfdashboard_window_tracker_window_get_name(window),
xfdashboard_window_tracker_monitor_is_primary(sourceMonitor) ? "primary" : "secondary",
xfdashboard_window_tracker_monitor_get_number(sourceMonitor),
xfdashboard_window_tracker_monitor_is_primary(targetMonitor) ? "primary" : "secondary",
@@ -417,11 +421,11 @@ static void _xfdashboard_windows_view_move_live_to_view(XfdashboardWindowsView *
xfdashboard_window_tracker_workspace_get_number(targetWorkspace));
/* Get position and size of window to move */
- xfdashboard_window_tracker_window_get_position_size(window,
- &oldWindowX,
- &oldWindowY,
- &oldWindowWidth,
- &oldWindowHeight);
+ xfdashboard_window_tracker_window_get_geometry(window,
+ &oldWindowX,
+ &oldWindowY,
+ &oldWindowWidth,
+ &oldWindowHeight);
/* Calculate source x and y coordinate relative to monitor size in percent */
xfdashboard_window_tracker_monitor_get_geometry(sourceMonitor,
@@ -447,7 +451,7 @@ static void _xfdashboard_windows_view_move_live_to_view(XfdashboardWindowsView *
xfdashboard_window_tracker_window_move_to_workspace(window, targetWorkspace);
XFDASHBOARD_DEBUG(self, ACTOR,
"Moved window '%s' from workspace '%s' (%d) to '%s' (%d)",
- xfdashboard_window_tracker_window_get_title(window),
+ xfdashboard_window_tracker_window_get_name(window),
xfdashboard_window_tracker_workspace_get_name(sourceWorkspace),
xfdashboard_window_tracker_workspace_get_number(sourceWorkspace),
xfdashboard_window_tracker_workspace_get_name(targetWorkspace),
@@ -458,7 +462,7 @@ static void _xfdashboard_windows_view_move_live_to_view(XfdashboardWindowsView *
xfdashboard_window_tracker_window_move(window, newWindowX, newWindowY);
XFDASHBOARD_DEBUG(self, ACTOR,
"Moved window '%s' from [%d,%d] at monitor [%d,%d x %d,%d] to [%d,%d] at monitor [%d,%d x %d,%d] (relative x=%.2f, y=%.2f)",
- xfdashboard_window_tracker_window_get_title(window),
+ xfdashboard_window_tracker_window_get_name(window),
oldWindowX, oldWindowY,
oldMonitorX, oldMonitorY, oldMonitorWidth, oldMonitorHeight,
newWindowX, newWindowY,
@@ -554,7 +558,8 @@ static void _xfdashboard_windows_view_on_drop_drop(XfdashboardWindowsView *self,
*/
if(sourceWindowsView==self)
{
- g_message("Will not handle drop of %s at %s because source and target are the same.",
+ XFDASHBOARD_DEBUG(self, ACTOR,
+ "Will not handle drop of %s at %s because source and target are the same.",
G_OBJECT_TYPE_NAME(draggedActor),
G_OBJECT_TYPE_NAME(dragSource));
return;
diff --git a/libxfdashboard/x11/window-content-x11.c b/libxfdashboard/x11/window-content-x11.c
index 81d2bcf..ce40636 100644
--- a/libxfdashboard/x11/window-content-x11.c
+++ b/libxfdashboard/x11/window-content-x11.c
@@ -826,8 +826,7 @@ static void _xfdashboard_window_content_x11_release_resources(XfdashboardWindowC
XFDASHBOARD_DEBUG(self, WINDOWS,
"X error %d occured while releasing resources for window '%s'",
trapError,
- xfdashboard_window_tracker_window_get_name(XFDASHBOARD_WINDOW_TRACKER_WINDOW(priv->window)),
- self);
+ xfdashboard_window_tracker_window_get_name(XFDASHBOARD_WINDOW_TRACKER_WINDOW(priv->window)));
return;
}
@@ -950,7 +949,7 @@ static gboolean _xfdashboard_window_content_x11_resume_on_idle(gpointer inUserDa
xfdashboard_window_tracker_window_get_name(XFDASHBOARD_WINDOW_TRACKER_WINDOW(priv->window)));
XFDASHBOARD_DEBUG(self, WINDOWS,
- "Removing queued entry %p for window resume of '%s'@%p",
+ "Removing queued entry %p for window resume of '%s'",
queueEntry,
xfdashboard_window_tracker_window_get_name(XFDASHBOARD_WINDOW_TRACKER_WINDOW(priv->window)));
_xfdashboard_window_content_x11_resume_idle_queue=g_list_delete_link(_xfdashboard_window_content_x11_resume_idle_queue, queueEntry);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list