summaryrefslogtreecommitdiff
path: root/src/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/events.c')
-rw-r--r--src/events.c65
1 files changed, 54 insertions, 11 deletions
diff --git a/src/events.c b/src/events.c
index 0b2099b..b007bdb 100644
--- a/src/events.c
+++ b/src/events.c
@@ -856,11 +856,33 @@ event_filter_func (GdkXEvent *gdkxevent,
GdkDisplay *gdkdisplay;
XEvent *xevent = gdkxevent;
gulong xid = 0;
+ Window select = 0;
gdkdisplay = gdk_display_get_default ();
xdisplay = GDK_DISPLAY_XDISPLAY (gdkdisplay);
switch (xevent->type) {
+ case CreateNotify:
+ {
+ if (!wnck_window_get (xevent->xcreatewindow.window))
+ {
+ GdkWindow *toplevel = gdk_window_foreign_new_for_display (gdkdisplay,
+ xevent->xcreatewindow.window);
+
+ if (toplevel)
+ {
+ gdk_window_set_events (toplevel,
+ gdk_window_get_events (toplevel) |
+ GDK_PROPERTY_CHANGE_MASK);
+
+ /* check if the window is a switcher and update accordingly */
+
+ if (get_window_prop (xevent->xcreatewindow.window, select_window_atom, &select))
+ update_switcher_window (xevent->xcreatewindow.window, select);
+ }
+ }
+ }
+ break;
case ButtonPress:
case ButtonRelease:
xid = (gulong)
@@ -888,9 +910,9 @@ event_filter_func (GdkXEvent *gdkxevent,
win = wnck_window_get (xid);
if (win)
{
- Window frame, window;
+ Window frame;
- if (!get_window_prop (xid, select_window_atom, &window))
+ if (!get_window_prop (xid, select_window_atom, &select))
{
if (get_window_prop (xid, frame_input_window_atom, &frame))
add_frame_window (win, frame, FALSE);
@@ -908,9 +930,9 @@ event_filter_func (GdkXEvent *gdkxevent,
win = wnck_window_get (xid);
if (win)
{
- Window frame, window;
+ Window frame;
- if (!get_window_prop (xid, select_window_atom, &window))
+ if (!get_window_prop (xid, select_window_atom, &select))
{
if (get_window_prop (xid, frame_output_window_atom, &frame))
add_frame_window (win, frame, TRUE);
@@ -971,24 +993,45 @@ event_filter_func (GdkXEvent *gdkxevent,
}
else if (xevent->xproperty.atom == select_window_atom)
{
- WnckWindow *win;
+ Window select;
- xid = xevent->xproperty.window;
+ if (get_window_prop (xevent->xproperty.window, select_window_atom, &select))
+ update_switcher_window (xevent->xproperty.window, select);
+ }
+ else if (xevent->xproperty.atom == XA_WM_TRANSIENT_FOR)
+ {
+ WnckWindow *win = wnck_window_get (xevent->xproperty.window);
- win = wnck_window_get (xid);
- if (win)
+ if (win &&
+ wnck_window_get_window_type (win) == WNCK_WINDOW_DIALOG)
{
- Window select;
+ Window parent;
+
+ if (get_window_prop (xevent->xproperty.window, XA_WM_TRANSIENT_FOR, &parent))
+ {
+ WnckWindow *p = wnck_window_get (parent);
+ decor_t *d = g_object_get_data (G_OBJECT (p), "decor");
+ decor_t *d_transient = g_object_get_data (G_OBJECT (p), "decor");
+
+ if (g_slist_find (d->transient_windows, p))
+ break;
- if (get_window_prop (xid, select_window_atom, &select))
- update_switcher_window (win, select);
+ if (d)
+ {
+ d->transient_windows = g_slist_append (d->transient_windows, win);
+ d_transient->transient_parent = p;
+ }
+ }
}
}
break;
case DestroyNotify:
+ {
g_hash_table_remove (frame_table,
GINT_TO_POINTER (xevent->xproperty.window));
+
break;
+ }
case ClientMessage:
if (xevent->xclient.message_type == toolkit_action_atom)
{