diff options
author | Jess VanDerwalker <washu@sonic.net> | 2012-08-08 11:39:55 -0700 |
---|---|---|
committer | Jess VanDerwalker <washu@sonic.net> | 2012-08-29 09:15:52 -0700 |
commit | 20f256fa9f88cdfb25c6ea39150b7ebc5a876e88 (patch) | |
tree | 9d36c81e7f9b77ece1fd9b9d089a261a528415a3 /src | |
parent | a1a33a1c42bec87b41ea995a478beae42ba1ecf4 (diff) |
xtoq: Handlers for window miniaturization and de-miniaturization.
Handlers added for Xtoq window miniaturization (iconify) and
de-miniaturization (de-iconify). Calls xcwm_window_iconify() and
xcwm_window_deiconify() to update window state.
Signed-off-by: Jess VanDerwalker <washu@sonic.net>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/xtoq/XtoqController.h | 13 | ||||
-rw-r--r-- | src/xtoq/XtoqController.m | 26 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/xtoq/XtoqController.h b/src/xtoq/XtoqController.h index b8c5a93..8e1fdb9 100644 --- a/src/xtoq/XtoqController.h +++ b/src/xtoq/XtoqController.h @@ -265,6 +265,19 @@ id referenceToSelf; */ - (void)updateWindowName:(xcwm_window_t *)window; + +/** + * Handler for window miniaturize events. + * @param notification Notification object for this event. + */ +- (void)windowDidMiniaturize:(NSNotification *)notification; + +/** + * Handler for window de-miniaturize events. + * @param notification Notification object for this event. + */ +- (void)windowDidDeminiaturize:(NSNotification *)notification; + @end /** diff --git a/src/xtoq/XtoqController.m b/src/xtoq/XtoqController.m index 2e9930c..8cef877 100644 --- a/src/xtoq/XtoqController.m +++ b/src/xtoq/XtoqController.m @@ -139,6 +139,16 @@ name:NSWindowDidResizeNotification object:nil]; + [nc addObserver:self + selector:@selector(windowDidMiniaturize:) + name:NSWindowDidMiniaturizeNotification + object:nil]; + + [nc addObserver:self + selector:@selector(windowDidDeminiaturize:) + name:NSWindowDidDeminiaturizeNotification + object:nil]; + xcwmDispatchQueue = dispatch_queue_create("xcwm.dispatch.queue", NULL); // Start the event loop and set the handler function @@ -591,6 +601,22 @@ free(name); } +- (void) windowDidMiniaturize:(NSNotification *)notification +{ + XtoqWindow *xtoqWin = (XtoqWindow *)[notification object]; + xcwm_window_t *window = [xtoqWin getXcwmWindow]; + + xcwm_window_iconify(window); +} + +- (void) windowDidDeminiaturize:(NSNotification *)notification +{ + XtoqWindow *xtoqWin = (XtoqWindow *)[notification object]; + xcwm_window_t *window = [xtoqWin getXcwmWindow]; + + xcwm_window_deiconify(window); +} + @end void |