Commit Graph

136 Commits

Author SHA1 Message Date
Kristian Rietveld
deffbd9885 quartz: reorder gdkprivate-quartz.h and related clean up 2010-12-23 14:17:42 +01:00
Kristian Rietveld
fb8717f722 quartz: move utils to gdkutils-quartz.c 2010-12-23 14:17:41 +01:00
Kristian Rietveld
caa9794af8 quartz: Clean up header files, use same arrangement as X11 backend 2010-12-23 14:17:41 +01:00
Kristian Rietveld
197590258f quartz: Make keyboard input work again 2010-12-22 22:33:05 +01:00
Kristian Rietveld
083c556e00 quartz: rename GdkDeviceManagerCore -> GdkQuartzDeviceManagerCore 2010-12-22 17:47:05 +01:00
Kristian Rietveld
3bc60a8149 quartz: rename GdkQuartzWindow to GdkQuartzNSWindow 2010-12-22 17:47:04 +01:00
Kristian Rietveld
6b96c56976 quartz: remove duplicate definition of gdk_flush 2010-12-22 17:47:03 +01:00
Kristian Rietveld
d0976d9f53 quartz: Fix gdkevents-quartz.c 2010-12-22 17:47:02 +01:00
Matthias Clasen
b2ff02332f Implement event_data_{copy,free} for quartz 2010-12-22 17:47:00 +01:00
Matthias Clasen
3232be603a Implement has_pending and queue_events vfuncs for quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen
733c8fc8e7 Derive GdkDisplayManager for quartz 2010-12-22 17:46:59 +01:00
Matthias Clasen
8a9c604b8a Adapt quartz device code to new ways
We will need to rename the Core implementations in X11/Quartz
to not clash, later.
2010-12-22 17:46:59 +01:00
Matthias Clasen
41352f24d6 Convert all GdkScreen methods to vtable calls, quartz backend 2010-12-22 17:46:59 +01:00
Matthias Clasen
acd99409b8 Make display method vtable calls, quartz backend 2010-12-22 17:46:59 +01:00
Matthias Clasen
31cd046cd0 Move gdk_add_client_message_filter to common code 2010-12-21 12:06:55 -05:00
Kristian Rietveld
fd6e57687d Port Quartz backend to latest rendering-cleanup changes 2010-12-06 14:15:47 +01:00
John Ralls
c0aae6644a Replace references to sealed GdkDevice private variables with accessor calls in quartz. 2010-11-23 16:53:45 -08:00
William Jon McCann
323df2b280 Make gdk_event_apply_filters safe against changes in filter list
An event filter may add or remove filters itself.  This patch does
two things to address this case.  The first is to take a temporary
reference to the filter while it is being used.  The second is
to wait until after the filter function is run before determining
the next node in the list to process.  This guards against
changes to the next node.  It also does not run functions
that have been marked as removed.  Though I'm not sure if this
case can arise.

https://bugzilla.gnome.org/show_bug.cgi?id=635380
2010-11-22 13:16:24 -05:00
Benjamin Otte
b5097de481 gdk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Kristian Rietveld
234d750bb3 Update Quartz backend for GDK key name changes 2010-09-13 16:26:02 +02:00
Kristian Rietveld
bde0f9a8f6 quartz: Misc. fixes for getting offscreen windows to work
Mainly fixes to properly differentiate between toplevel and offscreen
windows, since these sometimes need different treatment.  Furthermore,
usage of gdk_window_get_effective_foo() instead of gdk_window_get_foo()
where applicable.
2010-08-10 21:02:31 +02:00
Kristian Rietveld
be27fba3f3 Remove dummy for gdk_event_get_graphics_expose()
This was a deprecated function that has been removed.
2010-06-30 21:43:25 +02:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Javier Jardón
7894951cee Remove deprecated code from GdkEvent 2010-05-03 01:48:45 +02:00
Kristian Rietveld
66207cf13e Improve enter/motion notify semantics
On X11 we receive enter notify and motion notify events for a window
regardless of its focus state.  On Mac OS X this is not the case.  This
commit improves the semantics to overcome this difference.  It improves
on my earlier patch that sent a motion notify event when a window became
main.

Instead of sending a motion notify when a window becomes main, we now
send one when a window becomes key, which comes closest to a window
getting focus in X11.  This motion notify is needed because Mac OS X does
not send motion events when an application is inactive (none of its
windows have focus), these events are sent in X11.  This dummy motion
notify event (with current coordinates of the mouse cursor) allows an
application to get its prelight and other state right when it gets focus
and thus user attention.

Another change is to send an enter notify event when updating the
tracking rectangle of a GdkQuartView and the mouse cursor is currently in
this rectangle.  This rectangle is at least updated on window creation.
This enter notify event is important for the case where a new window
appears right below the mouse cursor.  The window has to receive an enter
notify event for the subsequent events to be processed correctly.  Mac
OS X does not send one in this case, so we generate it ourselves.

Both of these synthesized events have to go through
_gdk_windowing_got_event() for updating statekeeping, etc.
append_event() has a boolean flag now to make this convenient.
2010-01-30 20:36:28 +01:00
Kristian Rietveld
b2b70e5a8d Start using NSInteger and NSUInteger
These have been introduced in Leopard and default to int and unsigned int.
In 64-bit Snow Leopard they are long and unsigned long.  This caused issues
with the getRectsBeingDrawn message which needs a pointer to a NSInteger
(long on 64-bit!) but we passed in an integer.  Surprisingly this problem
was visible when compiling with -O0 (segfault), but *not* when compiling
with -O1.  Other messages were NSInteger is now needed have also been
adapted.

Since NSInteger and NSUInteger are not available on Tiger, a define
has been added to add typedefs for these when they have not been defined
by the system headers.
2009-12-27 19:28:56 +01:00
Kristian Rietveld
8846012c6d Rework coordinate transformation to be based on root window
The root window contains all the monitors attached to a Mac.  The
coordinate transformation now both translates the x and y coordinate,
translating it from the Cocoa monitor coordinate space to the GDK
coordinate space.  How monitors are laid out in the root window differs
between Cocoa and GDK, which is why it is important to translate based
on the root window to get multi monitor setups to work properly.

We have replaced the old y coordinate transformation function with
new functions that translate both the x and y coordinate.

When creating new toplevels, we have to determine the Cocoa screen on
which the toplevel should appear and translate the coordinates according
to that screen.

This change also fixes event handling in case there is a monitor left
of the screen containing the menu bar.  In such a case all coordinates
on the left monitor are negative.  Event handling broke, because of
_gdk_quartz_window_find_child() checking bounds.  Now that coordinates
are always properly translated to GDK coordinate space, in which negative
coordinates do never occur, the checks here will work properly.
2009-10-26 09:52:54 +01:00
Christian Hergert
17130a8ec9 Bug 517394 - Native resize grip steals button release ...
Explicitly handle resizing by leaving all events in the lower right 15x15
corner to Cocoa, if the window shows a resizing indicator.  Some
applications may have widgets allocated in this area.  Generally, these
widgets are likely larger than 15x15 so they can still be hit.  Often
scroll bars are found in this area and these can also be manipulated by
other means.  Since this is the only way of resizing windows on Mac OS X,
it is too important to keep it broken.
2009-09-25 21:52:13 +02:00
Kristian Rietveld
cf80feb3dd Do not test the event mask of implicit grabs
The quartz backend simulates the semantics of XGrabPointer, as a part of
this it checks the event mask of the grab.  However, implicit grabs on X
do not go through XGrabPointer and thus the quartz backend should not check
the event mask for these.  This fixes various "the UI got stuck" cases.
2009-09-16 08:48:49 +02:00
Richard Hult
52ca2f29cc Update _gdk_windowing_pointer_grab 2009-06-20 11:50:10 +02:00
Richard Hult
730a44a516 Tweak the click-through handling so active apps get it (but not inactive ones) 2009-04-02 10:16:30 +02:00
Richard Hult
53b3343d1b Get the right event window for non-grabbed windows too 2009-04-02 10:16:29 +02:00
Richard Hult
f51a3f5e33 Make owner_events grabs work again, use the pointer window, not the event window 2009-04-02 10:15:32 +02:00
Richard Hult
6d1a8853c4 Don't ignore all events when inactive, only clicks 2009-04-02 10:15:32 +02:00
Richard Hult
41d40786b1 Relax the check for ignoring events above the content view 2009-04-02 10:15:32 +02:00
Richard Hult
651335bc7e Remove workaround for missing enter events on newly popped up windows
The reason for the issue was that we got entered/exited events for the
title bar buttons. Now we properly ignore those instead.
2009-04-02 10:15:32 +02:00
Richard Hult
aeeb54ddf0 Remove re-declared variable 2009-04-02 10:15:32 +02:00
Richard Hult
64195589dc Remove unused code and fix some indentation 2009-04-02 10:15:32 +02:00
Richard Hult
6d01d16d48 Button press and release can share the same fill_button_event call 2009-04-02 10:15:32 +02:00
Richard Hult
77ee2feda2 Remove tracking of "current mouse window", this is handled in the common code now 2009-04-02 10:15:32 +02:00
Richard Hult
3c7a37d10d Remove old cursor setting and make it work with client-side windows 2009-04-02 10:15:32 +02:00
Richard Hult
e6f2a809b2 Update for latest changes in the common code for grab tracking 2009-04-02 10:15:32 +02:00
Richard Hult
f455b478e7 Ignore all events if the app is not active 2009-04-02 10:15:31 +02:00
Richard Hult
2c043566fc When breaking grabs on deactivation, the unset should be implicit 2009-04-02 10:15:31 +02:00
Richard Hult
30f83d8398 Use _gdk_display_unset_has_*_grab in break_all_grabs() 2009-04-02 10:15:31 +02:00
Richard Hult
65aef2099a Use cooca to convert coordinats from event window to grab window instead of homegrown code 2009-04-02 10:15:31 +02:00
Richard Hult
a180f7588f Replace quartz specific keyboard grab code with common code 2009-04-02 10:15:31 +02:00
Richard Hult
152614966f Use the common pointer grab code instead of tracking it ourselves 2009-04-02 10:15:31 +02:00
Richard Hult
55c71f18a4 Use isKeyWindow instead of isMainWindow for the non-click-through check 2009-04-02 10:15:31 +02:00
Richard Hult
e8d6ac71b7 Apply non-click-through policy on unfocused windows even if the app is active 2009-04-02 10:15:31 +02:00