Commit Graph

421 Commits

Author SHA1 Message Date
Kristian Rietveld
d0e5025694 quartz: Factor out toplevel from NSEvent code into function 2011-11-05 22:53:22 +01:00
Kristian Rietveld
cca1621e71 quartz: Separate out screen_point conversion in function
Reduces code duplication and confusion.
2011-11-05 22:45:05 +01:00
Kristian Rietveld
0f7c96b619 quartz: remove unused variable 2011-11-05 22:39:57 +01:00
Alex Corrado
fff25d3a3a Quartz, Bug 655057: Eliminate Compiler Warning
When compiled with older SDKs, the original change for this bug caused a
compiler warning about NSWindow not being able to handle a setStyleMask
message. This tricks the compiler into thinking that it can.
2011-10-09 09:52:14 -07:00
Kristian Rietveld
b3314acd97 quartz: also update window position on windowDidResize
When a window goes fullscreen, the resize also changes its size.
2011-10-08 11:28:44 +02:00
Michael Natterer
5a5d6d28c2 quartz: my last commit had merge junk in it, sorry 2011-09-28 19:01:01 +02:00
Michael Natterer
931a228ce0 quartz: don't filter away directly encoded 24-bit UCS characters
gdk_unicode_to_keyval(uc) returning (uc | 0x01000000) is not an
error return value but simply the way to encode 24-bit unicode
characters directly as keyvals.
2011-09-28 13:56:36 +02:00
John Ralls
81c2166eb9 Quartz: Fix a typo and a compilation warning 2011-09-25 14:44:54 -07:00
John Ralls
94fc15ad95 Bug 653450 - gtkfilechooser crashes when added favorite
Ensure that display is set during drag-and-drop, and that string lists'
memory is zeroed after allocation to prevent g_strfreev() from
over-running.
2011-09-24 10:56:05 -07:00
John Ralls
10352d63af Fix typo in 24a7e798 2011-09-23 15:00:03 -07:00
John Ralls
224a7e798a (Backport acf1345) Fix refresh of static autorelease_pool so that it doesn't happen in gtk-nested loops. 2011-09-23 14:03:59 -07:00
Steffen Gutmann
33154e1c7d Bug 659907 - gdk_quartz_draw_opaque_stippled_pattern crashes 2011-09-23 09:03:36 +02:00
Michael Natterer
5e602ab0f2 quartz: resolve the modifier confusion on the Mac
- map Alt/Option to MOD1
- map Command to MOD2
- map MOD2 to the virtual Meta
- improve/fix (?) group handling in gdkkeys-quartz.c
2011-09-16 15:54:03 +02:00
John Ralls
45d61a5fd6 Bug 617583 - Dead accents keys don't work in GTK+ applications on OSX
Handle dead keys in special_ucs_table and have them converted by
UCKeyTranslate(), so all dead key combinations can be entered.
Later, this should be handled in the input method, just as it's
done for X11/Win32.
2011-09-09 10:12:40 +02:00
John Ralls
a2a85a194c Bug 655122: Lion crashes during resize.
Move resizing detection to a separate function and detect resizes so that they don't result in grabs (which was causing the crash).
2011-08-13 14:11:29 -07:00
John Ralls
9edc6ca045 Bug 655122: Detect OSX version for handling version-dependent special cases (the one in question is resizing, which OSX 10.7 allows on all edges instead of the lower-right corner as on previous versions) 2011-08-13 13:55:08 -07:00
John Ralls
a90d9da9e9 Bug 655087: Prevent drqwing when there are no rectangles in which to draw. 2011-08-13 13:20:22 -07:00
Kristian Rietveld
468deb67d5 quartz: Remove MAC_OS_X_VERSION_MIN_ALLOWED ifdef
I tried to suppress compiler warnings on pre-10.6 machines this way,
but it defeats its purpose when you compile for pre-10.6 machines on
a 10.6 machine.  For now, we have to live with the warnings when
compiling on/for pre-10.6 machines, there does not seem an easy and proper
way to suppress the warnings.
2011-08-12 23:22:03 -07:00
Michael Hutchinson
5c73ebf54c Bug 655074 - Fix crash with undecorated windows on MacOS Lion 2011-07-25 09:21:09 -04:00
Javier Jardón
8d5d9e68ed gdk: Use 'const' instead deprecated G_CONST_RETURN 2011-06-15 14:47:19 +01:00
Michael Natterer
d0f2b13309 gdk: add gdk_device_get_n_keys() to access the sealed num_keys member 2010-11-24 20:15:29 +01:00
Kristian Rietveld
15eecb1645 quartz: release pattern in GC finalize 2010-10-24 14:39:52 +02:00
Kristian Rietveld
dfd7e05123 quartz: Reset drawable on pattern callback info when gc is updated 2010-10-24 14:39:52 +02:00
Kristian Rietveld
b0a17e5a37 Pass pixmap to _gdk_pixmap_get_cgimage() and not the impl 2010-10-24 14:39:52 +02:00
Kristian Rietveld
f62b56194b quartz: Always use generic color space
Switch all usage of device color spaces to generic color spaces.  Since
the former color spaces are no longer device-dependent as of Mac OS X
10.4, these yielded a very costly color space conversion when drawing
pixmaps to the screen.  We now avoid this by using the generic color
space.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624025
2010-10-19 10:41:01 +02:00
Kristian Rietveld
e6e9eef855 Rework GdkPixmapImplQuartz to create CGImage on-demand
If the data that backs a bitmap context changes, then the CGImage that
is backed by this data might not always update due to caching effects.
By creating the CGImage on-demand, we ascertain ourselves that the
CGImage is up to date.
2010-10-19 10:40:48 +02:00
Kristian Rietveld
77b703c2fc quartz: stop offscreen windows code from crashing.
This is an adapted version of commit
bde0f9a8f6 on master.

Mainly fixes to properly differentiate bewteen 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.

There is an drawing issue left when scrolling e.g. tree views in
offscreen windows.  I think this is likely an issue with
gdk_quartz_draw_drawable() which is used for the copy area code in
offscreen windows.  It works fine in master, since this was converted
to Cairo.
2010-08-15 17:34:33 +02:00
John Stowers
dc2fea413b Add gdk_device_get_n_axes
https://bugzilla.gnome.org/show_bug.cgi?id=624221
2010-07-25 12:32:43 +12:00
Kristian Rietveld
e634f3fbe0 Move Leopard-specific type definitions to gdkquartz.h
Update includes subsequently where it matters.  Fixes build on Mac OS
X 10.4.
2010-06-27 10:41:15 +02:00
Kristian Rietveld
3770d914ec Refactor to use API that's available in OS X 10.4 as well 2010-06-27 10:41:15 +02:00
John Ralls
093a867e51 Bug 622333 - Crash in gdk_window_impl_quartz_begin_paint_region 2010-06-27 10:41:15 +02:00
Kristian Rietveld
9f5f47f8be Flip clip mask image when setting clip mask on GC 2010-06-27 10:41:15 +02:00
Kristian Rietveld
49f72c1fb4 Rework color translation to support gray scale and bitmaps 2010-06-27 10:41:15 +02:00
Kristian Rietveld
42d07ad6ce Add gray visual, implement "get_best" functions 2010-06-27 10:41:15 +02:00
Colin Walters
c8262d39fa Use g_source_set_name for all custom GSources in GTK+
Naming the sources allows easier debugging with e.g. SystemTap
probes.

https://bugzilla.gnome.org/show_bug.cgi?id=620511
2010-06-03 21:32:06 -04:00
Javier Jardón
cfb988ab38 Seal gdk
Add G_SEAL annotation for struct members, and add accessors for
the (useful) fields. Patch based on work by Garrett Regier,
see bug #592580.
2010-05-27 16:25:54 +02:00
Benjamin Otte
fd20ac0751 Revert "Deprecate the GdkRegion API"
This reverts commit 821dd33918.
2010-05-26 09:25:35 +02:00
Benjamin Otte
821dd33918 Deprecate the GdkRegion API
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.

https://bugzilla.gnome.org/show_bug.cgi?id=613284
2010-05-23 23:27:15 +02:00
Paul Davis
7d61c9fff5 Remove arbitrary limit on number of redraw rectangles
The aim of this limit was to not degrade performance too much, however,
it actually did degrade performance to a large extent.
2010-05-12 12:20:16 +02:00
Matthias Clasen
13d69e552d Fix a compatibility problem
It turns out that my attempt at handling Super, Hyper and Meta better
is causing problems, mostly because Alt and Meta are commonly colocated
in the modmap, and apps do a check for the Alt modifier regularly.

See e.g bug 607697.
2010-02-12 18:55:42 -05: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
0912a113dd Release view after setting it as contentView
Fixes GdkQuartzView being leaked.
2009-12-30 14:14:21 +01:00
Kristian Rietveld
255c2739e2 Fix memleak in get_nsscreen_for_point()
One codepath did not go through GDK_QUARTZ_RELEASE_POOL, refactored
the code to fix this.
2009-12-30 14:12:42 +01:00
Kristian Rietveld
3887838244 Fix memory leak in GdkQuartzView
Should remove the tracking rect in dealloc.
2009-12-30 14:11:14 +01:00
Kristian Rietveld
ee62948b83 Use CGFLOAT_DEFINED, don't rely on NSINTEGER_DEFINED for this 2009-12-28 23:01:42 +01:00
Kristian Rietveld
e22de4a88e Add gdk_keymap_map_virtual_modifiers() to Quartz backend 2009-12-28 21:18:57 +01:00
Kristian Rietveld
c8fef502e2 Start using CGFloat
Fixes a bunch of compiler warnings.  Since CGFloat does not exist on
Tiger and earlier, we have added a typedef likewise as was done for
NSInteger.
2009-12-28 21:18:57 +01:00
Kristian Rietveld
f3a5bf48d4 Fix compile warning in gdk_cursor_new_from_pixmap 2009-12-28 21:18:57 +01:00
Kristian Rietveld
dd415881be initWithContentRect: has a NSUInteger parameter now
The typedef in place for Tiger and earlier systems should change this
to unsigned int without problems.
2009-12-28 21:18:56 +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