From ae42686c41f4292bef579605a246ee445f6f61da Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 29 Aug 2011 22:56:30 +0200 Subject: 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) --- src/winwidget.c | 14 ++++++++++++-- 1 file 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; -- cgit v1.2.3