forked from AuroraMiddleware/gtk
Have these return TRUE
2006-01-02 Anders Carlsson <andersca@imendio.com> * gdk/quartz/GdkQuartzWindow.c: (-[GdkQuartzWindow canBecomeMainWindow]): (-[GdkQuartzWindow canBecomeKeyWindow]): Have these return TRUE * gdk/quartz/gdkevents-quartz.c: (pointer_grab_internal): Remove FIXME (find_child_window_by_point_helper): Fix bug in offset calculation (find_window_for_event): Use grab window toplevel when a grab is in effect (gdk_event_translate): Don't call _gdk_event_button_generate on mouse up * gdk/quartz/gdkgc-quartz.c: (_gdk_quartz_gc_new): Fix indentation * gdk/quartz/gdkwindow-quartz.c: (gdk_window_new): Make TEMP windows borderless (gdk_window_hide): Hide window (gdk_window_get_origin): Implement
This commit is contained in:
parent
348ffaea19
commit
6130996a77
34
ChangeLog
34
ChangeLog
@ -1,3 +1,37 @@
|
||||
2006-01-02 Anders Carlsson <andersca@imendio.com>
|
||||
|
||||
* gdk/quartz/GdkQuartzWindow.c:
|
||||
(-[GdkQuartzWindow canBecomeMainWindow]):
|
||||
(-[GdkQuartzWindow canBecomeKeyWindow]):
|
||||
Have these return TRUE
|
||||
|
||||
* gdk/quartz/gdkevents-quartz.c:
|
||||
(pointer_grab_internal):
|
||||
Remove FIXME
|
||||
|
||||
(find_child_window_by_point_helper):
|
||||
Fix bug in offset calculation
|
||||
|
||||
(find_window_for_event):
|
||||
Use grab window toplevel when a grab is in effect
|
||||
|
||||
(gdk_event_translate):
|
||||
Don't call _gdk_event_button_generate on mouse up
|
||||
|
||||
* gdk/quartz/gdkgc-quartz.c:
|
||||
(_gdk_quartz_gc_new):
|
||||
Fix indentation
|
||||
|
||||
* gdk/quartz/gdkwindow-quartz.c:
|
||||
(gdk_window_new):
|
||||
Make TEMP windows borderless
|
||||
|
||||
(gdk_window_hide):
|
||||
Hide window
|
||||
|
||||
(gdk_window_get_origin):
|
||||
Implement
|
||||
|
||||
2006-01-02 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c
|
||||
|
@ -1,3 +1,37 @@
|
||||
2006-01-02 Anders Carlsson <andersca@imendio.com>
|
||||
|
||||
* gdk/quartz/GdkQuartzWindow.c:
|
||||
(-[GdkQuartzWindow canBecomeMainWindow]):
|
||||
(-[GdkQuartzWindow canBecomeKeyWindow]):
|
||||
Have these return TRUE
|
||||
|
||||
* gdk/quartz/gdkevents-quartz.c:
|
||||
(pointer_grab_internal):
|
||||
Remove FIXME
|
||||
|
||||
(find_child_window_by_point_helper):
|
||||
Fix bug in offset calculation
|
||||
|
||||
(find_window_for_event):
|
||||
Use grab window toplevel when a grab is in effect
|
||||
|
||||
(gdk_event_translate):
|
||||
Don't call _gdk_event_button_generate on mouse up
|
||||
|
||||
* gdk/quartz/gdkgc-quartz.c:
|
||||
(_gdk_quartz_gc_new):
|
||||
Fix indentation
|
||||
|
||||
* gdk/quartz/gdkwindow-quartz.c:
|
||||
(gdk_window_new):
|
||||
Make TEMP windows borderless
|
||||
|
||||
(gdk_window_hide):
|
||||
Hide window
|
||||
|
||||
(gdk_window_get_origin):
|
||||
Implement
|
||||
|
||||
2006-01-02 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c
|
||||
|
@ -111,4 +111,14 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
-(BOOL)canBecomeMainWindow
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(BOOL)canBecomeKeyWindow
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -252,7 +252,6 @@ pointer_grab_internal (GdkWindow *window,
|
||||
pointer_grab_event_mask = event_mask;
|
||||
pointer_grab_implicit = implicit;
|
||||
|
||||
/* FIXME: Implement */
|
||||
return GDK_GRAB_SUCCESS;
|
||||
}
|
||||
|
||||
@ -366,14 +365,14 @@ find_child_window_by_point_helper (GdkWindow *window, int x, int y, int x_offset
|
||||
if (x >= temp_x && y >= temp_y &&
|
||||
x < temp_x + impl->width && y < temp_y + impl->height)
|
||||
{
|
||||
*x_ret = x - private->x;
|
||||
*y_ret = y - private->y;
|
||||
|
||||
*x_ret = x - x_offset - private->x;
|
||||
*y_ret = y - y_offset - private->y;
|
||||
|
||||
/* Look for child windows */
|
||||
return find_child_window_by_point_helper (GDK_WINDOW (children->data), x, y, temp_x, temp_y, x_ret, y_ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
@ -852,19 +851,19 @@ find_window_for_event (NSEvent *nsevent, gint *x, gint *y)
|
||||
GdkEventMask event_mask;
|
||||
GdkWindow *real_window;
|
||||
|
||||
|
||||
if (pointer_grab_window)
|
||||
{
|
||||
if (pointer_grab_event_mask & get_event_mask_from_ns_event (nsevent))
|
||||
{
|
||||
int tempx, tempy;
|
||||
GdkWindowObject *w = GDK_WINDOW_OBJECT (pointer_grab_window);
|
||||
GdkWindowObject *grab_toplevel = GDK_WINDOW_OBJECT (gdk_window_get_toplevel (pointer_grab_window));
|
||||
|
||||
tempx = point.x;
|
||||
tempy = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (toplevel)->impl)->height -
|
||||
tempy = GDK_WINDOW_IMPL_QUARTZ (grab_toplevel->impl)->height -
|
||||
point.y;
|
||||
|
||||
while (w != GDK_WINDOW_OBJECT (toplevel))
|
||||
while (w != grab_toplevel)
|
||||
{
|
||||
tempx -= w->x;
|
||||
tempy -= w->y;
|
||||
@ -1145,8 +1144,6 @@ gdk_event_translate (NSEvent *nsevent)
|
||||
|
||||
append_event (event);
|
||||
|
||||
_gdk_event_button_generate (_gdk_display, event);
|
||||
|
||||
/* Ungrab implicit grab */
|
||||
if (pointer_grab_window &&
|
||||
pointer_grab_implicit)
|
||||
|
@ -120,8 +120,8 @@ _gdk_gc_quartz_get_type (void)
|
||||
|
||||
GdkGC *
|
||||
_gdk_quartz_gc_new (GdkDrawable *drawable,
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask)
|
||||
GdkGCValues *values,
|
||||
GdkGCValuesMask values_mask)
|
||||
{
|
||||
GdkGC *gc;
|
||||
|
||||
|
@ -296,6 +296,7 @@ gdk_window_new (GdkWindow *parent,
|
||||
private->depth = 0;
|
||||
private->input_only = TRUE;
|
||||
draw_impl->colormap = gdk_screen_get_system_colormap (_gdk_screen);
|
||||
g_object_ref (draw_impl->colormap);
|
||||
}
|
||||
|
||||
if (private->parent)
|
||||
@ -315,19 +316,27 @@ gdk_window_new (GdkWindow *parent,
|
||||
_gdk_quartz_get_inverted_screen_y (private->y) - impl->height,
|
||||
impl->width, impl->height);
|
||||
const char *title;
|
||||
int style_mask = NSTitledWindowMask|
|
||||
NSClosableWindowMask|
|
||||
NSMiniaturizableWindowMask|
|
||||
NSResizableWindowMask;
|
||||
int style_mask;
|
||||
|
||||
switch (attributes->window_type) {
|
||||
case GDK_WINDOW_TEMP:
|
||||
style_mask = NSBorderlessWindowMask;
|
||||
break;
|
||||
default:
|
||||
style_mask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask;
|
||||
}
|
||||
|
||||
impl->toplevel = [[GdkQuartzWindow alloc] initWithContentRect:content_rect
|
||||
styleMask:style_mask
|
||||
backing:NSBackingStoreBuffered defer:NO];
|
||||
styleMask:style_mask
|
||||
backing:NSBackingStoreBuffered defer:NO];
|
||||
if (attributes_mask & GDK_WA_TITLE)
|
||||
title = attributes->title;
|
||||
else
|
||||
title = get_default_title ();
|
||||
|
||||
if (attributes->window_type == GDK_WINDOW_TEMP)
|
||||
[impl->toplevel setLevel:NSPopUpMenuWindowLevel];
|
||||
|
||||
gdk_window_set_title (window, title);
|
||||
|
||||
|
||||
@ -488,12 +497,15 @@ gdk_window_hide (GdkWindow *window)
|
||||
|
||||
if (impl->toplevel)
|
||||
{
|
||||
/* FIXME: Support hiding toplevel windows */
|
||||
[impl->toplevel orderOut:nil];
|
||||
}
|
||||
else if (impl->view)
|
||||
{
|
||||
[impl->view setHidden:YES];
|
||||
}
|
||||
|
||||
gdk_pointer_ungrab (0);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@ -724,10 +736,48 @@ gdk_window_get_origin (GdkWindow *window,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
int tmp_x = 0, tmp_y = 0;
|
||||
GdkWindow *toplevel;
|
||||
NSRect content_rect;
|
||||
GdkWindowImplQuartz *impl;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
|
||||
|
||||
/* FIXME: Implement */
|
||||
return FALSE;
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
{
|
||||
if (x)
|
||||
*x = 0;
|
||||
if (y)
|
||||
*y = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
private = GDK_WINDOW_OBJECT (window);
|
||||
|
||||
toplevel = gdk_window_get_toplevel (window);
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (toplevel)->impl);
|
||||
|
||||
content_rect = [impl->toplevel contentRectForFrameRect:[impl->toplevel frame]];
|
||||
|
||||
tmp_x = content_rect.origin.x;
|
||||
tmp_y = _gdk_quartz_get_inverted_screen_y (content_rect.origin.y + content_rect.size.height);
|
||||
|
||||
while (private != GDK_WINDOW_OBJECT (toplevel))
|
||||
{
|
||||
tmp_x += private->x;
|
||||
tmp_y += private->y;
|
||||
|
||||
private = private->parent;
|
||||
}
|
||||
|
||||
if (x)
|
||||
*x = tmp_x;
|
||||
if (y)
|
||||
*y = tmp_y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user