From 36b6b34ca77a6349d90032e537d738e0233b7220 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 17 May 2003 13:47:55 +0000 Subject: Use gtk api for fullscreen, not wm directly 2003-05-17 Marco Pesenti Gritti * src/ephy-window.c: (ephy_window_set_chrome): Use gtk api for fullscreen, not wm directly --- src/ephy-window.c | 61 ++++++++----------------------------------------------- 1 file changed, 8 insertions(+), 53 deletions(-) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index b0d16d614..b8d3bc656 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -692,57 +692,6 @@ ephy_window_get_chrome (EphyWindow *window) return window->priv->chrome_mask; } -static void -wmspec_change_state (gboolean add, - GdkWindow *window, - GdkAtom state1, - GdkAtom state2) -{ - XEvent xev; - - #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ - #define _NET_WM_STATE_ADD 1 /* add/set property */ - #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ - - xev.xclient.type = ClientMessage; - xev.xclient.serial = 0; - xev.xclient.send_event = True; - xev.xclient.display = gdk_display; - xev.xclient.window = GDK_WINDOW_XID (window); - xev.xclient.message_type = gdk_x11_get_xatom_by_name ("_NET_WM_STATE"); - xev.xclient.format = 32; - xev.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; - xev.xclient.data.l[1] = gdk_x11_atom_to_xatom (state1); - xev.xclient.data.l[2] = gdk_x11_atom_to_xatom (state2); - - XSendEvent (gdk_display, GDK_WINDOW_XID (gdk_get_default_root_window ()), - False, - SubstructureRedirectMask | SubstructureNotifyMask, - &xev); -} - -static void -window_set_fullscreen_mode (EphyWindow *window, gboolean active) -{ - GdkWindow *gdk_window; - - gdk_window = GTK_WIDGET(window)->window; - - if (gdk_net_wm_supports (gdk_atom_intern ("_NET_WM_STATE_FULLSCREEN", - FALSE))) - { - wmspec_change_state (active, - gdk_window, - gdk_atom_intern ("_NET_WM_STATE_FULLSCREEN", - FALSE), - GDK_NONE); - } - else - { - g_warning ("NET_WM_STATE_FULLSCREEN not supported"); - } -} - static void translate_default_chrome (EmbedChromeMask *chrome_mask) { @@ -852,8 +801,14 @@ ephy_window_set_chrome (EphyWindow *window, (flags & EMBED_CHROME_OPENASFULLSCREEN)) { save_window_chrome (window); - window_set_fullscreen_mode (window, - flags & EMBED_CHROME_OPENASFULLSCREEN); + if (flags & EMBED_CHROME_OPENASFULLSCREEN) + { + gtk_window_fullscreen (GTK_WINDOW (window)); + } + else + { + gtk_window_unfullscreen (GTK_WINDOW (window)); + } } window->priv->chrome_mask = flags; -- cgit