summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/openbox/client.c b/openbox/client.c
index bf1d4f9c..7c23e8e0 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -33,6 +33,7 @@
#include "focus.h"
#include "stacking.h"
#include "openbox.h"
+#include "hooks.h"
#include "group.h"
#include "config.h"
#include "menuframe.h"
@@ -560,6 +561,8 @@ void client_manage(Window window, ObPrompt *prompt)
ob_debug("Managed window 0x%lx plate 0x%x (%s)",
window, self->frame->window, self->class);
+
+ hooks_run(OB_HOOK_WIN_NEW, self);
}
@@ -635,6 +638,8 @@ void client_unmanage(ObClient *self)
if (!self->prompt)
XChangeSaveSet(obt_display, self->window, SetModeDelete);
+ hooks_run(OB_HOOK_WIN_CLOSE, self);
+
/* update the focus lists */
focus_order_remove(self);
if (client_focused(self)) {
@@ -2519,6 +2524,8 @@ gboolean client_show(ObClient *self)
desktop!
*/
client_change_wm_state(self);
+
+ hooks_run(OB_HOOK_WIN_VISIBLE, self);
}
return show;
}
@@ -2557,6 +2564,8 @@ gboolean client_hide(ObClient *self)
desktop!
*/
client_change_wm_state(self);
+
+ hooks_run(OB_HOOK_WIN_INVISIBLE, self);
}
return hide;
}
@@ -3152,6 +3161,8 @@ static void client_iconify_recursive(ObClient *self,
frame_begin_iconify_animation(self->frame, iconic);
/* do this after starting the animation so it doesn't flash */
client_showhide(self);
+
+ hooks_run((iconic ? OB_HOOK_WIN_ICONIC : OB_HOOK_WIN_UNICONIC), self);
}
/* iconify all direct transients, and deiconify all transients
@@ -3239,6 +3250,8 @@ void client_maximize(ObClient *self, gboolean max, gint dir)
client_setup_decor_and_functions(self, FALSE);
client_move_resize(self, x, y, w, h);
+
+ hooks_run((max ? OB_HOOK_WIN_MAX : OB_HOOK_WIN_UNMAX), self);
}
void client_shade(ObClient *self, gboolean shade)
@@ -3252,6 +3265,8 @@ void client_shade(ObClient *self, gboolean shade)
client_change_wm_state(self); /* the window is being hidden/shown */
/* resize the frame to just the titlebar */
frame_adjust_area(self->frame, FALSE, TRUE, FALSE);
+
+ hooks_run((shade ? OB_HOOK_WIN_SHADE : OB_HOOK_WIN_UNSHADE), self);
}
static void client_ping_event(ObClient *self, gboolean dead)
@@ -3453,6 +3468,9 @@ static void client_set_desktop_recursive(ObClient *self,
/* the new desktop's geometry may be different, so we may need to
resize, for example if we are maximized */
client_reconfigure(self, FALSE);
+
+ if (old != self->desktop)
+ hooks_run(OB_HOOK_WIN_DESK_CHANGE, self);
}
/* move all transients */
@@ -3855,6 +3873,9 @@ void client_set_undecorated(ObClient *self, gboolean undecorated)
self->undecorated = undecorated;
client_setup_decor_and_functions(self, TRUE);
client_change_state(self); /* reflect this in the state hints */
+
+ hooks_run((undecorated ?
+ OB_HOOK_WIN_UNDECORATED : OB_HOOK_WIN_DECORATED), self);
}
}