summaryrefslogtreecommitdiff
path: root/gdk/quartz
Commit message (Collapse)AuthorAgeFilesLines
* Make gdk_event_get_pointer_emulated publicMatthias Clasen2016-05-101-2/+2
| | | | | | There is not strong reason to keep the getter private. At the same time, strip _-prefixes from a few other GdkEvent APIs. Update all callers.
* gdk/dnd: Don't use default display when getting cursorJonas Ådahl2016-04-262-0/+3
| | | | | | | | | | Always associate a drag context with a GdkDisplay and use that when getting a cursor for a given action. If we don't do this, dragging on a window that doesn't use the default display will make us use cursors from the wrong display. https://bugzilla.gnome.org/show_bug.cgi?id=765565
* Save scancode inside GdkEventPrivateFrediano Ziglio2016-04-211-0/+1
| | | | | | | | | | | | Windows save in hardware_keycode an information which is not so low level and some application require the hardware scancode. As Windows provides this information save it in GdkEventPrivate and provide a function to get this information. For no Windows system the function return the hardware_keycode instead. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=765259
* quartz: zoom/rotate change compile/runtime check from 10.7 to 10.8Friedrich Beckmann2016-04-091-4/+5
| | | | | | | | | | | The zoom/rotate change for quartz does not build on 10.7. This change adds zoom/rotate support in quartz only for 10.8 and following. The problems is described here: https://bugzilla.gnome.org/show_bug.cgi?id=760276 and here https://trac.macports.org/ticket/51052 NSEventPhaseMayBegin was only introduced in 10.8 although documentation says it is introduced in 10.7. Tests on 10.7 indicate that the phase property for the Magnify event is not supported at all on 10.7
* quartz: fix pixelated image surfaces in retina/hidpi modeChristoph Reiter2016-03-231-2/+13
| | | | | | | | | | | | | | | | | | | | gtk+ currently depends on the scaling factor and the cairo device scale of both the backend surfaces and image surfaces to be equal. Until now we didn't apply a cairo device scale at all and depended on the automatic scaling of CGContexts. This works when drawing with cairo but fails in case of image surfaces, which get requested at a too small size. To make the quartz backend behave more like the X11 one, set the cairo device scale on the surface in gdk_quartz_ref_cairo_surface(). As this conflicts with the default scaling done by CGContext (we would get double scaling) undo the CGContext scaling using CGContextScaleCTM(). This patch is based on the following patches by Brion Vibber: https://bugzilla.gnome.org/show_bug.cgi?id=740199#c4 https://bugs.freedesktop.org/show_bug.cgi?id=69796#c4 https://bugzilla.gnome.org/show_bug.cgi?id=763779
* quartz: fix quartz buildChristian Hergert2016-03-171-1/+4
| | | | | | More fallout from recent refactoring. See also b3860e407d3edb6f94d53269960c052756516aa2.
* added NSEventTypeMagnify and NSEventTypeRotate for ZOOM and ROTATE gesturesFriedrich Beckmann2016-03-111-1/+123
| | | | | | | | | | MacOS provides the NSEventTypeMagnify which is very similar to the Gtk ZOOM gesture and NSEventTypeRotate which is very similar to the Gtk Rotate gesture. Those two event sequences are translated to a sequence of GDK_TOUCHPAD_PINCH events. This sequence is then detected in the upper gtk layers as Gtk Zoom/Rotate Gestures. https://bugzilla.gnome.org/show_bug.cgi?id=760276
* quartz: Get core pointer from device managerPhilip Chimento2016-03-091-13/+25
| | | | | | | Some spots missed in the earlier refactor removing core_pointer from the GdkDisplay struct. https://bugzilla.gnome.org/show_bug.cgi?id=762820
* gdk: remove the display->list_devices vfuncPaolo Borelli2016-02-291-51/+0
| | | | | | | | | | | | gdk_display_list_devices is deprecated and all the backends implement the same fallback by delegating to the device manager and caching the list (caching it is needed since the method does not transfer ownership of the container). The compat code can be shared among all backends and we can initialize the list lazily only in the case someone calls the deprecated method. https://bugzilla.gnome.org/show_bug.cgi?id=762891
* gdk: remove the core_pointer field from GdkDisplayPaolo Borelli2016-02-291-2/+1
| | | | | | It is not used anymore, so no need to set it https://bugzilla.gnome.org/show_bug.cgi?id=762820
* quartz: get the core pointer from the device managerPaolo Borelli2016-02-291-17/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=762820
* quartz: Don't use g_print for debug outputMatthias Clasen2016-02-282-81/+85
| | | | | | The g_print documentation explicitly says not to do this, since g_print is meant to be redirected by applications. Instead use g_message for logging that can be triggered via GTK_DEBUG.
* quartz: Strip newlines from g_warning and g_errorMatthias Clasen2016-02-281-1/+1
| | | | g_logv adds one for us already.
* gdk: calculate pixel color shift and precision lazilyPaolo Borelli2016-02-271-10/+0
| | | | | This gets rid of the decompose_mask utility entirely and simplifies backend code.
* gdk: factor out utility shared among backendsPaolo Borelli2016-02-271-21/+0
| | | | | Removes duplicated code and makes sure we use the version which is safe against infinite loops
* Fix Quartz Full Screen Crash.Allin Cottrell2016-02-212-1/+9
|
* quartz: Use GdkSeatDefault to implement GdkSeatCarlos Garnacho2015-12-153-2/+24
|
* gdk: Allow passing the start coordinates in drag_beginMatthias Clasen2015-12-132-2/+6
| | | | | | | | Add a variant of gdk_drag_begin that takes the start position in addition to the device. All backend implementation have been updated to accept (and ignore) the new arguments. Subsequent commits will make use of the data in some backends.
* quartz: Don't use the instancetype keywordMatthias Clasen2015-10-251-1/+1
| | | | | | | | | gdkcursor-quartz.c uses the instancetype keyword, which doesn't seem to be supported in the version of Objective C that Snow Leopard uses. Replacing that keyword with the thing it represents makes it build. Patch by Ryan Hendrickson, http://bugzilla.gnome.org/show_bug.cgi?id=756770
* Bug 736125 - The default gtk accelerator mod mask does not include all ↵John Ralls2015-08-251-0/+5
| | | | default backend modifiers
* quartz: Implement CSD drag resize for all edges/cornersChristoph Reiter2015-08-083-33/+67
| | | | | | | Manual resizing for CSD windows only worked with the bottom right corner. This extends it to work for all corners and edges. https://bugzilla.gnome.org/show_bug.cgi?id=753329
* quartz: disable system shadows if a GdkWindow shadow is set.Christoph Reiter2015-07-272-2/+20
| | | | | | | | The shadow will be drawn in the wrong place in those cases so all we can do is disable it. This fixes double shadows drawn around menus, popups and tooltips. https://bugzilla.gnome.org/show_bug.cgi?id=734984
* quartz: Fix buildingPatrick Griffis2015-07-271-3/+3
| | | | Broken by 6d04183c5d6 and 6ac07a2e85ea
* quartz: Check if a drag ends inside a known windowMatthias Clasen2015-07-261-0/+28
| | | | | | | | If a drag ends inside a known window, set the dest_window field in the drag context. This information is needed to implemented notebook tab dragging. https://bugzilla.gnome.org/show_bug.cgi?id=752638
* quartz: remove maximized state when the window position/size is changedChristoph Reiter2015-07-232-0/+30
| | | | | | So a window can be maximized/zoomed again after being moved away from its maximized position. This makes the zoom button on non-CSD windows work as before.
* quartz: implement maximized/unmaximizedChristoph Reiter2015-07-233-16/+49
| | | | | | | | | | | | Instead of using the default zoom behaviour use the internal maximized state for selecting our own zoom target. This makes zooming work for CSD windows where for some reason the given default zoom target is the current window frame itself resulting in a shadowless window of the same size. While this makes the zoom button behave a bit different as expected it makes things more consistent with other platforms and fixes CSD zooming.
* quartz: make moving CSD windows right up to the screen's menu bar work.Christoph Reiter2015-07-231-0/+16
| | | | | The default implementation prevents the window + shadow to move above the menu bar. Change it so only the window is considered.
* gdkwindow-quartz: partial aspect ratio supportTom Schoonjans2015-07-071-1/+11
| | | | | | | | Support was added for GDK_HINT_ASPECT in gdk_quartz_window_set_geometry_hints though with one restriction: min_aspect and max_aspect have to be equal, which I believe corresponds to the most common usage. A warning will be printed if this condition is not met but min_aspect will be used anyway.
* Implemented most of the GDK named cursors on Mac OS X.Pietro Gagliardi2015-05-161-39/+118
| | | | | | | | Only "wait" and "all-scroll" are not implemented properly. OS X does not seem to have a proper interface to either cursor. Approximations are used instead; see the code. See bug 749178.
* quartz: Support css cursor namesMatthias Clasen2015-05-111-2/+46
| | | | | | | | We want these to work across platforms, so do a best-effort approximation. We could do much better here by copying what webkit does. https://bugzilla.gnome.org/show_bug.cgi?id=749178
* quartz: Non-implementation of GdkGLContextPhilip Chimento2015-05-094-0/+84
| | | | | | | This makes sure the Quartz backend returns an error when asked to create a GL context, rather than crashing because of a NULL vfunc. https://bugzilla.gnome.org/show_bug.cgi?id=740199
* gdkkeys: Add support to _get_scroll_lock_state()Fabiano Fidêncio2015-04-271-0/+8
| | | | | | | GdkKeymap already has support for _get_num_lock_state() and _get_caps_lock_state(). Adding _get_scroll_lock_state() would be good for completness and some backends (Windows?) could take advantage of this.
* gdk/quartz: Fix mixup in attributes usage creating window implementationThibault Saunier2015-02-221-3/+4
| | | | | | | | | | First, attributes can be NULL (which is always the case when calling gdk_window_ensure_native) so do not unconditionally dereference it. Then the window_type should be taken directly from the GdkWindow as in other backends (such as the X11 one for example). https://bugzilla.gnome.org/show_bug.cgi?id=744942
* quartz: NSWindow NULL check in get_scale_factorPhilip Chimento2014-12-241-1/+1
| | | | | | | | | | | Sending backingScaleFactor to a NULL NSWindow will silently give the value 0 for the scale factor, causing insidious divide-by-zero bugs down the line. This checks if the NSWindow is NULL first, as seems to happen throughout the rest of the file. Note that I don't have a hi-DPI OS X machine to test this on, though. https://bugzilla.gnome.org/show_bug.cgi?id=738338
* gdkwindow: Don't pass the region to the impl when beginning a paintJasper St. Pierre2014-11-221-3/+2
| | | | | | It's unused. At the same time, rename "begin_paint_region" to "begin_paint". This will help us clean up how GDK painting works in the future to allow more creative use of double-buffering.
* quartz: Don't bother storing the paint_clip_regionJasper St. Pierre2014-11-222-56/+0
| | | | It's unused.
* quartz: Move the FullscreenSavedGeometry definition earlierMatthias Clasen2014-10-271-6/+6
| | | | | | | Move the FullscreenSavedGeometry before the first (conditional) use, to fix the build on OS X 10.6. https://bugzilla.gnome.org/show_bug.cgi?id=737561
* quartz: fix build on 10.6 and belowMarcus Karlsson2014-10-272-0/+7
| | | | | | | | | It is not possible to successfully build GTK+ on OS X 10.6 and below since NSFullScreenWindowMask is only available starting with 10.7. Add ifdef guards around setStyleMask: in order to allow it to build on earlier OS X releases. https://bugzilla.gnome.org/show_bug.cgi?id=737561
* gdk: Deprecate static gravitiesBenjamin Otte2014-10-061-13/+0
| | | | | ... and remove all implementations. The API allows to not work "if the server doesn't support it. So from now on, no server does!
* Remove redundant checks for NULLMarek Kasik2014-10-023-20/+5
| | | | | | | | Remove checks for NULL before g_free() and g_clear_object(). Merge check for NULL, freeing of pointer and its setting to NULL by g_clear_pointer(). https://bugzilla.gnome.org/show_bug.cgi?id=733157
* quartz: Get default font size from user fontJesse van den Kieboom2014-08-281-1/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=735321
* quartz-dnd: make sure to set source windowJesse van den Kieboom2014-08-271-0/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=658722
* gdkwindow-quartz: Support native fullscreen modeJesse van den Kieboom2014-08-254-3/+86
| | | | | | This implements native fullscreen mode on OS X >= 10.7. This patch adds tracking of the fullscreen mode if externally modified, as well as toggling the native fullscreen mode of the window as needed.
* Handle resolution changes in the GDK backend codeOwen W. Taylor2014-07-131-2/+2
| | | | | | | | | | | | | | | gdk_x11_display_set_window_scale() affects the interpretation of the Xft/DPI XSETTING - it is substituted inside GDK with the value of Gdk/UnscaledDPI xsetting. However, this change is not propagated to GTK+ and from GTK+ back to gdk_screen_set_resolution() until the main loop is run. Fix this by handling the screen resolution directly in gdk/x11. This requires duplication of code between GDK and GTK+ since we still have to handle DPI in GTK+ in the case that GdkSettings:gtk-xft-dpi is set by the application. https://bugzilla.gnome.org/show_bug.cgi?id=733076
* gdkwidow: Make queue_antiexpose optionalJasper St. Pierre2014-06-211-7/+0
|
* gdkwindow: Don't bother with a return parameter for queue_antiexposeJasper St. Pierre2014-06-211-2/+1
| | | | | Standard refcounting works perfectly well. Don't give us the opportunity for more memory leaks.
* gdkwindow: Remove the ability to call begin_paint_region more than onceJasper St. Pierre2014-06-202-45/+3
| | | | | | | | | | | | | | | Previously, each begin_paint_region added to a stack of current paints, and when end_paint was called, the paint was popped off of the stack and the surface was composited into the parent paint surface. However, the code was broken in the case of a backend like Wayland which didn't keep track of nested calls and simply wiped and returned the native impl backing surface every time. Since this feature is flat out unused by GTK+ and we don't want to really support tricksy things like these for other clients, just remove the feature. If somebody does call begin_paint_region more than once, warn and return without doing anything.
* gdkwindow: Remove the internal cairo_surface used for out-of-band paintingJasper St. Pierre2014-06-201-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, the way painting was done in GTK+ was with the "expose-event" handler, where you'd use GDK methods to do drawing on your surface. In GTK+ 2.24, we added cairo support with gdk_cairo_create, so you could paint your graphics with cairo. Since then, we've added client-side windows, double buffering, the paint clock, and various other enhancements, and the modern way to do drawing is to connect to the "draw" signal on GtkWidget, which hands you a cairo_t. To do double-buffering, the cairo_t we hand you is actually on a secret surface, not the actual backing store of the window, and when the draw handler completes we blit it into the main backing store atomically. The code to do this is with the APIs gdk_window_begin_paint_region, which creates the temporary surface, and gdk_window_end_paint which blits it back into the backing store. GTK+'s implementation of the "draw" signal uses these APIs. We've always sort-of supported people calling gdk_cairo_create "outside" of a begin_paint / end_paint like old times, but then you're not getting the benefit of double-buffering, and it's harder for GDK to optimize. Additionally, newer backends like Mir and Wayland can't actually support this model, since they're based on double-buffering and swapping buffers at various points in time. If we hand you a random cairo_t, we have no idea when is a good time to swap. Remove support for this. This is technically a GDK API break: a warning is added in cases where gdk_cairo_create is called outside of a paint cycle, and the returned surface is a dummy that won't ever be composited back onto the main surface. Testing with complex applications like Ardour didn't produce any warnings.
* all: Name more idles and timeoutsBastien Nocera2014-03-261-2/+5
| | | | | | | | | | Following up from 438cd857c49242244dda2923ac447f36464b9e72, name more timeouts and idles. The original grep was missing checking for gdk_threads_add_*() functions (at least for some of the files). https://bugzilla.gnome.org/show_bug.cgi?id=726870
* Implement get_root_origin generically for all backendsJasper St. Pierre2014-03-171-20/+0
| | | | | | | It seems that some backends implemented get_root_origin wrong and returned the client window coordinates, not the frame window coordinates. Since it's possible to implement generically for all windows, let's do that instead of having a separate impl vfunc.