Lines 183-190
Link Here
|
183 |
/* Flush exposes */ |
183 |
/* Flush exposes */ |
184 |
int /*long*/ checkIfEventProc; |
184 |
int /*long*/ checkIfEventProc; |
185 |
Callback checkIfEventCallback; |
185 |
Callback checkIfEventCallback; |
186 |
int /*long*/ flushWindow; |
|
|
187 |
boolean flushAll; |
188 |
GdkRectangle flushRect = new GdkRectangle (); |
186 |
GdkRectangle flushRect = new GdkRectangle (); |
189 |
XExposeEvent exposeEvent = new XExposeEvent (); |
187 |
XExposeEvent exposeEvent = new XExposeEvent (); |
190 |
XVisibilityEvent visibilityEvent = new XVisibilityEvent (); |
188 |
XVisibilityEvent visibilityEvent = new XVisibilityEvent (); |
Lines 608-624
Link Here
|
608 |
} |
606 |
} |
609 |
int /*long*/ window = OS.gdk_window_lookup (exposeEvent.window); |
607 |
int /*long*/ window = OS.gdk_window_lookup (exposeEvent.window); |
610 |
if (window == 0) return 0; |
608 |
if (window == 0) return 0; |
611 |
if (flushWindow != 0) { |
|
|
612 |
if (flushAll) { |
613 |
int /*long*/ tempWindow = window; |
614 |
do { |
615 |
if (tempWindow == flushWindow) break; |
616 |
} while ((tempWindow = OS.gdk_window_get_parent (tempWindow)) != 0); |
617 |
if (tempWindow != flushWindow) return 0; |
618 |
} else { |
619 |
if (window != flushWindow) return 0; |
620 |
} |
621 |
} |
622 |
switch (exposeEvent.type) { |
609 |
switch (exposeEvent.type) { |
623 |
case OS.Expose: |
610 |
case OS.Expose: |
624 |
case OS.GraphicsExpose: { |
611 |
case OS.GraphicsExpose: { |
Lines 644-649
Link Here
|
644 |
} else { |
631 |
} else { |
645 |
control.state &= ~Widget.OBSCURED; |
632 |
control.state &= ~Widget.OBSCURED; |
646 |
} |
633 |
} |
|
|
634 |
/*Remove visibility Event from queue if it has coresponding control*/ |
635 |
exposeEvent.type = -1; |
636 |
OS.memmove (xEvent, exposeEvent, XExposeEvent.sizeof); |
647 |
} |
637 |
} |
648 |
} |
638 |
} |
649 |
break; |
639 |
break; |
Lines 944-960
Link Here
|
944 |
return 0; |
934 |
return 0; |
945 |
} |
935 |
} |
946 |
|
936 |
|
947 |
void flushExposes (int /*long*/ window, boolean all) { |
937 |
void flushExposes () { |
948 |
OS.gdk_flush (); |
938 |
OS.gdk_flush (); |
|
|
939 |
if (OS.GDK_WINDOWING_X11 ()) { |
940 |
int /*long*/ xEvent = OS.g_malloc (XEvent.sizeof); |
941 |
OS.XCheckIfEvent(OS.GDK_DISPLAY(), xEvent, checkIfEventProc, 0); |
942 |
OS.g_free(xEvent); |
943 |
} |
944 |
} |
945 |
|
946 |
private void flushExposes( Control control, int /* long */window, |
947 |
boolean update_children, int /* long */xEvent) { |
948 |
int /* long */xDisplay = OS1.GDK_WINDOW_XDISPLAY(window); |
949 |
int /* long */xWindow = OS1.GDK_WINDOW_XID(window); |
950 |
|
951 |
while (OS.XCheckWindowEvent(xDisplay, xWindow, OS.ExposureMask, xEvent)) { |
952 |
OS.memmove(exposeEvent, xEvent, XExposeEvent.sizeof); |
953 |
if(exposeEvent.type == OS.Expose || exposeEvent.type == OS.GraphicsExpose) |
954 |
{ |
955 |
flushRect.x = exposeEvent.x; |
956 |
flushRect.y = exposeEvent.y; |
957 |
flushRect.width = exposeEvent.width; |
958 |
flushRect.height = exposeEvent.height; |
959 |
OS.gdk_window_invalidate_rect(window, flushRect, false); |
960 |
} |
961 |
} |
962 |
|
963 |
if (control != null) { |
964 |
while (OS.XCheckWindowEvent(xDisplay, xWindow, |
965 |
OS.VisibilityChangeMask, xEvent)) { |
966 |
OS.memmove(visibilityEvent, xEvent, XVisibilityEvent.sizeof); |
967 |
if (visibilityEvent.state == OS.VisibilityFullyObscured) |
968 |
control.state |= Widget.OBSCURED; |
969 |
else |
970 |
control.state &= ~Widget.OBSCURED; |
971 |
} |
972 |
} |
973 |
|
974 |
if (update_children) { |
975 |
int /* long */children = OS1.gdk_window_peek_children(window); |
976 |
while (children != 0) { |
977 |
int /* long */child = OS.g_list_data(children); |
978 |
if (child != 0) { |
979 |
OS.gdk_window_get_user_data(child, flushData); |
980 |
int /* long */handle = flushData[0]; |
981 |
Widget widget = handle != 0 ? getWidget(handle) |
982 |
: null; |
983 |
if (widget != null && widget instanceof Control) { |
984 |
control = (Control) widget; |
985 |
control = child == control.paintWindow() ? control : null; |
986 |
} else |
987 |
control = null; |
988 |
flushExposes(control, child, update_children, xEvent); |
989 |
} |
990 |
children = OS.g_list_next(children); |
991 |
} |
992 |
} |
993 |
} |
994 |
|
995 |
void flushExposes(Control control, int /* long */window, boolean update_children) { |
949 |
OS.gdk_flush (); |
996 |
OS.gdk_flush (); |
950 |
if (OS.GDK_WINDOWING_X11 ()) { |
997 |
if (OS.GDK_WINDOWING_X11 ()) { |
951 |
this.flushWindow = window; |
|
|
952 |
this.flushAll = all; |
953 |
int /*long*/ xDisplay = OS.GDK_DISPLAY (); |
954 |
int /*long*/ xEvent = OS.g_malloc (XEvent.sizeof); |
998 |
int /*long*/ xEvent = OS.g_malloc (XEvent.sizeof); |
955 |
OS.XCheckIfEvent (xDisplay, xEvent, checkIfEventProc, 0); |
999 |
flushExposes(control, window, update_children, xEvent); |
956 |
OS.g_free (xEvent); |
1000 |
OS.g_free(xEvent); |
957 |
this.flushWindow = 0; |
|
|
958 |
} |
1001 |
} |
959 |
} |
1002 |
} |
960 |
|
1003 |
|
Lines 3173-3179
Link Here
|
3173 |
*/ |
3217 |
*/ |
3174 |
public void update () { |
3218 |
public void update () { |
3175 |
checkDevice (); |
3219 |
checkDevice (); |
3176 |
flushExposes (0, true); |
3220 |
flushExposes(); |
3177 |
OS.gdk_window_process_all_updates (); |
3221 |
OS.gdk_window_process_all_updates (); |
3178 |
} |
3222 |
} |
3179 |
|
3223 |
|