--- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -135,6 +135,8 @@ along with GNU Emacs. If not, see . */ static void update_theme_scrollbar_width (void); static void update_theme_scrollbar_height (void); +bool get_current_wm_state (struct frame *, Window, int *, bool *); + #define TB_INFO_KEY "xg_frame_tb_info" struct xg_frame_tb_info { @@ -1364,7 +1366,8 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position) int base_width, base_height; int min_rows = 0, min_cols = 0; int win_gravity = f->win_gravity; - Lisp_Object fs_state, frame; + int state = FULLSCREEN_NONE; + bool sticky = false; int scale = xg_get_gdk_scale (); /* Don't set size hints during initialization; that apparently leads @@ -1373,13 +1376,12 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position) if (NILP (Vafter_init_time) || !FRAME_GTK_OUTER_WIDGET (f)) return; - XSETFRAME (frame, f); - fs_state = Fframe_parameter (frame, Qfullscreen); - if (EQ (fs_state, Qmaximized) || EQ (fs_state, Qfullboth)) + get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &state, &sticky); + if (state != FULLSCREEN_NONE) { - /* Don't set hints when maximized or fullscreen. Apparently KWin and - Gtk3 don't get along and the frame shrinks (!). - */ + /* Don't set hints when the frame currently is maximized or + fullscreen. Apparently KWin and Gtk3 don't get along and the + frame shrinks (!). */ return; } diff --git a/src/xterm.c b/src/xterm.c index b7aacfa..2e1c0b5 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -247,7 +247,7 @@ static void x_wm_set_window_state (struct frame *, int); static void x_wm_set_icon_pixmap (struct frame *, ptrdiff_t); static void x_initialize (void); -static bool get_current_wm_state (struct frame *, Window, int *, bool *); +bool get_current_wm_state (struct frame *, Window, int *, bool *); /* Flush display of frame F. */ @@ -9904,7 +9904,7 @@ x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) Return true iff we are not hidden. */ -static bool +bool get_current_wm_state (struct frame *f, Window window, int *size_state,