summaryrefslogtreecommitdiff
path: root/src/pgtkterm.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-02-07 10:37:08 +0800
committerPo Lu <luangruo@yahoo.com>2022-02-07 10:38:15 +0800
commite9217d0f348ec1be6950630795ff940f5b556f8e (patch)
tree8cd5ec1a524e62439b5f05c5d621f8fb3dff4389 /src/pgtkterm.c
parent905dad0a3186a464d0c7d249cb185e55be43dfd7 (diff)
downloademacs-e9217d0f348ec1be6950630795ff940f5b556f8e.tar.gz
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.
Diffstat (limited to 'src/pgtkterm.c')
-rw-r--r--src/pgtkterm.c129
1 files changed, 32 insertions, 97 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 169d3f8a031..9d15b671dd2 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);