From e144378f5af09eba7adc9a851c4159868f71cea8 Mon Sep 17 00:00:00 2001 From: "Kirk A. Baker" Date: Mon, 11 Jul 2011 21:56:04 -0700 Subject: [PATCH] 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 --- clutter/osx/clutter-stage-osx.c | 8 +++++++- clutter/osx/clutter-stage-osx.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/clutter/osx/clutter-stage-osx.c b/clutter/osx/clutter-stage-osx.c index 9e602e552..fb6a09478 100644 --- a/clutter/osx/clutter-stage-osx.c +++ b/clutter/osx/clutter-stage-osx.c @@ -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(); } diff --git a/clutter/osx/clutter-stage-osx.h b/clutter/osx/clutter-stage-osx.h index af1d7ba90..b68f4bd24 100644 --- a/clutter/osx/clutter-stage-osx.h +++ b/clutter/osx/clutter-stage-osx.h @@ -41,7 +41,7 @@ G_BEGIN_DECLS typedef struct _ClutterStageOSX ClutterStageOSX; typedef struct _ClutterStageOSXClass ClutterStageOSXClass; -@interface ClutterGLWindow : NSWindow +@interface ClutterGLWindow : NSWindow { @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;