emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e9217d0f34: Clean up more code from PGTK port


From: Po Lu
Subject: master e9217d0f34: Clean up more code from PGTK port
Date: Sun, 6 Feb 2022 21:38:46 -0500 (EST)

branch: master
commit e9217d0f348ec1be6950630795ff940f5b556f8e
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Clean up more code from PGTK port
    
    * lisp/term/pgtk-win.el (pgtk-disown-selection-internal)
    (pgtk-get-selection-internal): Fix declarations for new calling
    conventions.
    * src/gtkutil.c (xg_frame_set_char_size, x_wm_set_size_hint):
    Clean up meaningless variables on PGTK.
    * src/pgtkfns.c (Fx_create_frame, syms_of_pgtkfns): Clean up
    meaningless variables and fix copied doc strings to use "skip".
    * src/pgtkim.c (im_context_commit_cb)
    (im_context_retrieve_surrounding_cb)
    (im_context_delete_surrounding_cb, make_color_string)
    (im_context_preedit_changed_cb, im_context_preedit_end_cb)
    (im_context_preedit_start_cb): Fix coding style.
    * src/pgtkselect.c (pgtk_selection_usable)
    (Fpgtk_disown_selection_internal, Fpgtk_get_selection_internal):
    Remove unused arguments.
    (syms_of_pgtkselect): Fix doc strings and old style variable
    declarations.
    * src/pgtkterm.c (x_set_offset, x_set_parent_frame)
    (syms_of_pgtkterm): Clean up doc strings and remove meaningless
    variables.
---
 lisp/term/pgtk-win.el |   5 +-
 src/gtkutil.c         |  16 +++---
 src/pgtkfns.c         |  64 ++++-------------------
 src/pgtkim.c          |  16 +++---
 src/pgtkselect.c      | 137 +++++++++++---------------------------------------
 src/pgtkterm.c        | 129 ++++++++++++-----------------------------------
 6 files changed, 91 insertions(+), 276 deletions(-)

diff --git a/lisp/term/pgtk-win.el b/lisp/term/pgtk-win.el
index 25f3a851dc..8e17864284 100644
--- a/lisp/term/pgtk-win.el
+++ b/lisp/term/pgtk-win.el
@@ -290,6 +290,7 @@ See the documentation of `create-fontset-from-fontset-spec' 
for the format.")
 
 ;; Any display name is OK.
 (add-to-list 'display-format-alist '(".*" . pgtk))
+
 (cl-defmethod handle-args-function (args &context (window-system pgtk))
   (x-handle-args args))
 
@@ -297,10 +298,10 @@ See the documentation of 
`create-fontset-from-fontset-spec' for the format.")
   (x-create-frame-with-faces params))
 
 (declare-function pgtk-own-selection-internal "pgtkselect.c" (selection value 
&optional frame))
-(declare-function pgtk-disown-selection-internal "pgtkselect.c" (selection 
&optional time_object terminal))
+(declare-function pgtk-disown-selection-internal "pgtkselect.c" (selection 
&optional terminal))
 (declare-function pgtk-selection-owner-p "pgtkselect.c" (&optional selection 
terminal))
 (declare-function pgtk-selection-exists-p "pgtkselect.c" (&optional selection 
terminal))
-(declare-function pgtk-get-selection-internal "pgtkselect.c" (selection-symbol 
target-type &optional time_stamp terminal))
+(declare-function pgtk-get-selection-internal "pgtkselect.c" (selection-symbol 
target-type &optional terminal))
 
 (cl-defmethod gui-backend-set-selection (selection value
                                          &context (window-system pgtk))
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6912ea1e96..95c422bbd9 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1170,7 +1170,11 @@ xg_frame_set_char_size (struct frame *f, int width, int 
height)
   else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f))
     {
       was_visible = true;
+#ifndef HAVE_PGTK
       hide_child_frame = EQ (x_gtk_resize_child_frames, Qhide);
+#else
+      hide_child_frame = false;
+#endif
 
       if (outer_width != gwidth || outer_height != gheight)
        {
@@ -1927,12 +1931,12 @@ x_wm_set_size_hint (struct frame *f, long int flags, 
bool user_position)
   else if (win_gravity == StaticGravity)
     size_hints.win_gravity = GDK_GRAVITY_STATIC;
 
-  if (x_gtk_use_window_move)
-    {
-      if (flags & PPosition) hint_flags |= GDK_HINT_POS;
-      if (flags & USPosition) hint_flags |= GDK_HINT_USER_POS;
-      if (flags & USSize) hint_flags |= GDK_HINT_USER_SIZE;
-    }
+  if (flags & PPosition)
+    hint_flags |= GDK_HINT_POS;
+  if (flags & USPosition)
+    hint_flags |= GDK_HINT_USER_POS;
+  if (flags & USSize)
+    hint_flags |= GDK_HINT_USER_SIZE;
 
   if (user_position)
     {
diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 15e14f75e4..534f1dc2a9 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -1583,12 +1583,9 @@ This function is an internal primitive--use `make-frame' 
instead.  */ )
                         RES_TYPE_BOOLEAN);
   f->no_split = minibuffer_only || EQ (tem, Qt);
 
-  /* Create the X widget or window.  */
-  /* x_window (f); */
   xg_create_frame_widgets (f);
   pgtk_set_event_handler (f);
 
-
 #define INSTALL_CURSOR(FIELD, NAME) \
   FRAME_X_OUTPUT (f)->FIELD = gdk_cursor_new_for_display (FRAME_X_DISPLAY (f), 
GDK_ ## NAME)
 
@@ -1766,14 +1763,10 @@ This function is an internal primitive--use 
`make-frame' instead.  */ )
   return unbind_to (count, frame);
 }
 
-/**
- * x_frame_restack:
- *
- * Restack frame F1 below frame F2, above if ABOVE_FLAG is non-nil.  In
- * practice this is a two-step action: The first step removes F1's
- * window-system window from the display.  The second step reinserts
- * F1's window below (above if ABOVE_FLAG is true) that of F2.
- */
+/* Restack frame F1 below frame F2, above if ABOVE_FLAG is non-nil.
+   In practice this is a two-step action: The first step removes F1's
+   window-system window from the display.  The second step reinserts
+   F1's window below (above if ABOVE_FLAG is true) that of F2.  */
 static void
 pgtk_frame_restack (struct frame *f1, struct frame *f2, bool above_flag)
 {
@@ -1782,7 +1775,6 @@ pgtk_frame_restack (struct frame *f1, struct frame *f2, 
bool above_flag)
   unblock_input ();
 }
 
-
 DEFUN ("pgtk-frame-restack", Fpgtk_frame_restack, Spgtk_frame_restack, 2, 3, 0,
        doc: /* Restack FRAME1 below FRAME2.
 This means that if both frames are visible and the display areas of
@@ -3874,7 +3866,7 @@ syms_of_pgtkfns (void)
   DEFSYM (Qresize_mode, "resize-mode");
 
   DEFVAR_LISP ("x-cursor-fore-pixel", Vx_cursor_fore_pixel,
-              doc: /* A string indicating the foreground color of the cursor 
box.  */);
+              doc: /* SKIP: real doc in xfns.c.  */);
   Vx_cursor_fore_pixel = Qnil;
 
   DEFVAR_LISP ("pgtk-icon-type-alist", Vpgtk_icon_type_alist,
@@ -3898,14 +3890,7 @@ When you miniaturize a Group, Summary or Article frame, 
Gnus.tiff will
 be used as the image of the icon representing the frame.  */);
   Vpgtk_icon_type_alist = list1 (Qt);
 
-
-  /* Provide x-toolkit also for GTK.  Internally GTK does not use Xt so it
-     is not an X toolkit in that sense (USE_X_TOOLKIT is not defined).
-     But for a user it is a toolkit for X, and indeed, configure
-     accepts --with-x-toolkit=gtk.  */
-  Fprovide (intern_c_string ("x-toolkit"), Qnil);
   Fprovide (intern_c_string ("gtk"), Qnil);
-  Fprovide (intern_c_string ("move-toolbar"), Qnil);
 
   DEFVAR_LISP ("gtk-version-string", Vgtk_version_string,
               doc: /* Version info for GTK+.  */);
@@ -3998,52 +3983,21 @@ be used as the image of the icon representing the 
frame.  */);
 
   /* This is not ifdef:ed, so other builds than GTK can customize it.  */
   DEFVAR_BOOL ("x-gtk-use-old-file-dialog", x_gtk_use_old_file_dialog,
-              doc: /* Non-nil means prompt with the old GTK file selection 
dialog.
-If nil or if the file selection dialog is not available, the new GTK file
-chooser is used instead.  To turn off all file dialogs set the
-variable `use-file-dialog'.  */);
+              doc: /* SKIP: real doc in xfns.c.  */);
   x_gtk_use_old_file_dialog = false;
 
   DEFVAR_BOOL ("x-gtk-show-hidden-files", x_gtk_show_hidden_files,
-              doc: /* If non-nil, the GTK file chooser will by default show 
hidden files.
-Note that this is just the default, there is a toggle button on the file
-chooser to show or not show hidden files on a case by case basis.  */);
+              doc: /* SKIP: real doc in xfns.c.  */);
   x_gtk_show_hidden_files = false;
 
   DEFVAR_BOOL ("x-gtk-file-dialog-help-text", x_gtk_file_dialog_help_text,
-              doc: /* If non-nil, the GTK file chooser will show additional 
help text.
-If more space for files in the file chooser dialog is wanted, set this to nil
-to turn the additional text off.  */);
+              doc: /* SKIP: real doc in xfns.c.  */);
   x_gtk_file_dialog_help_text = true;
 
   DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size,
-    doc: /* Maximum size for tooltips.
-Value is a pair (COLUMNS . ROWS).  Text larger than this is clipped.  */);
+              doc: /* SKIP: real doc in xfns.c.  */);
   Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40));
 
-  DEFVAR_LISP ("x-gtk-resize-child-frames", x_gtk_resize_child_frames,
-    doc: /* If non-nil, resize child frames specially with GTK builds.
-If this is nil, resize child frames like any other frames.  This is the
-default and usually works with most desktops.  Some desktop environments
-(GNOME shell in particular when using the mutter window manager),
-however, may refuse to resize a child frame when Emacs is built with
-GTK3.  For those environments, the two settings below are provided.
-
-If this equals the symbol 'hide', Emacs temporarily hides the child
-frame during resizing.  This approach seems to work reliably, may
-however induce some flicker when the frame is made visible again.
-
-If this equals the symbol 'resize-mode', Emacs uses GTK's resize mode to
-always trigger an immediate resize of the child frame.  This method is
-deprecated by GTK and may not work in future versions of that toolkit.
-It also may freeze Emacs when used with other desktop environments.  It
-avoids, however, the unpleasant flicker induced by the hiding approach.
-
-This variable is considered a temporary workaround and will be hopefully
-eliminated in future versions of Emacs.  */);
-  x_gtk_resize_child_frames = Qnil;
-
-
   DEFSYM (Qmono, "mono");
   DEFSYM (Qassq_delete_all, "assq-delete-all");
 
diff --git a/src/pgtkim.c b/src/pgtkim.c
index 8577ba2116..e1fffafb61 100644
--- a/src/pgtkim.c
+++ b/src/pgtkim.c
@@ -25,7 +25,9 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include "pgtkterm.h"
 
 static void
-im_context_commit_cb (GtkIMContext * imc, gchar * str, gpointer user_data)
+im_context_commit_cb (GtkIMContext *imc,
+                     gchar *str,
+                     gpointer user_data)
 {
   struct pgtk_display_info *dpyinfo = user_data;
   struct frame *f = dpyinfo->im.focused_frame;
@@ -39,21 +41,21 @@ im_context_commit_cb (GtkIMContext * imc, gchar * str, 
gpointer user_data)
 }
 
 static gboolean
-im_context_retrieve_surrounding_cb (GtkIMContext * imc, gpointer user_data)
+im_context_retrieve_surrounding_cb (GtkIMContext *imc, gpointer user_data)
 {
   gtk_im_context_set_surrounding (imc, "", -1, 0);
   return TRUE;
 }
 
 static gboolean
-im_context_delete_surrounding_cb (GtkIMContext * imc, int offset, int n_chars,
+im_context_delete_surrounding_cb (GtkIMContext *imc, int offset, int n_chars,
                                  gpointer user_data)
 {
   return TRUE;
 }
 
 static Lisp_Object
-make_color_string (PangoAttrColor * pac)
+make_color_string (PangoAttrColor *pac)
 {
   char buf[256];
   sprintf (buf, "#%02x%02x%02x",
@@ -62,7 +64,7 @@ make_color_string (PangoAttrColor * pac)
 }
 
 static void
-im_context_preedit_changed_cb (GtkIMContext * imc, gpointer user_data)
+im_context_preedit_changed_cb (GtkIMContext *imc, gpointer user_data)
 {
   struct pgtk_display_info *dpyinfo = user_data;
   struct frame *f = dpyinfo->im.focused_frame;
@@ -149,7 +151,7 @@ im_context_preedit_changed_cb (GtkIMContext * imc, gpointer 
user_data)
 }
 
 static void
-im_context_preedit_end_cb (GtkIMContext * imc, gpointer user_data)
+im_context_preedit_end_cb (GtkIMContext *imc, gpointer user_data)
 {
   struct pgtk_display_info *dpyinfo = user_data;
   struct frame *f = dpyinfo->im.focused_frame;
@@ -163,7 +165,7 @@ im_context_preedit_end_cb (GtkIMContext * imc, gpointer 
user_data)
 }
 
 static void
-im_context_preedit_start_cb (GtkIMContext * imc, gpointer user_data)
+im_context_preedit_start_cb (GtkIMContext *imc, gpointer user_data)
 {
 }
 
diff --git a/src/pgtkselect.c b/src/pgtkselect.c
index 24fed19cd2..2660ea3ed3 100644
--- a/src/pgtkselect.c
+++ b/src/pgtkselect.c
@@ -230,82 +230,9 @@ pgtk_selection_usable (void)
   if (pgtk_enable_selection_on_multi_display)
     return true;
 
-  /*
-   * 
https://github.com/GNOME/gtk/blob/gtk-3-24/gdk/wayland/gdkselection-wayland.c#L1033
-   *
-   * Gdk uses gdk_display_get_default() when handling selections, so
-   * selections don't work properly on multi-display environment.
-   *
-   * ----------------
-   * #include <gtk/gtk.h>
-   *
-   * static GtkWidget *top1, *top2;
-   *
-   * int main (int argc, char **argv)
-   * {
-   *     GtkWidget *w;
-   *     GtkTextBuffer *buf;
-   *
-   *     gtk_init (&argc, &argv);
-   *
-   *     static char *text = "\
-   * It is fine today.\n\
-   * It will be fine tomorrow too.\n\
-   * It is too hot.";
-   *
-   *     top1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-   *     gtk_window_set_title (GTK_WINDOW (top1), "default");
-   *     gtk_widget_show (top1);
-   *     w = gtk_text_view_new ();
-   *     gtk_container_add (GTK_CONTAINER (top1), w);
-   *     gtk_widget_show (w);
-   *     buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w));
-   *     gtk_text_buffer_insert_at_cursor (buf, text, strlen (text));
-   *     gtk_text_buffer_add_selection_clipboard (buf, 
gtk_widget_get_clipboard (w, GDK_SELECTION_PRIMARY));
-   *
-   *     unsetenv ("GDK_BACKEND");
-   *     GdkDisplay *gdpy;
-   *     const char *dpyname2;
-   *     if (strcmp (G_OBJECT_TYPE_NAME (gtk_widget_get_window (top1)), 
"GdkWaylandWindow") == 0)
-   *         dpyname2 = ":0";
-   *     else
-   *         dpyname2 = "wayland-0";
-   *     gdpy = gdk_display_open (dpyname2);
-   *     top2 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-   *     gtk_window_set_title (GTK_WINDOW (top2), dpyname2);
-   *     gtk_window_set_screen (GTK_WINDOW (top2), 
gdk_display_get_default_screen (gdpy));
-   *     gtk_widget_show (top2);
-   *     w = gtk_text_view_new ();
-   *     gtk_container_add (GTK_CONTAINER (top2), w);
-   *     gtk_widget_show (w);
-   *     buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w));
-   *     gtk_text_buffer_insert_at_cursor (buf, text, strlen (text));
-   *     gtk_text_buffer_add_selection_clipboard (buf, 
gtk_widget_get_clipboard (w, GDK_SELECTION_PRIMARY));
-   *
-   *     gtk_main ();
-   *
-   *     return 0;
-   * }
-   * ----------------
-   *
-   * This code fails if
-   *   GDK_BACKEND=x11 ./test
-   * and select on both of windows.
-   *
-   * ----------------
-   * (test:15345): GLib-GObject-CRITICAL **: 01:56:38.041: g_object_ref: 
assertion 'G_IS_OBJECT (object)' failed
-   *
-   * (test:15345): GLib-GObject-CRITICAL **: 01:56:38.042: g_object_ref: 
assertion 'G_IS_OBJECT (object)' failed
-   *
-   * (test:15345): GLib-GObject-CRITICAL **: 01:56:39.113: g_object_ref: 
assertion 'G_IS_OBJECT (object)' failed
-   *
-   * (test:15345): GLib-GObject-CRITICAL **: 01:56:39.113: g_object_ref: 
assertion 'G_IS_OBJECT (object)' failed
-   * ----------------
-   * (gtk-3.24.10)
-   *
-   * This function checks whether selections work by the number of displays.
-   * If you use more than 2 displays, then selection is disabled.
-   */
+  /* Gdk uses `gdk_display_get_default' when handling selections, so
+     selections don't work properly when Emacs is connected to
+     multiple displays.  */
 
   GdkDisplayManager *dpyman = gdk_display_manager_get ();
   GSList *list = gdk_display_manager_list_displays (dpyman);
@@ -408,21 +335,15 @@ nil, it defaults to the selected frame. */)
 }
 
 
-DEFUN ("pgtk-disown-selection-internal", Fpgtk_disown_selection_internal, 
Spgtk_disown_selection_internal, 1, 3, 0,
+DEFUN ("pgtk-disown-selection-internal", Fpgtk_disown_selection_internal,
+       Spgtk_disown_selection_internal, 1, 2, 0,
        doc: /* If we own the selection SELECTION, disown it.
 Disowning it means there is no such selection.
 
-Sets the last-change time for the selection to TIME-OBJECT (by default
-the time of the last event).
-
 TERMINAL should be a terminal object or a frame specifying the X
 server to query.  If omitted or nil, that stands for the selected
-frame's display, or the first available X display.
-
-On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused.
-On MS-DOS, all this does is return non-nil if we own the selection.
-On PGTK, the TIME-OBJECT is unused.  */)
-  (Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal)
+frame's display, or the first available X display.  */)
+  (Lisp_Object selection, Lisp_Object terminal)
 {
   struct frame *f = frame_for_pgtk_selection (terminal);
   GtkClipboard *cb;
@@ -503,29 +424,25 @@ On Nextstep, TERMINAL is unused.  */)
 }
 
 
-DEFUN ("pgtk-get-selection-internal", Fpgtk_get_selection_internal, 
Spgtk_get_selection_internal, 2, 4, 0,
-       doc: /* Return text selected from some X window.
+DEFUN ("pgtk-get-selection-internal", Fpgtk_get_selection_internal,
+       Spgtk_get_selection_internal, 2, 3, 0,
+       doc: /* Return text selected from some program.
 SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
 \(Those are literal upper-case symbol names, since that's what X expects.)
 TARGET-TYPE is the type of data desired, typically `STRING'.
 
-TIME-STAMP is the time to use in the XConvertSelection call for foreign
-selections.  If omitted, defaults to the time for the last event.
-
 TERMINAL should be a terminal object or a frame specifying the X
 server to query.  If omitted or nil, that stands for the selected
-frame's display, or the first available X display.
-
-On Nextstep, TIME-STAMP and TERMINAL are unused.
-On PGTK, TIME-STAMP is unused.  */)
+frame's display, or the first available display.  */)
   (Lisp_Object selection_symbol, Lisp_Object target_type,
-   Lisp_Object time_stamp, Lisp_Object terminal)
+   Lisp_Object terminal)
 {
   struct frame *f = frame_for_pgtk_selection (terminal);
   GtkClipboard *cb;
 
   CHECK_SYMBOL (selection_symbol);
   CHECK_SYMBOL (target_type);
+
   if (EQ (target_type, QMULTIPLE))
     error ("Retrieving MULTIPLE selections is currently unimplemented");
   if (!f)
@@ -603,21 +520,23 @@ syms_of_pgtkselect (void)
   defsubr (&Spgtk_selection_owner_p);
 
   DEFVAR_LISP ("pgtk-sent-selection-hooks", Vpgtk_sent_selection_hooks,
-              "A list of functions to be called when Emacs answers a selection 
request.\n\
-The functions are called with four arguments:\n\
-  - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');\n\
-  - the selection-type which Emacs was asked to convert the\n\
-    selection into before sending (for example, `STRING' or `LENGTH');\n\
-  - a flag indicating success or failure for responding to the request.\n\
-We might have failed (and declined the request) for any number of reasons,\n\
-including being asked for a selection that we no longer own, or being asked\n\
-to convert into a type that we don't know about or that is inappropriate.\n\
-This hook doesn't let you change the behavior of Emacs's selection replies,\n\
-it merely informs you that they have happened.");
+              doc: /* A list of functions to be called when Emacs answers a 
selection request
+The functions are called with four arguments:
+  - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');
+  - the selection-type which Emacs was asked to convert the
+    selection into before sending (for example, `STRING' or `LENGTH');
+  - a flag indicating success or failure for responding to the request.
+We might have failed (and declined the request) for any number of reasons,
+including being asked for a selection that we no longer own, or being asked
+to convert into a type that we don't know about or that is inappropriate.
+This hook doesn't let you change the behavior of Emacs's selection replies,
+it merely informs you that they have happened.  */);
   Vpgtk_sent_selection_hooks = Qnil;
 
   DEFVAR_BOOL ("pgtk-enable-selection-on-multi-display", 
pgtk_enable_selection_on_multi_display,
-              doc: /* Enable selection on multi display environment.
-This may cause crash.  */);
+              doc: /* Enable selections when connected to multiple displays.
+This may cause crashes due to a GTK bug, which assumes that clients
+will connect to a single display.  It might also cause selections to
+not arrive at the correct display.  */);
   pgtk_enable_selection_on_multi_display = false;
 }
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 169d3f8a03..9d15b671dd 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -450,8 +450,6 @@ x_set_offset (struct frame *f, int xoff, int yoff, int 
change_gravity)
      External: Position the window
    -------------------------------------------------------------------------- 
*/
 {
-  int modified_top, modified_left;
-
   if (change_gravity > 0)
     {
       f->top_pos = yoff;
@@ -469,44 +467,23 @@ x_set_offset (struct frame *f, int xoff, int yoff, int 
change_gravity)
   block_input ();
   x_wm_set_size_hint (f, 0, false);
 
-  if (x_gtk_use_window_move)
+  if (change_gravity != 0)
     {
-      if (change_gravity != 0)
+      if (FRAME_GTK_OUTER_WIDGET (f))
        {
-         if (FRAME_GTK_OUTER_WIDGET (f))
-           {
-             gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
-                              f->left_pos, f->top_pos);
-           }
-         else
-           {
-             GtkWidget *fixed = FRAME_GTK_WIDGET (f);
-             GtkWidget *parent = gtk_widget_get_parent (fixed);
-             gtk_fixed_move (GTK_FIXED (parent), fixed,
-                             f->left_pos, f->top_pos);
-           }
+         gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
+                          f->left_pos, f->top_pos);
+       }
+      else
+       {
+         GtkWidget *fixed = FRAME_GTK_WIDGET (f);
+         GtkWidget *parent = gtk_widget_get_parent (fixed);
+         gtk_fixed_move (GTK_FIXED (parent), fixed,
+                         f->left_pos, f->top_pos);
        }
-      unblock_input ();
-      return;
-    }
-
-  modified_left = f->left_pos;
-  modified_top = f->top_pos;
-
-  if (FRAME_GTK_OUTER_WIDGET (f))
-    {
-      gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
-                      modified_left, modified_top);
-    }
-  else
-    {
-      GtkWidget *fixed = FRAME_GTK_WIDGET (f);
-      GtkWidget *parent = gtk_widget_get_parent (fixed);
-      gtk_fixed_move (GTK_FIXED (parent), fixed,
-                     modified_left, modified_top);
     }
-
   unblock_input ();
+  return;
 }
 
 static void
@@ -902,14 +879,6 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value,
 
       g_object_unref (fixed);
 
-      if (FRAME_GTK_OUTER_WIDGET (f))
-       {
-         if (EQ (x_gtk_resize_child_frames, Qresize_mode))
-           gtk_container_set_resize_mode
-             (GTK_CONTAINER (FRAME_GTK_OUTER_WIDGET (f)),
-              p ? GTK_RESIZE_IMMEDIATE : GTK_RESIZE_QUEUE);
-       }
-
       unblock_input ();
 
       fset_parent_frame (f, new_value);
@@ -6942,80 +6911,46 @@ syms_of_pgtkterm (void)
   Fput (Qcontrol, Qmodifier_value, make_fixnum (ctrl_modifier));
 
   DEFVAR_LISP ("x-ctrl-keysym", Vx_ctrl_keysym,
-              doc: /* Which keys Emacs uses for the ctrl modifier.
-This should be one of the symbols `ctrl', `alt', `hyper', `meta',
-`super'.  For example, `ctrl' means use the Ctrl_L and Ctrl_R keysyms.
-The default is nil, which is the same as `ctrl'.  */ );
+              doc: /* SKIP: real doc in xterm.c.  */);
   Vx_ctrl_keysym = Qnil;
 
   DEFVAR_LISP ("x-alt-keysym", Vx_alt_keysym,
-              doc: /* Which keys Emacs uses for the alt modifier.
-This should be one of the symbols `ctrl', `alt', `hyper', `meta',
-`super'.  For example, `alt' means use the Alt_L and Alt_R keysyms.
-The default is nil, which is the same as `alt'.  */ );
+              doc: /* SKIP: real doc in xterm.c.  */);
   Vx_alt_keysym = Qnil;
 
   DEFVAR_LISP ("x-hyper-keysym", Vx_hyper_keysym,
-              doc: /* Which keys Emacs uses for the hyper modifier.
-This should be one of the symbols `ctrl', `alt', `hyper', `meta',
-`super'.  For example, `hyper' means use the Hyper_L and Hyper_R
-keysyms.  The default is nil, which is the same as `hyper'.  */ );
+              doc: /* SKIP: real doc in xterm.c.  */);
   Vx_hyper_keysym = Qnil;
 
   DEFVAR_LISP ("x-meta-keysym", Vx_meta_keysym,
-              doc: /* Which keys Emacs uses for the meta modifier.
-This should be one of the symbols `ctrl', `alt', `hyper', `meta',
-`super'.  For example, `meta' means use the Meta_L and Meta_R keysyms.
-The default is nil, which is the same as `meta'.  */ );
+              doc: /* SKIP: real doc in xterm.c.  */);
   Vx_meta_keysym = Qnil;
 
   DEFVAR_LISP ("x-super-keysym", Vx_super_keysym,
-              doc: /* Which keys Emacs uses for the super modifier.
-This should be one of the symbols `ctrl', `alt', `hyper', `meta',
-`super'.  For example, `super' means use the Super_L and Super_R
-keysyms.  The default is nil, which is the same as `super'.  */ );
+              doc: /* SKIP: real doc in xterm.c.  */);
   Vx_super_keysym = Qnil;
 
-  /* TODO: move to common code */
-  DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
-              doc: /* Which toolkit scroll bars Emacs uses, if any.
-A value of nil means Emacs doesn't use toolkit scroll bars.
-With the X Window system, the value is a symbol describing the
-X toolkit.  Possible values are: gtk, motif, xaw, or xaw3d.
-With MS Windows or Nextstep, the value is t.  */ );
-  /* Vx_toolkit_scroll_bars = Qt; */
-  Vx_toolkit_scroll_bars = intern_c_string ("gtk");
+  DEFVAR_BOOL ("x-use-underline-position-properties",
+              x_use_underline_position_properties,
+     doc: /* SKIP: real doc in xterm.c.  */);
+  x_use_underline_position_properties = 1;
 
-  DEFVAR_BOOL ("x-use-underline-position-properties", 
x_use_underline_position_properties,
-              doc: /*Non-nil means make use of UNDERLINE_POSITION font 
properties.
-A value of nil means ignore them.  If you encounter fonts with bogus
-UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
-to 4.1, set this to nil. */);
-  x_use_underline_position_properties = 0;
-
-  DEFVAR_BOOL ("x-underline-at-descent-line", x_underline_at_descent_line,
-              doc: /* Non-nil means to draw the underline at the same place as 
the descent line.
-A value of nil means to draw the underline according to the value of the
-variable `x-use-underline-position-properties', which is usually at the
-baseline level.  The default value is nil.  */);
+  DEFVAR_BOOL ("x-underline-at-descent-line",
+              x_underline_at_descent_line,
+     doc: /* SKIP: real doc in xterm.c.  */);
   x_underline_at_descent_line = 0;
 
-  DEFVAR_BOOL ("x-gtk-use-window-move", x_gtk_use_window_move,
-              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.  In newer versions of GTK, Emacs
-always uses gtk_window_move and ignores the value of this variable.  */);
-  x_gtk_use_window_move = true;
-
+  DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
+     doc: /* SKIP: real doc in xterm.c.  */);
+  Vx_toolkit_scroll_bars = intern_c_string ("gtk");
 
   DEFVAR_LISP ("pgtk-wait-for-event-timeout", Vpgtk_wait_for_event_timeout,
-              doc: /* How long to wait for X events.
+              doc: /* How long to wait for GTK events.
 
-Emacs will wait up to this many seconds to receive X events after
-making changes which affect the state of the graphical interface.
-Under some window managers this can take an indefinite amount of time,
-so it is important to limit the wait.
+Emacs will wait up to this many seconds to receive some GTK events
+after making changes which affect the state of the graphical
+interface.  Under some window managers this can take an indefinite
+amount of time, so it is important to limit the wait.
 
 If set to a non-float value, there will be no wait at all.  */);
   Vpgtk_wait_for_event_timeout = make_float (0.1);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]