From f8696367bcf9cdb91f3dcf1d6b8707b29d2b208a Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 16 Mar 2026 23:55:05 +0200 Subject: [PATCH] Assign bit gravity to window in Lucid and Motif ports too * src/widget.c (EmacsFrameRealize): Assign bit_gravity, and use the value of NorthWestGravity which matches the GTK3 behavior, and the general intuition that window's contents should move with its top-left corner. The result is that the frame is not blinking during resizing (bug#80369). * src/xfns.c (x_window) [!USE_X_TOOLKIT]: Change bit_gravity from StaticGravity to NorthWestGravity as well, to match the others. --- src/widget.c | 2 ++ src/xfns.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widget.c b/src/widget.c index 43c8fa7185f..e767b006e3f 100644 --- a/src/widget.c +++ b/src/widget.c @@ -392,7 +392,9 @@ EmacsFrameRealize (Widget widget, XtValueMask *mask, attrs->event_mask = (STANDARD_EVENT_SET | PropertyChangeMask | SubstructureNotifyMask); + attrs->bit_gravity = NorthWestGravity; *mask |= CWEventMask; + *mask |= CWBitGravity; XtCreateWindow (widget, InputOutput, (Visual *) CopyFromParent, *mask, attrs); /* Some ConfigureNotify events does not end up in EmacsFrameResize so diff --git a/src/xfns.c b/src/xfns.c index 87ce3af30d7..33ec8312cb5 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4483,7 +4483,7 @@ x_window (struct frame *f) attributes.background_pixel = FRAME_BACKGROUND_PIXEL (f); attributes.border_pixel = f->output_data.x->border_pixel; - attributes.bit_gravity = StaticGravity; + attributes.bit_gravity = NorthWestGravity; attributes.backing_store = NotUseful; attributes.save_under = True; attributes.event_mask = STANDARD_EVENT_SET;