diff options
| author | Jan Djärv | 2011-06-26 20:47:07 +0200 |
|---|---|---|
| committer | Jan Djärv | 2011-06-26 20:47:07 +0200 |
| commit | c7e73be5f7c8f5d24757ace235bc622a9a7fdcd0 (patch) | |
| tree | d32a59317249eaa9958627f1a6a3584db670ba46 /src/gtkutil.c | |
| parent | 247f696e50461a50306bc77d3683007bd06e8ba7 (diff) | |
| download | emacs-c7e73be5f7c8f5d24757ace235bc622a9a7fdcd0.tar.gz emacs-c7e73be5f7c8f5d24757ace235bc622a9a7fdcd0.zip | |
Fix wm_size-hints race between KDE/KWin and Gtk+ 3.
* emacsgtkfixed.c: State that this is only used with Gtk+3.
(_EmacsFixedPrivate): Remove minwidth/height.
Add struct frame *f.
(emacs_fixed_init): Initialize priv->f.
(get_parent_class, emacs_fixed_set_min_size): Remove.
(emacs_fixed_new): Set priv->f to argument.
(emacs_fixed_get_preferred_width)
(emacs_fixed_get_preferred_height): Use min_width/height from
frames size_hint to set minimum and natural.
(XSetWMSizeHints, XSetWMNormalHints): Override these functions
and use min_width/height from frames size_hint to set
min_width/height (Bug#8919).
* emacsgtkfixed.h: State that this is only used with Gtk+3.
(emacs_fixed_set_min_size): Remove.
(emacs_fixed_new): Take frame as argument.
* gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
(x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size. Fix
indentation.
Diffstat (limited to 'src/gtkutil.c')
| -rw-r--r-- | src/gtkutil.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 6c00058e7af..343fcfa083a 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1086,7 +1086,7 @@ xg_create_frame_widgets (FRAME_PTR f) | |||
| 1086 | whbox = gtk_hbox_new (FALSE, 0); | 1086 | whbox = gtk_hbox_new (FALSE, 0); |
| 1087 | 1087 | ||
| 1088 | #ifdef HAVE_GTK3 | 1088 | #ifdef HAVE_GTK3 |
| 1089 | wfixed = emacs_fixed_new (); | 1089 | wfixed = emacs_fixed_new (f); |
| 1090 | #else | 1090 | #else |
| 1091 | wfixed = gtk_fixed_new (); | 1091 | wfixed = gtk_fixed_new (); |
| 1092 | #endif | 1092 | #endif |
| @@ -1286,18 +1286,6 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) | |||
| 1286 | size_hints.min_width = base_width + min_cols * size_hints.width_inc; | 1286 | size_hints.min_width = base_width + min_cols * size_hints.width_inc; |
| 1287 | size_hints.min_height = base_height + min_rows * size_hints.height_inc; | 1287 | size_hints.min_height = base_height + min_rows * size_hints.height_inc; |
| 1288 | 1288 | ||
| 1289 | #ifdef HAVE_GTK3 | ||
| 1290 | /* Gtk3 ignores min width/height and overwrites them with its own idea | ||
| 1291 | of min width/height. Put out min values to the widget so Gtk | ||
| 1292 | gets the same value we want it to be. Without this, a user can't | ||
| 1293 | shrink an Emacs frame. | ||
| 1294 | */ | ||
| 1295 | if (FRAME_GTK_WIDGET (f)) | ||
| 1296 | emacs_fixed_set_min_size (EMACS_FIXED (FRAME_GTK_WIDGET (f)), | ||
| 1297 | size_hints.min_width, | ||
| 1298 | size_hints.min_height); | ||
| 1299 | #endif | ||
| 1300 | |||
| 1301 | /* These currently have a one to one mapping with the X values, but I | 1289 | /* These currently have a one to one mapping with the X values, but I |
| 1302 | don't think we should rely on that. */ | 1290 | don't think we should rely on that. */ |
| 1303 | hint_flags |= GDK_HINT_WIN_GRAVITY; | 1291 | hint_flags |= GDK_HINT_WIN_GRAVITY; |
| @@ -1336,7 +1324,7 @@ x_wm_set_size_hint (FRAME_PTR f, long int flags, int user_position) | |||
| 1336 | { | 1324 | { |
| 1337 | BLOCK_INPUT; | 1325 | BLOCK_INPUT; |
| 1338 | gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 1326 | gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 1339 | NULL, &size_hints, hint_flags); | 1327 | NULL, &size_hints, hint_flags); |
| 1340 | f->output_data.x->size_hints = size_hints; | 1328 | f->output_data.x->size_hints = size_hints; |
| 1341 | f->output_data.x->hint_flags = hint_flags; | 1329 | f->output_data.x->hint_flags = hint_flags; |
| 1342 | UNBLOCK_INPUT; | 1330 | UNBLOCK_INPUT; |