* gdk/quartz/gdkwindow-quartz.c: Implement simple versions of
2007-06-04 Richard Hult <richard@imendio.com> * gdk/quartz/GdkQuartzWindow.c: * gdk/quartz/gdkwindow-quartz.c: Implement simple versions of gdk_window_set_accept_focus and gdk_window_set_focus_on_map. svn path=/trunk/; revision=18038
This commit is contained in:
committed by
Richard Hult
parent
60be3caaaa
commit
72469142a0
@ -1,3 +1,9 @@
|
|||||||
|
2007-06-04 Richard Hult <richard@imendio.com>
|
||||||
|
|
||||||
|
* gdk/quartz/GdkQuartzWindow.c: * gdk/quartz/gdkwindow-quartz.c:
|
||||||
|
Implement simple versions of gdk_window_set_accept_focus and
|
||||||
|
gdk_window_set_focus_on_map.
|
||||||
|
|
||||||
2007-06-04 Richard Hult <richard@imendio.com>
|
2007-06-04 Richard Hult <richard@imendio.com>
|
||||||
|
|
||||||
* gdk/quartz/gdkwindow-quartz.c: (gdk_window_raise),
|
* gdk/quartz/gdkwindow-quartz.c: (gdk_window_raise),
|
||||||
|
|||||||
@ -176,6 +176,9 @@
|
|||||||
GdkWindowObject *private = (GdkWindowObject *)window;
|
GdkWindowObject *private = (GdkWindowObject *)window;
|
||||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||||
|
|
||||||
|
if (!private->accept_focus)
|
||||||
|
return NO;
|
||||||
|
|
||||||
/* FIXME: Is this right? If so, the switch shouldn't be needed. Need
|
/* FIXME: Is this right? If so, the switch shouldn't be needed. Need
|
||||||
* this + some tweaking to the event/grab code to get menus
|
* this + some tweaking to the event/grab code to get menus
|
||||||
* working...
|
* working...
|
||||||
|
|||||||
@ -526,6 +526,9 @@ gdk_window_new (GdkWindow *parent,
|
|||||||
|
|
||||||
private->parent = (GdkWindowObject *)parent;
|
private->parent = (GdkWindowObject *)parent;
|
||||||
|
|
||||||
|
private->accept_focus = TRUE;
|
||||||
|
private->focus_on_map = TRUE;
|
||||||
|
|
||||||
if (attributes_mask & GDK_WA_X)
|
if (attributes_mask & GDK_WA_X)
|
||||||
private->x = attributes->x;
|
private->x = attributes->x;
|
||||||
else
|
else
|
||||||
@ -781,12 +784,16 @@ all_parents_shown (GdkWindowObject *private)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Note: the raise argument is not really used, it doesn't seem
|
||||||
|
* possible to show a window without raising it?
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
show_window_internal (GdkWindow *window,
|
show_window_internal (GdkWindow *window,
|
||||||
gboolean raise)
|
gboolean raise)
|
||||||
{
|
{
|
||||||
GdkWindowObject *private;
|
GdkWindowObject *private;
|
||||||
GdkWindowImplQuartz *impl;
|
GdkWindowImplQuartz *impl;
|
||||||
|
gboolean focus_on_map;
|
||||||
|
|
||||||
if (GDK_WINDOW_DESTROYED (window))
|
if (GDK_WINDOW_DESTROYED (window))
|
||||||
return;
|
return;
|
||||||
@ -796,9 +803,21 @@ show_window_internal (GdkWindow *window,
|
|||||||
private = (GdkWindowObject *)window;
|
private = (GdkWindowObject *)window;
|
||||||
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
|
||||||
|
|
||||||
|
if (!GDK_WINDOW_IS_MAPPED (window))
|
||||||
|
focus_on_map = private->focus_on_map;
|
||||||
|
else
|
||||||
|
focus_on_map = TRUE;
|
||||||
|
|
||||||
if (impl->toplevel)
|
if (impl->toplevel)
|
||||||
{
|
{
|
||||||
[impl->toplevel orderFront:nil];
|
/* We should make the window not raise for !raise, but at least
|
||||||
|
* this will keep it from getting focused in that case.
|
||||||
|
*/
|
||||||
|
if (private->accept_focus && focus_on_map && raise)
|
||||||
|
[impl->toplevel makeKeyAndOrderFront:nil];
|
||||||
|
else
|
||||||
|
[impl->toplevel orderFront:nil];
|
||||||
|
|
||||||
[impl->view setNeedsDisplay:YES];
|
[impl->view setNeedsDisplay:YES];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1617,7 +1636,13 @@ void
|
|||||||
gdk_window_set_accept_focus (GdkWindow *window,
|
gdk_window_set_accept_focus (GdkWindow *window,
|
||||||
gboolean accept_focus)
|
gboolean accept_focus)
|
||||||
{
|
{
|
||||||
/* FIXME: Implement */
|
GdkWindowObject *private;
|
||||||
|
|
||||||
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||||
|
|
||||||
|
private = (GdkWindowObject *)window;
|
||||||
|
|
||||||
|
private->accept_focus = accept_focus != FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1654,7 +1679,13 @@ void
|
|||||||
gdk_window_set_focus_on_map (GdkWindow *window,
|
gdk_window_set_focus_on_map (GdkWindow *window,
|
||||||
gboolean focus_on_map)
|
gboolean focus_on_map)
|
||||||
{
|
{
|
||||||
/* FIXME: Implement */
|
GdkWindowObject *private;
|
||||||
|
|
||||||
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||||
|
|
||||||
|
private = (GdkWindowObject *)window;
|
||||||
|
|
||||||
|
private->focus_on_map = focus_on_map != FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user