From: Philipp Stephani Date: Sun, 27 Aug 2017 10:38:46 +0000 (+0200) Subject: Always use gtk_window_move in new versions X-Git-Tag: emacs-26.0.90~334 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe49aa17d505f13926eac2212b89effec9bd3c98;p=emacs.git Always use gtk_window_move in new versions * src/gtkutil.c (my_log_handler): Don’t define in new versions of GTK+. (xg_set_geometry): Always use gtk_window_move in new versions of GTK+. * src/xterm.c (syms_of_xterm): Document that x-gtk-use-window-move is ignored. * lisp/subr.el (x-gtk-use-window-move): Make obsolete. --- diff --git a/etc/NEWS b/etc/NEWS index d53e0d25f78..6cd4bcac795 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1261,6 +1261,10 @@ break. ** The arguments LOCKNAME and MUSTBENEW of 'write-region' are propagated to file name handlers now. +** When built against recent versions of GTK+, Emacs always uses +gtk_window_move for moving frames and ignores the value of the +variable 'x-gtk-use-window-move'. The variable is now obsolete. + * Lisp Changes in Emacs 26.1 diff --git a/lisp/subr.el b/lisp/subr.el index b3f9f902349..2ad52f6a638 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1478,6 +1478,8 @@ be a list of the form returned by `event-start' and `event-end'." ;; but Stefan insists to mark it so. (make-obsolete-variable 'translation-table-for-input nil "23.1") +(make-obsolete-variable 'x-gtk-use-window-move nil "26.1") + (defvaralias 'messages-buffer-max-lines 'message-log-max) ;;;; Alternate names for functions - these are not being phased out. diff --git a/src/gtkutil.c b/src/gtkutil.c index 7a110daef1e..a2e9f266758 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -792,6 +792,7 @@ xg_hide_tooltip (struct frame *f) General functions for creating widgets, resizing, events, e.t.c. ***********************************************************************/ +#if ! GTK_CHECK_VERSION (3, 22, 0) static void my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg, gpointer user_data) @@ -799,6 +800,7 @@ my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, if (!strstr (msg, "visible children")) fprintf (stderr, "XX %s-WARNING **: %s\n", log_domain, msg); } +#endif /* Make a geometry string and pass that to GTK. It seems this is the only way to get geometry position right if the user explicitly @@ -810,8 +812,10 @@ xg_set_geometry (struct frame *f) { if (f->size_hint_flags & (USPosition | PPosition)) { +#if ! GTK_CHECK_VERSION (3, 22, 0) if (x_gtk_use_window_move) { +#endif /* Handle negative positions without consulting gtk_window_parse_geometry (Bug#25851). The position will be off by scrollbar width + window manager decorations. */ @@ -828,6 +832,7 @@ xg_set_geometry (struct frame *f) /* Reset size hint flags. */ f->size_hint_flags &= ~ (XNegative | YNegative); +# if ! GTK_CHECK_VERSION (3, 22, 0) } else { @@ -859,6 +864,7 @@ xg_set_geometry (struct frame *f) g_log_remove_handler ("Gtk", id); } +#endif } } diff --git a/src/xterm.c b/src/xterm.c index d9a6df75d97..eff1519bf48 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -13311,6 +13311,7 @@ transition between the various maximization states. */); doc: /* Non-nil means rely on gtk_window_move to set frame positions. If this variable is t (the default), the GTK build uses the function gtk_window_move to set or store frame positions and disables some time -consuming frame position adjustments. */); +consuming frame position adjustments. In newer versions of GTK, Emacs +always uses gtk_window_move and ignores the value of this variable. */); x_gtk_use_window_move = true; }