diff options
author | Michael Cardell Widerkrantz <mc@hack.org> | 2011-02-19 15:25:06 +0100 |
---|---|---|
committer | Michael Cardell Widerkrantz <mc@hack.org> | 2011-02-19 15:25:06 +0100 |
commit | 58e6ac19821e50050e0e66f0fe96f522cc8f3658 (patch) | |
tree | 1a2f076b4c85e43b60a03c5f8e9f05409ecf64a1 /mcwm.c | |
parent | 5b8ef85cc96863871cbab01a809859c610d5f1ba (diff) | |
download | mcwm-58e6ac19821e50050e0e66f0fe96f522cc8f3658.zip |
Check if geometry really changed before re-arranging windows. If it
didn't, do nothing.
Diffstat (limited to 'mcwm.c')
-rw-r--r-- | mcwm.c | 28 |
1 files changed, 20 insertions, 8 deletions
@@ -380,7 +380,7 @@ void arrangewindows(uint16_t rootwidth, uint16_t rootheight) if (changed) { - PDEBUG("--- Win %d going to %d,%d %d x %d\n", children[i], + PDEBUG("--- Win %d going to %d,%d %d x %d\n", client->id, x, y, width, height); mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y @@ -2827,15 +2827,27 @@ void events(void) * degrees or whatnot. We might need to rearrange * windows to be visible. * - * Always call this function since we also need to - * reset any maximized state. + * We might get notified for several reasons, not just + * if the geometry changed. If the geometry is + * unchanged, do nothing. + * */ PDEBUG("Notify event for root!\n"); - PDEBUG("New root geometry: %dx%d\n", e->width, e->height); - - arrangewindows(e->width, e->height); - screen->width_in_pixels = e->width; - screen->height_in_pixels = e->height; + PDEBUG("Possibly a new root geometry: %dx%d\n", + e->width, e->height); + + if (e->width == screen->width_in_pixels + && e->height == screen->height_in_pixels) + { + /* Root geometry is really unchanged. Do nothing. */ + PDEBUG("Hey! Geometry didn't change.\n"); + } + else + { + arrangewindows(e->width, e->height); + screen->width_in_pixels = e->width; + screen->height_in_pixels = e->height; + } } } break; |