diff --git a/ChangeLog b/ChangeLog index c77fae7948..bfdb07b069 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2001-03-10 Hans Breuer + + * gdk/gdk.def : updated + + * gdk/win32/gdkgc-win32.c : pixmaps are visible again, due + to offseting the clip_mask at the right place + + * gdk/win32/gdkwindow-win32.c : don't create background brushes + for all the gdkClasses, especially not for the input_only case. + Otherwise flickering wont be avoidable, because we don't get + WM_ERASEBKGND message for these windows. + + * gdk/win32/gdkevents-win32.c : initialize event->expose.region + and fixed massive redraw problems apparently triggered by Alexanders + recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling + but it seems to work quite well :-) + + * gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose + prototype + Sat Mar 10 12:15:31 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_cell): Fix a stupid typo. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index c77fae7948..bfdb07b069 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,23 @@ +2001-03-10 Hans Breuer + + * gdk/gdk.def : updated + + * gdk/win32/gdkgc-win32.c : pixmaps are visible again, due + to offseting the clip_mask at the right place + + * gdk/win32/gdkwindow-win32.c : don't create background brushes + for all the gdkClasses, especially not for the input_only case. + Otherwise flickering wont be avoidable, because we don't get + WM_ERASEBKGND message for these windows. + + * gdk/win32/gdkevents-win32.c : initialize event->expose.region + and fixed massive redraw problems apparently triggered by Alexanders + recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling + but it seems to work quite well :-) + + * gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose + prototype + Sat Mar 10 12:15:31 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_cell): Fix a stupid typo. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c77fae7948..bfdb07b069 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,23 @@ +2001-03-10 Hans Breuer + + * gdk/gdk.def : updated + + * gdk/win32/gdkgc-win32.c : pixmaps are visible again, due + to offseting the clip_mask at the right place + + * gdk/win32/gdkwindow-win32.c : don't create background brushes + for all the gdkClasses, especially not for the input_only case. + Otherwise flickering wont be avoidable, because we don't get + WM_ERASEBKGND message for these windows. + + * gdk/win32/gdkevents-win32.c : initialize event->expose.region + and fixed massive redraw problems apparently triggered by Alexanders + recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling + but it seems to work quite well :-) + + * gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose + prototype + Sat Mar 10 12:15:31 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_cell): Fix a stupid typo. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c77fae7948..bfdb07b069 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,23 @@ +2001-03-10 Hans Breuer + + * gdk/gdk.def : updated + + * gdk/win32/gdkgc-win32.c : pixmaps are visible again, due + to offseting the clip_mask at the right place + + * gdk/win32/gdkwindow-win32.c : don't create background brushes + for all the gdkClasses, especially not for the input_only case. + Otherwise flickering wont be avoidable, because we don't get + WM_ERASEBKGND message for these windows. + + * gdk/win32/gdkevents-win32.c : initialize event->expose.region + and fixed massive redraw problems apparently triggered by Alexanders + recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling + but it seems to work quite well :-) + + * gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose + prototype + Sat Mar 10 12:15:31 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_cell): Fix a stupid typo. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c77fae7948..bfdb07b069 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,23 @@ +2001-03-10 Hans Breuer + + * gdk/gdk.def : updated + + * gdk/win32/gdkgc-win32.c : pixmaps are visible again, due + to offseting the clip_mask at the right place + + * gdk/win32/gdkwindow-win32.c : don't create background brushes + for all the gdkClasses, especially not for the input_only case. + Otherwise flickering wont be avoidable, because we don't get + WM_ERASEBKGND message for these windows. + + * gdk/win32/gdkevents-win32.c : initialize event->expose.region + and fixed massive redraw problems apparently triggered by Alexanders + recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling + but it seems to work quite well :-) + + * gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose + prototype + Sat Mar 10 12:15:31 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_cell): Fix a stupid typo. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c77fae7948..bfdb07b069 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,23 @@ +2001-03-10 Hans Breuer + + * gdk/gdk.def : updated + + * gdk/win32/gdkgc-win32.c : pixmaps are visible again, due + to offseting the clip_mask at the right place + + * gdk/win32/gdkwindow-win32.c : don't create background brushes + for all the gdkClasses, especially not for the input_only case. + Otherwise flickering wont be avoidable, because we don't get + WM_ERASEBKGND message for these windows. + + * gdk/win32/gdkevents-win32.c : initialize event->expose.region + and fixed massive redraw problems apparently triggered by Alexanders + recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling + but it seems to work quite well :-) + + * gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose + prototype + Sat Mar 10 12:15:31 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_cell): Fix a stupid typo. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c77fae7948..bfdb07b069 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,23 @@ +2001-03-10 Hans Breuer + + * gdk/gdk.def : updated + + * gdk/win32/gdkgc-win32.c : pixmaps are visible again, due + to offseting the clip_mask at the right place + + * gdk/win32/gdkwindow-win32.c : don't create background brushes + for all the gdkClasses, especially not for the input_only case. + Otherwise flickering wont be avoidable, because we don't get + WM_ERASEBKGND message for these windows. + + * gdk/win32/gdkevents-win32.c : initialize event->expose.region + and fixed massive redraw problems apparently triggered by Alexanders + recent change. Not fully understood the GDK_EXPOSE / WM_PAINT handling + but it seems to work quite well :-) + + * gdk/win32/gdkprivate-win32.h : added _gdk_window_process_expose + prototype + Sat Mar 10 12:15:31 2001 Jonathan Blandford * gtk/gtktreestore.c (gtk_tree_store_set_cell): Fix a stupid typo. diff --git a/gdk/gdk.def b/gdk/gdk.def index b8872efa4d..b17f5a3cb2 100644 --- a/gdk/gdk.def +++ b/gdk/gdk.def @@ -159,21 +159,6 @@ EXPORTS gdk_get_display gdk_get_show_events gdk_get_use_xshm - gdk_ic_attr_destroy - gdk_ic_attr_new - gdk_ic_destroy - gdk_ic_get_attr - gdk_ic_get_events - gdk_ic_get_style - gdk_ic_get_values - gdk_ic_new - gdk_ic_set_attr - gdk_ic_set_values - gdk_im_begin - gdk_im_decide_style - gdk_im_end - gdk_im_ready - gdk_im_set_best_style gdk_image_get gdk_image_get_pixel gdk_image_get_type @@ -320,6 +305,7 @@ EXPORTS gdk_window_add_filter gdk_window_at_pointer gdk_window_begin_paint_rect + gdk_window_begin_paint_region gdk_window_clear gdk_window_clear_area gdk_window_clear_area_e diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 10fdb81960..6973226c2b 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -96,7 +96,8 @@ static GdkFilterReturn static gboolean gdk_event_translate (GdkEvent *event, MSG *msg, gboolean *ret_val_flagp, - gint *ret_valp); + gint *ret_valp, + gboolean return_exposes); static gboolean gdk_event_prepare (GSource *source, gint *timeout); @@ -172,7 +173,7 @@ real_window_procedure (HWND hwnd, msg.pt.y = HIWORD (pos); event.flags = GDK_EVENT_PENDING; - if (gdk_event_translate (&event.event, &msg, &ret_val_flag, &ret_val)) + if (gdk_event_translate (&event.event, &msg, &ret_val_flag, &ret_val, FALSE)) { event.flags &= ~GDK_EVENT_PENDING; #if 1 @@ -417,7 +418,7 @@ gdk_event_get_graphics_expose (GdkWindow *window) { event = gdk_event_new (); - if (gdk_event_translate (event, &msg, NULL, NULL)) + if (gdk_event_translate (event, &msg, NULL, NULL, TRUE)) return event; else gdk_event_free (event); @@ -1596,7 +1597,8 @@ static gboolean gdk_event_translate (GdkEvent *event, MSG *msg, gboolean *ret_val_flagp, - gint *ret_valp) + gint *ret_valp, + gboolean return_exposes) { DWORD pidActWin; DWORD pidThis; @@ -2764,28 +2766,45 @@ gdk_event_translate (GdkEvent *event, || (paintstruct.rcPaint.bottom == paintstruct.rcPaint.top)) break; - event->expose.type = GDK_EXPOSE; - event->expose.window = window; - event->expose.area.x = paintstruct.rcPaint.left; - event->expose.area.y = paintstruct.rcPaint.top; - event->expose.area.width = paintstruct.rcPaint.right - paintstruct.rcPaint.left; - event->expose.area.height = paintstruct.rcPaint.bottom - paintstruct.rcPaint.top; - event->expose.count = 0; + if (return_exposes) + { + event->expose.type = GDK_EXPOSE; + event->expose.window = window; + event->expose.area.x = paintstruct.rcPaint.left; + event->expose.area.y = paintstruct.rcPaint.top; + event->expose.area.width = paintstruct.rcPaint.right - paintstruct.rcPaint.left; + event->expose.area.height = paintstruct.rcPaint.bottom - paintstruct.rcPaint.top; + event->expose.region = gdk_region_rectangle (&(event->expose.area)); + event->expose.count = 0; - return_val = !GDK_WINDOW_DESTROYED (window); - if (return_val) - { - GList *list = gdk_queued_events; - while (list != NULL ) - { - if ((((GdkEvent *)list->data)->any.type == GDK_EXPOSE) && - (((GdkEvent *)list->data)->any.window == window) && - !(((GdkEventPrivate *)list->data)->flags & GDK_EVENT_PENDING)) - ((GdkEvent *)list->data)->expose.count++; - - list = list->next; - } - } + return_val = !GDK_WINDOW_DESTROYED (window); + if (return_val) + { + GList *list = gdk_queued_events; + while (list != NULL ) + { + if ((((GdkEvent *)list->data)->any.type == GDK_EXPOSE) && + (((GdkEvent *)list->data)->any.window == window) && + !(((GdkEventPrivate *)list->data)->flags & GDK_EVENT_PENDING)) + ((GdkEvent *)list->data)->expose.count++; + + list = list->next; + } + } + } + else + { + GdkRectangle expose_rect; + + expose_rect.x = paintstruct.rcPaint.left; + expose_rect.y = paintstruct.rcPaint.top; + expose_rect.width = paintstruct.rcPaint.right - paintstruct.rcPaint.left; + expose_rect.height = paintstruct.rcPaint.bottom - paintstruct.rcPaint.top; + + _gdk_window_process_expose (window, GetMessageTime (), &expose_rect); + + return_val = FALSE; + } break; case WM_SETCURSOR: diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c index 787cc68c0e..a51ef61c36 100644 --- a/gdk/win32/gdkgc-win32.c +++ b/gdk/win32/gdkgc-win32.c @@ -338,9 +338,6 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values, win32_gc->hcliprgn = BitmapToRegion ((HBITMAP) GDK_PIXMAP_HBITMAP (values->clip_mask)); win32_gc->values_mask |= GDK_GC_CLIP_MASK; - OffsetRgn (win32_gc->hcliprgn, - win32_gc->parent_instance.clip_x_origin, - win32_gc->parent_instance.clip_y_origin); } else { @@ -385,8 +382,8 @@ gdk_win32_gc_values_to_win32values (GdkGCValues *values, win32_gc->values_mask |= GDK_GC_CLIP_Y_ORIGIN; GDK_NOTE (MISC, (g_print ("%sclip_y=%d", s, values->clip_y_origin), s = ",")); - } - + } + if (mask & GDK_GC_EXPOSURES) { win32_gc->graphics_exposures = values->graphics_exposures; @@ -1082,6 +1079,10 @@ gdk_win32_hdc_get (GdkDrawable *drawable, { if (SelectClipRgn (win32_gc->hdc, win32_gc->hcliprgn) == ERROR) WIN32_API_FAILED ("SelectClipRgn"), ok = FALSE; + if (ok && !OffsetClipRgn (win32_gc->hdc, + win32_gc->values_mask & GDK_GC_CLIP_X_ORIGIN ? gc->clip_x_origin : 0, + win32_gc->values_mask & GDK_GC_CLIP_Y_ORIGIN ? gc->clip_y_origin : 0)) + WIN32_API_FAILED ("OffsetClipRgn"), ok = FALSE; } if (gdk_debug_flags & GDK_DEBUG_MISC) diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 7f865b1110..e436695640 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -39,6 +39,9 @@ _gdk_window_move_resize_child (GdkWindow *window, gint y, gint width, gint height); +void _gdk_window_process_expose (GdkWindow *window, + gulong serial, + GdkRectangle *area); void gdk_win32_selection_init (void); void gdk_win32_dnd_exit (void); diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index d052333cf7..3ffcc8f882 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -329,10 +329,15 @@ RegisterGdkClass (GdkWindowType wtype) wcl.hIconSm = 0; /* initialize once per class */ + /* + * HB: Setting the background brush leads to flicker, because we + * don't get asked how to clear the background. This is not what + * we want, at least not for input_only windows ... + */ #define ONCE_PER_CLASS() \ wcl.hIcon = CopyIcon (hAppIcon); \ wcl.hIconSm = CopyIcon (hAppIcon); \ - wcl.hbrBackground = CreateSolidBrush (RGB (0,0,0)); \ + wcl.hbrBackground = NULL; /* CreateSolidBrush (RGB (0,0,0)); */ \ wcl.hCursor = LoadCursor (NULL, IDC_ARROW); switch (wtype)