XSETFRAME (frame, f);
fs_state = Fframe_parameter (frame, Qfullscreen);
- if (EQ (fs_state, Qmaximized) || EQ (fs_state, Qfullboth))
+ if ((EQ (fs_state, Qmaximized) || EQ (fs_state, Qfullboth)) &&
+ (x_wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_wm_state) ||
+ x_wm_supports (f, FRAME_DISPLAY_INFO (f)->Xatom_net_wm_state_fullscreen)))
{
/* Don't set hints when maximized or fullscreen. Apparently KWin and
Gtk3 don't get along and the frame shrinks (!).
Specification/Extended Window Manager Hints at
http://freedesktop.org/wiki/Specifications/wm-spec. */
-static bool
-wm_supports (struct frame *f, Atom want_atom)
+bool
+x_wm_supports (struct frame *f, Atom want_atom)
{
Atom actual_type;
unsigned long actual_size, bytes_remaining;
do_ewmh_fullscreen (struct frame *f)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
- bool have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state);
+ bool have_net_atom = x_wm_supports (f, dpyinfo->Xatom_net_wm_state);
int cur;
bool dummy;
/* Some window managers don't say they support _NET_WM_STATE, but they do say
they support _NET_WM_STATE_FULLSCREEN. Try that also. */
if (!have_net_atom)
- have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state_fullscreen);
+ have_net_atom = x_wm_supports (f, dpyinfo->Xatom_net_wm_state_fullscreen);
if (have_net_atom && cur != f->want_fullscreen)
{
static void
x_check_fullscreen (struct frame *f)
{
+ Lisp_Object lval = Qnil;
+
if (do_ewmh_fullscreen (f))
return;
switch (f->want_fullscreen)
{
/* No difference between these two when there is no WM */
- case FULLSCREEN_BOTH:
case FULLSCREEN_MAXIMIZED:
+ lval = Qmaximized;
+ width = x_display_pixel_width (dpyinfo);
+ height = x_display_pixel_height (dpyinfo);
+ break;
+ case FULLSCREEN_BOTH:
+ lval = Qfullboth;
width = x_display_pixel_width (dpyinfo);
height = x_display_pixel_height (dpyinfo);
break;
case FULLSCREEN_WIDTH:
+ lval = Qfullwidth;
width = x_display_pixel_width (dpyinfo);
height = height + FRAME_MENUBAR_HEIGHT (f);
break;
case FULLSCREEN_HEIGHT:
+ lval = Qfullheight;
height = x_display_pixel_height (dpyinfo);
}
frame_size_history_add
(f, Qx_check_fullscreen, width, height, Qnil);
+ x_wm_set_size_hint (f, 0, false);
+
XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
width, height);
x_sync (f);
}
}
+
+ /* `x_net_wm_state' might have reset the fullscreen frame parameter,
+ restore it. */
+ store_frame_param (f, Qfullscreen, lval);
}
/* This function is called by x_set_offset to determine whether the window
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
- if (FRAME_VISIBLE_P (f) && wm_supports (f, dpyinfo->Xatom_net_active_window))
+ if (FRAME_VISIBLE_P (f) && x_wm_supports (f, dpyinfo->Xatom_net_active_window))
{
Lisp_Object frame;
XSETFRAME (frame, f);