diff options
author | Olivier Fourdan <fourdan@xfce.org> | 2015-02-27 21:55:42 +0100 |
---|---|---|
committer | Olivier Fourdan <fourdan@xfce.org> | 2015-02-27 21:55:42 +0100 |
commit | 8c4e805ecdb5916140c888b30e8fa773334beb6e (patch) | |
tree | 44a52453d517729c35af0a953296fee02733dda3 /src/netwm.c | |
parent | 72992ddb2e6ff17ee351df67db8576b8c5ad63d0 (diff) | |
download | xfwm4-8c4e805ecdb5916140c888b30e8fa773334beb6e.tar.gz |
Compute struts based on reported screen size
Even if we know that the screen size is wrong, as most panels (including
our own) will base their strut values on these as well.
Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
Diffstat (limited to 'src/netwm.c')
-rw-r--r-- | src/netwm.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/netwm.c b/src/netwm.c index ee3cd4dfb..81e830a84 100644 --- a/src/netwm.c +++ b/src/netwm.c @@ -985,29 +985,29 @@ clientValidateNetStrut (Client * c) screen_info = c->screen_info; valid = TRUE; - if (c->struts[STRUTS_TOP] > screen_info->height - screen_info->margins[STRUTS_BOTTOM]) + if (c->struts[STRUTS_TOP] > screen_info->logical_height - screen_info->margins[STRUTS_BOTTOM]) { - c->struts[STRUTS_TOP] = screen_info->height - screen_info->margins[STRUTS_BOTTOM]; + c->struts[STRUTS_TOP] = screen_info->logical_height - screen_info->margins[STRUTS_BOTTOM]; g_warning ("Top strut value for application window 0x%lx confined to %d", c->window, c->struts[STRUTS_TOP]); valid = FALSE; } - if (c->struts[STRUTS_BOTTOM] > screen_info->height - screen_info->margins[STRUTS_TOP]) + if (c->struts[STRUTS_BOTTOM] > screen_info->logical_height - screen_info->margins[STRUTS_TOP]) { - c->struts[STRUTS_BOTTOM] = screen_info->height - screen_info->margins[STRUTS_TOP]; + c->struts[STRUTS_BOTTOM] = screen_info->logical_height - screen_info->margins[STRUTS_TOP]; g_warning ("Bottom strut value for application window 0x%lx confined to %d", c->window, c->struts[STRUTS_BOTTOM]); valid = FALSE; } - if (c->struts[STRUTS_LEFT] > screen_info->width - screen_info->margins[STRUTS_RIGHT]) + if (c->struts[STRUTS_LEFT] > screen_info->logical_width - screen_info->margins[STRUTS_RIGHT]) { - c->struts[STRUTS_LEFT] = screen_info->height - screen_info->margins[STRUTS_RIGHT]; + c->struts[STRUTS_LEFT] = screen_info->logical_height - screen_info->margins[STRUTS_RIGHT]; g_warning ("Left strut value for application window 0x%lx confined to %d", c->window, c->struts[STRUTS_LEFT]); valid = FALSE; } - if (c->struts[STRUTS_RIGHT] > screen_info->width - screen_info->margins[STRUTS_LEFT]) + if (c->struts[STRUTS_RIGHT] > screen_info->logical_width - screen_info->margins[STRUTS_LEFT]) { - c->struts[STRUTS_RIGHT] = screen_info->height - screen_info->margins[STRUTS_LEFT]; + c->struts[STRUTS_RIGHT] = screen_info->logical_height - screen_info->margins[STRUTS_LEFT]; g_warning ("Right strut value for application window 0x%lx confined to %d", c->window, c->struts[STRUTS_RIGHT]); valid = FALSE; } @@ -1104,10 +1104,10 @@ clientGetNetStruts (Client * c) /* Fill(in values as for partial struts */ c->struts[STRUTS_TOP_START_X] = c->struts[STRUTS_BOTTOM_START_X] = 0; c->struts[STRUTS_TOP_END_X] = c->struts[STRUTS_BOTTOM_END_X] = - c->screen_info->width; + c->screen_info->logical_width; c->struts[STRUTS_LEFT_START_Y] = c->struts[STRUTS_RIGHT_START_Y] = 0; c->struts[STRUTS_LEFT_END_Y] = c->struts[STRUTS_RIGHT_END_Y] = - c->screen_info->height; + c->screen_info->logical_height; XFree (struts); } |