osx: Implement windowDidResignKey

Added isHiding field to _ClutterStageOSX to allow windowDidResignKey
delegate to not order full screen window back whilst the full screen
window was being hidden.  This caused other application windows to be
hidden.  Also added code to keep hidden stage windows from being listed
in the application's Windows menu.

https://bugzilla.gnome.org/show_bug.cgi?id=655311
This commit is contained in:
Kirk A. Baker 2011-07-11 21:56:04 -07:00 committed by Emmanuele Bassi
parent 6f6b27fac5
commit e144378f5a
2 changed files with 9 additions and 2 deletions

View File

@ -111,7 +111,8 @@ clutter_stage_osx_get_wrapper (ClutterStageWindow *stage_window);
if (self->stage_osx->stage_state & CLUTTER_STAGE_STATE_FULLSCREEN)
{
[self setLevel: NSNormalWindowLevel];
[self orderBack: nil];
if (!self->stage_osx->isHiding)
[self orderBack: nil];
}
clutter_stage_osx_state_update (self->stage_osx, CLUTTER_STAGE_STATE_ACTIVATED, 0);
@ -396,6 +397,7 @@ clutter_stage_osx_show (ClutterStageWindow *stage_window,
[self->window orderFront: nil];
[self->view setHidden:isViewHidden];
[self->window setExcludedFromWindowsMenu:NO];
/*
* After hiding we cease to be first responder.
@ -414,10 +416,14 @@ clutter_stage_osx_hide (ClutterStageWindow *stage_window)
CLUTTER_NOTE (BACKEND, "[%p] hide", self);
self->isHiding = true;
[self->window orderOut: nil];
[self->window setExcludedFromWindowsMenu:YES];
clutter_actor_unmap (CLUTTER_ACTOR (self->wrapper));
self->isHiding = false;
CLUTTER_OSX_POOL_RELEASE();
}

View File

@ -41,7 +41,7 @@ G_BEGIN_DECLS
typedef struct _ClutterStageOSX ClutterStageOSX;
typedef struct _ClutterStageOSXClass ClutterStageOSXClass;
@interface ClutterGLWindow : NSWindow
@interface ClutterGLWindow : NSWindow <NSWindowDelegate>
{
@public
ClutterStageOSX *stage_osx;
@ -67,6 +67,7 @@ struct _ClutterStageOSX
ClutterStageState stage_state;
gboolean acceptFocus;
gboolean isHiding;
gfloat scroll_pos_x;
gfloat scroll_pos_y;