summaryrefslogtreecommitdiff
path: root/gdk
Commit message (Collapse)AuthorAgeFilesLines
* x11: Trap possible X errorMatthias Clasen2016-05-191-3/+7
| | | | | | | XIGetClientPointer can generate X errors (e.g. when the X server does not support XI2. Trap them and carry on. https://bugzilla.gnome.org/show_bug.cgi?id=766233
* x11/dnd: Ignore grab broken events from other devices than our DnD device.Carlos Garnacho2016-05-181-0/+4
| | | | | | | | | The GdkDragContext should only listen to GDK_GRAB_BROKEN events sent to its own pointer device. It turns out that the passive key grabs mistake GDK into sending a GdkEventGrabBroken on the master keyboard, which the DnD machinery mistakes as a signal to cancel the operation. https://bugzilla.gnome.org/show_bug.cgi?id=766442
* x11: Rely on passive keyboard grabs with XI2 for DnDCarlos Garnacho2016-05-051-1/+9
| | | | | | The active keyboard grab can be spared then. This way the passive key grabs allow other key combinations (eg. alt-tab) that are not mandatory to grab here.
* gdkevents: Free motion events discarded by motion compressionCarlos Garnacho2016-05-051-0/+1
| | | | Those should be freed together with their list link.
* Drop unused macrosMatthias Clasen2016-05-051-6/+0
| | | | These have been sitting here forever, unused. Time to drop them
* x11: drop a useless listMatthias Clasen2016-05-051-6/+0
| | | | | We were keeping all the event sources in a list, only to remove them at the end of their life. Not useful.
* wayland: drop a useless listMatthias Clasen2016-05-051-6/+2
| | | | | We were keeping all the event sources in a list, only to remove them at the end of their life. Not useful.
* wayland: Tag the event source with the acutal display nameMatthias Clasen2016-05-051-1/+2
|
* wayland: Make gdk_display_get_name workMatthias Clasen2016-05-052-8/+8
| | | | It should just return the same as gdk_screen_make_display_name.
* wayland: Ignore NoSymbol keysDaniel Stone2016-05-051-0/+2
| | | | | | | | | | | | | | NoSymbol is not a valid GDK symbol (it only has the concept of VoidSymbol, for some reason, which is neither the same thing nor produced by any sane keymap). Passing NoSymbol events through to GTK+ apps is unlikely to produce anything useful. In particular, this meant VTE would scroll to the end of the buffer when pressing Fn (required for Page Up/Down on Macs), as it was receiving a keypress that wasn't a modifeir. This does not happen on X11, as the KEY_FN keycode is above 255, so does not get sent to clients. https://bugzilla.gnome.org/show_bug.cgi?id=764825
* gdk/dnd: Don't use default display when getting cursorJonas Ådahl2016-05-0510-8/+24
| | | | | | | | | | 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
* frametimings: reuse previous frame timing in common caseChristian Hergert2016-05-053-4/+29
| | | | | | | | Typically, there won't be any references on old frame timings except for the most recent timing. So instead of discarding these and re-entering gslice twice, just steal the old frame timing and reuse it. https://bugzilla.gnome.org/show_bug.cgi?id=765592
* wayland: Track orphaned dialogs per displayJonas Ådahl2016-05-052-9/+25
| | | | | | | | Don't track all orphaned dialogs globally, as mixing them up with each other would in most cases trigger errors when we try to pass bogus values to Wayland requests. https://bugzilla.gnome.org/show_bug.cgi?id=765474
* wayland: avoid jitter in keyboard repeatChristian Hergert2016-05-051-2/+16
| | | | | | | | | | | When synthesizing keyboard repeat, we can potentially drift further from the mark depending on the timing of the frame callback and how long it took to deliver the event. This patch attempts to reduce this by tracking from a stable epoch the time of our next keyboard repeat. https://bugzilla.gnome.org/show_bug.cgi?id=765567
* wayland: fix up/down mix up in discrete eventsOlivier Fourdan2016-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | | The wayland specification for discrete step information for scroll and other axes reads: | The discrete value carries the directional information. e.g. a | value of -2 is two steps towards the negative direction of this axis. mutter sets a value of 1 for SCROLL_DOWN events and -1 for SCROLL_UP events. gdkdevice Wayland backend does the opposite, it translates a positive discrete value as SCROLL_UP and a negative value as SCROLL_DOWN, which ends up inverting the scrolling direction. Fix the logic in gdkdevice Wayland to use a positive value as SCROLL_DOWN and a negative value as SCROLL_UP so that it matches mutter and weston logic. https://bugzilla.gnome.org/show_bug.cgi?id=765907
* wayland: Ignore NoSymbol keysDaniel Stone2016-04-272-1/+4
| | | | | | | | | | | | | | NoSymbol is not a valid GDK symbol (it only has the concept of VoidSymbol, for some reason, which is neither the same thing nor produced by any sane keymap). Passing NoSymbol events through to GTK+ apps is unlikely to produce anything useful. In particular, this meant VTE would scroll to the end of the buffer when pressing Fn (required for Page Up/Down on Macs), as it was receiving a keypress that wasn't a modifeir. This does not happen on X11, as the KEY_FN keycode is above 255, so does not get sent to clients. https://bugzilla.gnome.org/show_bug.cgi?id=764825
* wayland: Perform seat grab focus checks on native windowsCarlos Garnacho2016-04-271-7/+7
| | | | | | | | We don't care about the specific (possibly client-side) window that requested the focus here, only the toplevel. Fixes mistakenly sent focus events when the grab happens inside the current focus window. https://bugzilla.gnome.org/show_bug.cgi?id=762756
* wayland: Leave existing mods on map_virtual_modifiersRui Matos2016-04-191-1/+1
| | | | | | | map_virtual_modifiers() is supposed to add the necessary virtual mods but otherwise leave the mods that are passed in. https://bugzilla.gnome.org/show_bug.cgi?id=765270
* frame-clock: avoid g_signal_emit_by_name()Christian Hergert2016-04-193-7/+57
| | | | | | | | These were showing up higher in Sysprof profiles. The simple fix is to avoid the emit_by_name() and let the interface emit the signals directly. No function preconditions are provided since these are internal API.
* wayland: Improve checks when flushing scroll eventsCarlos Garnacho2016-04-191-18/+23
| | | | | | | | | | If we get gdk_wayland_seat_flush_frame_event() with no previous event to be flushed, we fallback into the scroll event checks. However, there's no check performed there as to whether it really scrolled, so it'd always send a smooth scroll event with 0/0 deltas in this case. This should be mostly harmless, but still, we should only end up emitting scroll events if those really happened.
* wayland: Do not check the pointer focus when receiving wl_pointer.frameCarlos Garnacho2016-04-191-3/+0
| | | | | | | | The frame event is also meant to compress wl_pointer.leave events, at this point the focus surface will be definitely NULL. In the end, wl_pointer.frame should flush the last composed event despite the pointer focus. https://bugzilla.gnome.org/show_bug.cgi?id=765065
* gdk: Make GDK_TOUCH_CANCEL be dealt with similarly to GDK_TOUCH_ENDCarlos Garnacho2016-04-191-1/+3
| | | | | | | | | We must emit the cancel event with the same semantics, and towards the GdkWindow that is currently under the touchpoint, so make proxy_button_event() deal with GDK_TOUCH_CANCEL. Fixes the GDK_TOUCH_CANCEL event being emitted only on the toplevel, which is usually non-sufficient.
* wayland: Make virtual modifier mapping more similar to XMatthias Clasen2016-04-191-1/+1
| | | | | | Ignore virtual modifiers that are mapped to Mod1 (as Meta often is), to avoid interfering with our fix interpretation of Mod1 as Alt.
* wayland: Fix the map_virtual_modifiers implementationMatthias Clasen2016-04-191-1/+1
| | | | | | We were not stripping real modifiers out, and thus always thought there's a conflict when the passed in modifiers included any real modifiers.
* wayland: Implement virtual modifiersMatthias Clasen2016-04-191-2/+50
| | | | | | | | | | | Since Wayland is using libxkbcommon, it inherits X unfortunate real/virtual modifier distinction, so we have to do the same gymnastics we do for X to map between the two. This should fix matching of accelerators using virtual modifiers (modulo gnome-shell bugs regarding the handling of Super). https://bugzilla.gnome.org/show_bug.cgi?id=764424
* Clarify docs a bitMatthias Clasen2016-04-191-1/+1
| | | | | The wording here was just awkward: TRUE is returned if... Note that FALSE is also returned if...
* win32: rollback change and use _gdk_displayIgnacio Casal Quinteiro2016-04-111-1/+1
| | | | | | | | | | | This makes usage of _gdk_display again when creating a window. This is needed because there is a window created when the display is being initialized, so it becomes a chicken and egg problem. For now we roll back this to fix the wintab crash but we might want to fix this again in the future by improving the wintab initialization. https://bugzilla.gnome.org/show_bug.cgi?id=764664
* 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
* GDK W32: Don't move windows into top-left corner on style changeРуслан Ижбулатов2016-04-061-1/+1
| | | | | | | This fixes a bug that was introduced by db1b24233e758200ab9bc23fdb9b64dba4876a00. The reason why 0:0 coordinates were passed was that SWP_NOREPOSITION was misinterpreted as SWP_NOMOVE. That is not the case - SWP_NOREPOSITION prevents owner Z-order change, not the window position change.
* wayland: Do not resize with the same sizeOlivier Fourdan2016-04-051-7/+23
| | | | | | | | | | gnome-control-center is calling gtk_window_resize() on configure-event signals which leads to a busy loop. Avoids such a busy loop by not re-configuring a window with the same size, unless this is coming from and xdg-shell configure. bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=764374
* wayland: Avoid NULL slave devices in GdkSeat::get_slavesCarlos Garnacho2016-04-011-3/+3
| | | | | Just because we're asked for a capability, it doesn't mean we have it.
* GDK W32: Implement show_window_menu()Руслан Ижбулатов2016-03-294-0/+147
| | | | | | | | | | | | | | | | | | This is achieved by sending undocumented message WM_SYSMENU to the window. Before doing that, the window is given WS_SYSMENU style (to enable window menu) and some combination of WS_MAXIMIZEBOX (for "Mazimize" item) WS_MINIMIZEBOX (for "Minimize" item) WS_SIZEBOX (for "Size" item) depending on which operations are currently permissible. WM_SYSMENU is processed by DefWindowProc(), which results in showing the window menu. We remove extra styles at the first opportunity (WM_INITMENU message), as they alter the way our window is rendered. https://bugzilla.gnome.org/show_bug.cgi?id=763851
* GDK W32: Erase hidden layered windows before showing themРуслан Ижбулатов2016-03-293-19/+97
| | | | | | | | If a layered window was hidden and is made visible, erase its contents before showing it. GDK will schedule a redraw, but until then we generally don't want to show old contents. https://bugzilla.gnome.org/show_bug.cgi?id=763783
* wayland: Fully initialize the visualMatthias Clasen2016-03-261-0/+5
| | | | | The pixel details (mask, shift and precision) are supposed to be filled in for TrueColor visuals.
* Make gdk_visual_get_*_pixel_details work againMatthias Clasen2016-03-261-1/+0
| | | | | | | | | | | These functions are supposed to return the numbers of consecutive 1 bits in each components mask as precision. However, due to a copy-paste mistake when this code was moved around in commit 70d689cddda0dc616af97e8ed047d0c0acf7c7a6, the precision was always reported as zero. This affects only a few applications that directly set window background on X11 windows, such as emacs. https://bugzilla.gnome.org/show_bug.cgi?id=764210
* 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
* wayland: avoid dropping surfaces when possibleChristian Hergert2016-03-211-0/+5
| | | | | | | | | If the configure-event gives us the same size as we had before, which is common for animation resizes, then try to keep the existing buffer around. This saves us a memfd_create() syscall on every frame. https://bugzilla.gnome.org/show_bug.cgi?id=763350
* wayland: Rename internal functions with misleading namingCarlos Garnacho2016-03-211-31/+31
| | | | | | | | | Now that GdkWaylandDeviceData is gone, the functions prefixed "gdk_wayland_device_" and taking a GdkWaylandSeat as first parameter feel out of place. Renaming those makes it more obvious that it's seat functions. https://bugzilla.gnome.org/show_bug.cgi?id=763859
* wayland: Remove GdkWaylandDataDevice typedefCarlos Garnacho2016-03-211-1/+0
| | | | | | It's no longer used. https://bugzilla.gnome.org/show_bug.cgi?id=763859
* wayland: Replace all remaining uses of GdkWaylandDeviceDataCarlos Garnacho2016-03-211-347/+348
| | | | | | | And use GdkWaylandSeat in all of those. The variable names have also been updated. https://bugzilla.gnome.org/show_bug.cgi?id=763859
* wayland: Remove GdkWaylandDeviceData pointer in GdkWaylandDeviceCarlos Garnacho2016-03-211-220/+227
| | | | | | | | It's the same than gdk_device_get_seat() nowadays. Also, rename the usages of GdkWaylandDeviceData to GdkWaylandSeat in the functions affected by the removal. https://bugzilla.gnome.org/show_bug.cgi?id=763859
* dnd: Hide the drag window when we're doneMatthias Clasen2016-03-212-1/+18
| | | | | | | | | We were just relying on the drag context finalize() to destroy the window. But with garbage-collected bindings, that might not happen as soon as we like, so explicitly hide the window when the drag ends successfully. https://bugzilla.gnome.org/show_bug.cgi?id=763659
* Document gdk_wayland_seat_get_wl_seatMatthias Clasen2016-03-201-0/+10
|
* gdk: Add a missing Since tagMatthias Clasen2016-03-201-2/+3
| | | | gdk_drag_context_manage_dnd was introduced this cycle.
* gdk: Reword some docsMatthias Clasen2016-03-201-13/+12
|
* broadway: Use explicit sizes for payload lengthBenjamin Otte2016-03-201-2/+2
| | | | | | The previous greater than comparisons would never trigger the 2nd case. http://www.viva64.com/en/b/0383/
* x11: Use g_error_matches()Benjamin Otte2016-03-201-2/+1
| | | | | | Fixes accidentally assigning values. http://www.viva64.com/en/b/0383/
* broadway: Remove duplicate initializationBenjamin Otte2016-03-201-1/+0
| | | | http://www.viva64.com/en/b/0383/
* x11: Remove duplicate variable settingBenjamin Otte2016-03-201-2/+1
| | | | http://www.viva64.com/en/b/0383/
* GDK W32: Don't move iconic windowsРуслан Ижбулатов2016-03-181-8/+24
| | | | | | | | | | | Using UpdateLayeredWindow() on iconic windows brings them *back* from their iconic (minimized) state. That is bad. As a precaution, also don't use SetWindowPos() on iconic windows. This means that iconic windows can't be moved. That is fixable by using SetWindowPlacement(), but there is no pressing need to do so, as there are very few cases when windows need to be moved while minimized. https://bugzilla.gnome.org/show_bug.cgi?id=763835