[gnome-panel] panel-toplevel: use gdk to set window type hint
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel-toplevel: use gdk to set window type hint
- Date: Mon, 12 Oct 2015 20:58:23 +0000 (UTC)
commit b679c3d48c42e8f145d8cfd08bb4bbab1ac6cf53
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Oct 12 23:54:38 2015 +0300
panel-toplevel: use gdk to set window type hint
gnome-panel/panel-layout.c | 4 ++-
gnome-panel/panel-toplevel.c | 2 -
gnome-panel/panel-xutils.c | 49 ------------------------------------------
gnome-panel/panel-xutils.h | 11 ---------
4 files changed, 3 insertions(+), 63 deletions(-)
---
diff --git a/gnome-panel/panel-layout.c b/gnome-panel/panel-layout.c
index 3745547..53893e7 100644
--- a/gnome-panel/panel-layout.c
+++ b/gnome-panel/panel-layout.c
@@ -1034,8 +1034,10 @@ panel_layout_load_toplevel (const char *toplevel_id)
PANEL_LAYOUT_TOPLEVEL_PATH, toplevel_id);
toplevel = g_object_new (PANEL_TYPE_TOPLEVEL,
- "toplevel-id", toplevel_id,
+ "decorated", FALSE,
"settings-path", path,
+ "toplevel-id", toplevel_id,
+ "type-hint", GDK_WINDOW_TYPE_HINT_DOCK,
NULL);
g_free (path);
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 0b282fa..d9e1d63 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -2610,7 +2610,6 @@ panel_toplevel_realize (GtkWidget *widget)
GdkWindow *window;
GdkGeometry geometry;
- gtk_window_set_decorated (GTK_WINDOW (widget), FALSE);
gtk_window_stick (GTK_WINDOW (widget));
if (GTK_WIDGET_CLASS (panel_toplevel_parent_class)->realize)
@@ -2619,7 +2618,6 @@ panel_toplevel_realize (GtkWidget *widget)
window = gtk_widget_get_window (widget);
panel_struts_set_window_hint (toplevel);
- panel_xutils_set_window_type (window, PANEL_XUTILS_TYPE_DOCK);
gdk_window_set_group (window, window);
gdk_window_set_geometry_hints (window, &geometry, GDK_HINT_POS);
diff --git a/gnome-panel/panel-xutils.c b/gnome-panel/panel-xutils.c
index ce8192c..01255df 100644
--- a/gnome-panel/panel-xutils.c
+++ b/gnome-panel/panel-xutils.c
@@ -30,58 +30,9 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
-static Atom net_wm_window_type = None;
-static Atom net_wm_window_type_dock = None;
-static Atom net_wm_window_type_normal = None;
static Atom net_wm_strut = None;
static Atom net_wm_strut_partial = None;
-void
-panel_xutils_set_window_type (GdkWindow *gdk_window,
- PanelXUtilsWindowType type)
-{
- Display *display;
- Window window;
- Atom atoms [2];
- int i = 0;
-
- g_return_if_fail (GDK_IS_WINDOW (gdk_window));
-
- display = GDK_WINDOW_XDISPLAY (gdk_window);
- window = GDK_WINDOW_XID (gdk_window);
-
- if (net_wm_window_type == None)
- net_wm_window_type = XInternAtom (display,
- "_NET_WM_WINDOW_TYPE",
- False);
-
- switch (type) {
- case PANEL_XUTILS_TYPE_DOCK:
- if (net_wm_window_type_dock == None)
- net_wm_window_type_dock = XInternAtom (display,
- "_NET_WM_WINDOW_TYPE_DOCK",
- False);
- atoms [i++] = net_wm_window_type_dock;
- break;
- case PANEL_XUTILS_TYPE_NORMAL:
- if (net_wm_window_type_normal == None)
- net_wm_window_type_normal = XInternAtom (display,
- "_NET_WM_WINDOW_TYPE_NORMAL",
- False);
- atoms [i++] = net_wm_window_type_normal;
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- gdk_error_trap_push ();
- XChangeProperty (display, window, net_wm_window_type,
- XA_ATOM, 32, PropModeReplace,
- (guchar *) &atoms, i);
- gdk_error_trap_pop_ignored ();
-}
-
enum {
STRUT_LEFT = 0,
STRUT_RIGHT = 1,
diff --git a/gnome-panel/panel-xutils.h b/gnome-panel/panel-xutils.h
index 2e8d6a4..08c9147 100644
--- a/gnome-panel/panel-xutils.h
+++ b/gnome-panel/panel-xutils.h
@@ -25,22 +25,11 @@
#include <glib.h>
#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-
-#include <X11/Xlib.h>
#include "panel-enums.h"
G_BEGIN_DECLS
-typedef enum {
- PANEL_XUTILS_TYPE_NORMAL,
- PANEL_XUTILS_TYPE_DOCK
-} PanelXUtilsWindowType;
-
-void panel_xutils_set_window_type (GdkWindow *gdk_window,
- PanelXUtilsWindowType type);
-
void panel_xutils_set_strut (GdkWindow *gdk_window,
PanelOrientation orientation,
guint32 strut,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]