]> git.eshelyaron.com Git - emacs.git/commitdiff
End Resize flickering by copying surface rather than just clearing
authorJeff Walsh <jawalsh@localhost.localdomain>
Mon, 13 Jan 2020 05:17:50 +0000 (16:17 +1100)
committerJeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>
Tue, 24 Nov 2020 01:24:39 +0000 (12:24 +1100)
* src/pgtkterm.h (FRAME_NATIVE_WINDOW):

* src/pgtkterm.c (pgtk_set_window_size): cleanup traces
(x_draw_bar_cursor, pgtk_handle_draw, syms_of_pgtkterm):

src/pgtkterm.c
src/pgtkterm.h

index e214cc26c861056d9d7fc6584aed8879cf168126..86ebf864a779618a418a3b8befb5b8c205aacdd9 100644 (file)
@@ -408,7 +408,6 @@ pgtk_set_window_size (struct frame *f,
   block_input ();
 
   gtk_widget_get_size_request(FRAME_GTK_WIDGET(f), &pixelwidth, &pixelheight);
-  PGTK_TRACE("old: %dx%d", pixelwidth, pixelheight);
 
   if (pixelwise)
     {
@@ -429,18 +428,13 @@ pgtk_set_window_size (struct frame *f,
            make_fixnum (FRAME_PGTK_TITLEBAR_HEIGHT (f)),
            make_fixnum (FRAME_TOOLBAR_HEIGHT (f))));
 
-  PGTK_TRACE("new: %dx%d", pixelwidth, pixelheight);
   for (GtkWidget *w = FRAME_GTK_WIDGET(f); w != NULL; w = gtk_widget_get_parent(w)) {
-    PGTK_TRACE("%p %s %d %d", w, G_OBJECT_TYPE_NAME(w), gtk_widget_get_mapped(w), gtk_widget_get_visible(w));
     gint wd, hi;
     gtk_widget_get_size_request(w, &wd, &hi);
-    PGTK_TRACE(" %dx%d", wd, hi);
     GtkAllocation alloc;
     gtk_widget_get_allocation(w, &alloc);
-    PGTK_TRACE(" %dx%d+%d+%d", alloc.width, alloc.height, alloc.x, alloc.y);
   }
 
-  PGTK_TRACE("pgtk_set_window_size: %p: %dx%d.", f, width, height);
   f->output_data.pgtk->preferred_width = pixelwidth;
   f->output_data.pgtk->preferred_height = pixelheight;
   x_wm_set_size_hint(f, 0, 0);
@@ -679,6 +673,7 @@ x_display_pixel_width (struct pgtk_display_info *dpyinfo)
   return gdk_screen_get_width(gscr);
 }
 
+
 void
 x_set_no_focus_on_map (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
 /* Set frame F's `no-focus-on-map' parameter which, if non-nil, means
@@ -2632,8 +2627,6 @@ pgtk_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
 {
   PGTK_TRACE("draw_window_cursor: %d, %d, %d, %d, %d, %d.",
               x, y, cursor_type, cursor_width, on_p, active_p);
-  struct frame *f = XFRAME (WINDOW_FRAME (w));
-  PGTK_TRACE("%p\n", f->output_data.pgtk);
 
   if (on_p)
     {
@@ -4807,9 +4800,9 @@ pgtk_handle_draw(GtkWidget *widget, cairo_t *cr, gpointer *data)
       if (src == NULL && FRAME_CR_ACTIVE_CONTEXT(f) != NULL)
        src = cairo_get_target(FRAME_CR_ACTIVE_CONTEXT(f));
     }
-    APGTK_TRACE("  surface=%p", src);
+    PGTK_TRACE("  surface=%p", src);
     if (src != NULL) {
-      APGTK_TRACE("  resized_p=%d", f->resized_p);
+      PGTK_TRACE("  resized_p=%d", f->resized_p);
       PGTK_TRACE("  garbaged=%d", f->garbaged);
       PGTK_TRACE("  scroll_bar_width=%f", (double) PGTK_SCROLL_BAR_WIDTH(f));
       // PGTK_TRACE("  scroll_bar_adjust=%d", PGTK_SCROLL_BAR_ADJUST(f));
@@ -6581,9 +6574,6 @@ pgtk_begin_cr_clip (struct frame *f)
 
       cr = FRAME_CR_CONTEXT (f) = cairo_create (surface);
       cairo_surface_destroy (surface);
-
-      cr = cairo_create (FRAME_CR_SURFACE (f));
-      FRAME_CR_CONTEXT (f) = cr;
     }
 
   cairo_save (cr);
@@ -6601,7 +6591,7 @@ pgtk_end_cr_clip (struct frame *f)
 void
 pgtk_set_cr_source_with_gc_foreground (struct frame *f, Emacs_GC *gc)
 {
-  PGTK_TRACE("pgtk_set_cr_source_with_gc_foreground: %08lx", gc->foreground);
+  PGTK_TRACE ("pgtk_set_cr_source_with_gc_foreground: %08lx", gc->foreground);
   pgtk_set_cr_source_with_color(f, gc->foreground);
 }
 
index 5c59d5e623a1a569424b11a991a17af996b7ec04..9d6b0a1f800421ba3e1b8c7a2bfdb32fac04e999 100644 (file)
@@ -425,8 +425,8 @@ enum
 
 /* aliases */
 #define FRAME_PGTK_VIEW(f)         FRAME_GTK_WIDGET(f)
-#define FRAME_X_WINDOW(f)          FRAME_GTK_WIDGET(f)
-#define FRAME_NATIVE_WINDOW(f)     FRAME_GTK_WIDGET(f)
+#define FRAME_X_WINDOW(f)          FRAME_GTK_OUTER_WIDGET(f)
+#define FRAME_NATIVE_WINDOW(f)     GTK_WINDOW(FRAME_X_WINDOW(f))
 
 #define FRAME_X_DISPLAY(f)        (FRAME_DISPLAY_INFO(f)->gdpy)