summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-08-29 22:56:30 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-08-29 22:56:30 +0200
commitae42686c41f4292bef579605a246ee445f6f61da (patch)
treeef7834077090cc76aff5519f59d4653b19b8f0d8 /src
parent6206ca48113d6790e5681d98ef2b89fd2a1d44da (diff)
winwidget.c: resize: Respect max width/height set by Xinerama (see #5)
This fixes half of the issue - windows on Xinerama screen 0 no longer become too large, but the bug still appears on the other screens (unless XINERAMA_SCREEN is set)
Diffstat (limited to 'src')
-rw-r--r--src/winwidget.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index 2ad2892..5c92655 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -775,6 +775,15 @@ void winwidget_resize(winwidget winwid, int w, int h)
Window ignored_window;
XWindowAttributes attributes;
int tc_x, tc_y;
+ int scr_width = scr->width;
+ int scr_height = scr->height;
+
+#ifdef HAVE_LIBXINERAMA
+ if (opt.xinerama && xinerama_screens) {
+ scr_width = xinerama_screens[xinerama_screen].width;
+ scr_height = xinerama_screens[xinerama_screen].height;
+ }
+#endif
if (opt.geom_flags) {
winwid->had_resize = 1;
@@ -784,8 +793,8 @@ void winwidget_resize(winwidget winwid, int w, int h)
D(("Really doing a resize\n"));
/* winwidget_clear_background(winwid); */
if (opt.screen_clip) {
- winwid->w = (w > scr->width) ? scr->width : w;
- winwid->h = (h > scr->height) ? scr->height : h;
+ winwid->w = (w > scr_width) ? scr_width : w;
+ winwid->h = (h > scr_height) ? scr_height : h;
}
if (winwid->full_screen) {
XGetWindowAttributes(disp, winwid->win, &attributes);
@@ -803,6 +812,7 @@ void winwidget_resize(winwidget winwid, int w, int h)
XFlush(disp);
#ifdef HAVE_LIBXINERAMA
+ /* TODO this section _might_ no longer be needed */
if (opt.xinerama && xinerama_screens) {
int i;