summaryrefslogtreecommitdiff
path: root/zwgc
diff options
context:
space:
mode:
authorGravatar Robert A Basch <rbasch@mit.edu>2004-09-27 11:18:42 +0000
committerGravatar Robert A Basch <rbasch@mit.edu>2004-09-27 11:18:42 +0000
commitddc84d0a4abfe46b6cfac00340d1ad88e6a28009 (patch)
tree16481992d52ad41f9b923a14ffecec93b5716143 /zwgc
parent4add8116a9d226ecea9e1f023b80da533a166f41 (diff)
Set properties to work better under metacity, per the extended window
manager hints spec: 1) Set _NET_WM_WINDOW_TYPE to _NET_WM_WINDOW_TYPE_UTILITY, so that metacity does not add zephyrgram windows to the task list. 2) Set _NET_WM_DESKTOP property to 0xFFFFFFFF by default, so that zephyrgram windws appear on all workspaces. Add the "allDesktops" resource allowing users to override this behavior.
Diffstat (limited to 'zwgc')
-rw-r--r--zwgc/X_gram.c21
-rw-r--r--zwgc/zwgc.113
2 files changed, 34 insertions, 0 deletions
diff --git a/zwgc/X_gram.c b/zwgc/X_gram.c
index 98f81da..37d78aa 100644
--- a/zwgc/X_gram.c
+++ b/zwgc/X_gram.c
@@ -25,6 +25,7 @@ static const char rcsid_X_gram_c[] = "$Id$";
#include "xmark.h"
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
+#include <X11/Xatom.h>
#include "zwgc.h"
#include "X_driver.h"
#include "X_fonts.h"
@@ -62,6 +63,10 @@ static Window group_leader; /* In order to have transient windows,
static XClassHint classhint;
static XSetWindowAttributes xattributes;
static unsigned long xattributes_mask;
+static int set_all_desktops = True;
+static Atom net_wm_desktop = None;
+static Atom net_wm_window_type = None;
+static Atom net_wm_window_type_utility = None;
/* ICCCM note:
*
@@ -218,6 +223,14 @@ void x_gram_init(dpy)
|LeaveWindowMask|Button1MotionMask
|Button3MotionMask|StructureNotifyMask);
xattributes_mask = (CWBackPixel|CWBorderPixel|CWEventMask|CWCursor);
+
+ set_all_desktops = get_bool_resource("allDesktops", "AllDesktops", True);
+ net_wm_desktop = XInternAtom(dpy, "_NET_WM_DESKTOP", False);
+ net_wm_window_type = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
+ net_wm_window_type_utility = XInternAtom(dpy,
+ "_NET_WM_WINDOW_TYPE_UTILITY",
+ False);
+
temp = get_string_resource ("backingStore", "BackingStore");
if (!temp)
return;
@@ -261,6 +274,7 @@ void x_gram_create(dpy, gram, xalign, yalign, xpos, ypos, xsize, ysize,
XSizeHints sizehints;
XWMHints wmhints;
XSetWindowAttributes attributes;
+ unsigned long all_desktops = 0xFFFFFFFF;
extern void x_get_input();
/*
@@ -311,6 +325,13 @@ void x_gram_create(dpy, gram, xalign, yalign, xpos, ypos, xsize, ysize,
x_set_icccm_hints(dpy,w,title_name,icon_name,&sizehints,&wmhints,0);
}
+ if (net_wm_window_type != None && net_wm_window_type_utility != None)
+ XChangeProperty(dpy, w, net_wm_window_type, XA_ATOM, 32,
+ PropModeReplace,
+ (unsigned char *) &net_wm_window_type_utility, 1);
+ if (set_all_desktops && net_wm_desktop != None)
+ XChangeProperty(dpy, w, net_wm_desktop, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *) &all_desktops, 1);
XSaveContext(dpy, w, desc_context, (caddr_t)gram);
diff --git a/zwgc/zwgc.1 b/zwgc/zwgc.1
index 880d2ad..f4e6b87 100644
--- a/zwgc/zwgc.1
+++ b/zwgc/zwgc.1
@@ -811,6 +811,19 @@ entirely.
Transient
Secondary transient determining value [default False]
.TP
+allDesktops
+(logical) Primary value which determines if zephyrgram windows should
+appear on all desktops, for those window managers which support multiple
+desktops (sometimes referred to as workspaces). When this resource is
+true (the default),
+.I zwgc
+sets the \fB_NET_WM_DESKTOP\fR property to 0xFFFFFFFF for each zephyrgram
+window, indicating that it should appear on all desktops.
+.TP
+AllDesktops
+Secondary value determining whether zephyrgram windows should appear
+on all desktops.
+.TP
scrollDelete
(logical) If true, scrolling over a zgram will cause it
to be deleted