[Xfce4-commits] [apps/xfdashboard] 01/01: Respect window border when moving window
noreply at xfce.org
noreply at xfce.org
Tue Dec 22 12:44:23 CET 2015
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit ae7e60a33ef7aad46e012072328c73db771669ac
Author: Stephan Haller <nomad at froevel.de>
Date: Tue Dec 22 12:43:37 2015 +0100
Respect window border when moving window
Fixes one open issue at GH #98
---
xfdashboard/window-tracker-window.c | 36 +++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/xfdashboard/window-tracker-window.c b/xfdashboard/window-tracker-window.c
index 31f5907..d30a111 100644
--- a/xfdashboard/window-tracker-window.c
+++ b/xfdashboard/window-tracker-window.c
@@ -628,15 +628,43 @@ void xfdashboard_window_tracker_window_move_resize(XfdashboardWindowTrackerWindo
gint inHeight)
{
WnckWindowMoveResizeMask flags;
+ gint contentWidth, contentHeight;
+ gint borderWidth, borderHeight;
+
+ gint contentX, contentY;
+ gint borderX, borderY;
g_return_if_fail(WNCK_IS_WINDOW(inWindow));
+ /* Get window border size to respect it when moving window */
+ wnck_window_get_client_window_geometry(WNCK_WINDOW(inWindow), &contentX, &contentY, &contentWidth, &contentHeight);
+ wnck_window_get_geometry(WNCK_WINDOW(inWindow), &borderX, &borderY, &borderWidth, &borderHeight);
+
/* Get modification flags */
flags=0;
- if(inX>=0) flags|=WNCK_WINDOW_CHANGE_X;
- if(inY>=0) flags|=WNCK_WINDOW_CHANGE_Y;
- if(inWidth>=0) flags|=WNCK_WINDOW_CHANGE_WIDTH;
- if(inHeight>=0) flags|=WNCK_WINDOW_CHANGE_HEIGHT;
+ if(inX>=0)
+ {
+ flags|=WNCK_WINDOW_CHANGE_X;
+ inX-=(contentX-borderX);
+ }
+
+ if(inY>=0)
+ {
+ flags|=WNCK_WINDOW_CHANGE_Y;
+ inY-=(contentY-borderY);
+ }
+
+ if(inWidth>=0)
+ {
+ flags|=WNCK_WINDOW_CHANGE_WIDTH;
+ inWidth+=(borderWidth-contentWidth);
+ }
+
+ if(inHeight>=0)
+ {
+ flags|=WNCK_WINDOW_CHANGE_HEIGHT;
+ inHeight+=(borderHeight-contentHeight);
+ }
/* Set geometry */
wnck_window_set_geometry(WNCK_WINDOW(inWindow),
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list