summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2000-08-28 00:01:14 +0000
committersabetts <sabetts>2000-08-28 00:01:14 +0000
commita36f0b057edd6de047ec38f2021152769800eda4 (patch)
treed4ebc2cf4367fd442c01590d5c671102cf71e61d
parent32d2dd86613c3a4e000dc060ebb72283878e28cf (diff)
downloadratpoison-a36f0b057edd6de047ec38f2021152769800eda4.zip
cleaned up more crashes when killing and deleting windows.
-rw-r--r--events.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/events.c b/events.c
index 02e034c..5ca04a3 100644
--- a/events.c
+++ b/events.c
@@ -126,9 +126,15 @@ destroy_window (XDestroyWindowEvent *ev)
if (s && win)
{
/* Goto the last accessed window. */
- if (win->state == STATE_MAPPED) last_window ();
-
- unmanage (win);
+ if (win == rp_current_window)
+ {
+ last_window ();
+ unmanage (win);
+ }
+ else
+ {
+ unmanage (win);
+ }
}
#ifdef DEBUG
@@ -285,19 +291,21 @@ key_press (XEvent *ev)
}
}
-/* Not complete. I just update the name everytime, but I should really
- check what kind of property update it is. */
void
property_notify (XEvent *ev)
{
rp_window *win;
- win = find_window (ev->xproperty.window);
+ printf ("atom: %ld\n", ev->xproperty.atom);
+ win = find_window (ev->xproperty.window);
if (win)
{
- printf ("updating window name\n");
- update_window_name (win);
+ if (ev->xproperty.atom == XA_WM_NAME)
+ {
+ printf ("updating window name\n");
+ update_window_name (win);
+ }
}
}
@@ -308,8 +316,8 @@ delegate_event (XEvent *ev)
switch (ev->type)
{
case ConfigureRequest:
- configure_request (&ev->xconfigurerequest);
printf ("ConfigureRequest\n");
+ configure_request (&ev->xconfigurerequest);
break;
case CirculateRequest:
printf ("CirculateRequest\n");
@@ -330,8 +338,8 @@ delegate_event (XEvent *ev)
printf ("ColormapNotify\n");
break;
case PropertyNotify:
- property_notify (ev);
printf ("PropertyNotify\n");
+ property_notify (ev);
break;
case SelectionClear:
printf ("SelectionClear\n");
@@ -363,9 +371,9 @@ delegate_event (XEvent *ev)
break;
case UnmapNotify:
- unmap_notify (ev);
printf ("UnmapNotify\n");
- break;
+ unmap_notify (ev);
+ break;
case MotionNotify:
printf ("MotionNotify\n");