Commit 7f15d737 authored by Richard Hult's avatar Richard Hult Committed by Richard Hult

Implement type hints and use them to determine which windows should be

2006-07-19  Richard Hult  <richard@imendio.com>

	* gdk/quartz/gdkwindow-quartz.c (gdk_window_impl_quartz_init)
	(gdk_window_set_type_hint, gdk_window_get_type_hint):
	* gdk/quartz/GdkQuartzWindow.c
	([GdkQuartzWindow -canBecomeMainWindow])
	([GdkQuartzWindow -canBecomeKeyWindow]): Implement type hints and
	use them to determine which windows should be allowed to become
	main and key windows.
parent 53b03548
2006-07-19 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c (gdk_window_impl_quartz_init)
(gdk_window_set_type_hint, gdk_window_get_type_hint):
* gdk/quartz/GdkQuartzWindow.c
([GdkQuartzWindow -canBecomeMainWindow])
([GdkQuartzWindow -canBecomeKeyWindow]): Implement type hints and
use them to determine which windows should be allowed to become
main and key windows.
2006-07-19 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c:
......
2006-07-19 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c (gdk_window_impl_quartz_init)
(gdk_window_set_type_hint, gdk_window_get_type_hint):
* gdk/quartz/GdkQuartzWindow.c
([GdkQuartzWindow -canBecomeMainWindow])
([GdkQuartzWindow -canBecomeKeyWindow]): Implement type hints and
use them to determine which windows should be allowed to become
main and key windows.
2006-07-19 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c:
......
......@@ -135,11 +135,61 @@
-(BOOL)canBecomeMainWindow
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
switch (impl->type_hint)
{
case GDK_WINDOW_TYPE_HINT_NORMAL:
case GDK_WINDOW_TYPE_HINT_DIALOG:
return YES;
case GDK_WINDOW_TYPE_HINT_MENU:
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
case GDK_WINDOW_TYPE_HINT_UTILITY:
case GDK_WINDOW_TYPE_HINT_DOCK:
case GDK_WINDOW_TYPE_HINT_DESKTOP:
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
case GDK_WINDOW_TYPE_HINT_COMBO:
case GDK_WINDOW_TYPE_HINT_DND:
return NO;
}
return YES;
}
-(BOOL)canBecomeKeyWindow
{
GdkWindow *window = [[self contentView] gdkWindow];
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
switch (impl->type_hint)
{
case GDK_WINDOW_TYPE_HINT_NORMAL:
case GDK_WINDOW_TYPE_HINT_DIALOG:
case GDK_WINDOW_TYPE_HINT_MENU:
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
case GDK_WINDOW_TYPE_HINT_UTILITY:
case GDK_WINDOW_TYPE_HINT_DOCK:
case GDK_WINDOW_TYPE_HINT_DESKTOP:
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
case GDK_WINDOW_TYPE_HINT_COMBO:
return YES;
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN:
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
case GDK_WINDOW_TYPE_HINT_DND:
return NO;
}
return YES;
}
......
......@@ -134,6 +134,7 @@ gdk_window_impl_quartz_init (GdkWindowImplQuartz *impl)
{
impl->width = 1;
impl->height = 1;
impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
}
static void
......@@ -300,13 +301,10 @@ gdk_window_new (GdkWindow *parent,
GdkDrawableImplQuartz *draw_impl;
GdkVisual *visual;
GDK_QUARTZ_ALLOC_POOL;
if (parent && GDK_WINDOW_DESTROYED (parent))
{
GDK_QUARTZ_RELEASE_POOL;
return NULL;
}
return NULL;
GDK_QUARTZ_ALLOC_POOL;
if (!parent)
parent = _gdk_root;
......@@ -562,13 +560,12 @@ show_window_internal (GdkWindow *window, gboolean raise)
GdkWindowObject *private;
GdkWindowImplQuartz *impl;
private = (GdkWindowObject *)window;
if (private->destroyed)
if (GDK_WINDOW_DESTROYED (window))
return;
GDK_QUARTZ_ALLOC_POOL;
private = (GdkWindowObject *)window;
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
/* FIXME: We need to raise the window (move it to the top in the list) */
......@@ -1245,14 +1242,19 @@ gdk_window_set_type_hint (GdkWindow *window,
{
g_return_if_fail (GDK_IS_WINDOW (window));
/* FIXME: Implement */
if (GDK_WINDOW_DESTROYED (window))
return;
GDK_WINDOW_IMPL_QUARTZ (((GdkWindowObject *) window)->impl)->type_hint = hint;
}
GdkWindowTypeHint
gdk_window_get_type_hint (GdkWindow *window)
{
/* FIXME: Implement */
return GDK_WINDOW_TYPE_HINT_NORMAL;
if (GDK_WINDOW_DESTROYED (window))
return GDK_WINDOW_TYPE_HINT_NORMAL;
return GDK_WINDOW_IMPL_QUARTZ (((GdkWindowObject *) window)->impl)->type_hint;
}
void
......
......@@ -52,6 +52,8 @@ struct _GdkWindowImplQuartz
NSTrackingRectTag tracking_rect;
GdkQuartzView *view;
GdkWindowTypeHint type_hint;
/* This is the autorelease pool which is retained
* while the context is being held
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment