Ghost/Compiz bug:

Sometimes, events for window size or move are sent even when the window hasn't changed. This triggers unneeded refreshes.

As a precaution, we now ignore all such events (eventually, it should be done in Ghost X11, but I don't know that code well enough).
This commit is contained in:
Martin Poirier 2009-09-20 17:24:56 +00:00
parent e4a50e3f47
commit 4f6ea2b683

@ -627,6 +627,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
if(state!=GHOST_kWindowStateMinimized) {
GHOST_RectangleHandle client_rect;
int l, t, r, b, scr_w, scr_h;
int sizex, sizey, posx, posy;
client_rect= GHOST_GetClientBounds(win->ghostwin);
GHOST_GetRectangle(client_rect, &l, &t, &r, &b);
@ -634,10 +635,28 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
GHOST_DisposeRectangle(client_rect);
wm_get_screensize(&scr_w, &scr_h);
win->sizex= r-l;
win->sizey= b-t;
win->posx= l;
win->posy= scr_h - t - win->sizey;
sizex= r-l;
sizey= b-t;
posx= l;
posy= scr_h - t - win->sizey;
/*
* Ghost sometimes send size or move events when the window hasn't changed.
* One case of this is using compiz on linux. To alleviate the problem
* we ignore all such event here.
*
* It might be good to eventually do that at Ghost level, but that is for
* another time.
*/
if (win->sizex != sizex ||
win->sizey != sizey ||
win->posx != posx ||
win->posy != posy)
{
win->sizex= sizex;
win->sizey= sizey;
win->posx= posx;
win->posy= posy;
/* debug prints */
if(0) {
@ -666,6 +685,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
wm_draw_window_clear(win);
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
}
}
break;
}
default: