Commit Graph

6934 Commits

Author SHA1 Message Date
Matthias Clasen
0d18a429aa Update cursor docs
Include new images for context-menu and for no-drop.
2016-05-17 14:16:39 -04:00
Timm Bäder
f0f8d6d6b0 gdkwindow: Use GList less 2016-05-12 20:40:22 +02:00
Matthias Clasen
e463e09577 wayland: Avoid unitialized memory reads
I didn't pay attention when I replaced g_new0 with g_newa. Oops.
2016-05-12 11:38:46 -04:00
Matthias Clasen
7e7d7991cc x11: Trap possible X error
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
2016-05-10 21:29:10 -04:00
Matthias Clasen
49d5c9ed14 Forgotten rename 2016-05-10 15:32:25 -04:00
Matthias Clasen
4add8f3b63 Document new api 2016-05-10 15:22:35 -04:00
Matthias Clasen
0f476590fb Make gdk_event_get_pointer_emulated public
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.
2016-05-10 15:16:45 -04:00
Olivier Fourdan
e405c27eee gdkevent: make _gdk_event_get_pointer_emulated() private
And not just internal to gdk, so we can use it in gtk as well, to
differentiate emulated scroll events from others.

https://bugzilla.gnome.org/show_bug.cgi?id=765939
2016-05-10 15:58:02 +02:00
Chun-wei Fan
ce0a7fa560 gdk/Makefile.am: Dist gdkmonitorprivate.h
This file needs to be distributed with the tarball as well...
2016-05-09 15:42:37 +08:00
Chun-wei Fan
e24530d03b gdk/win32/gdkmonitor-win32.c: Fix build on non-GCC
WINBOOL is MinGW-specific, so change it to BOOL, which is universally
available.

Also, Visua Studio is more picky on where __stdcall (WINAPI) is placed, so
fix that to be in-sync with what is done in the other sources.
2016-05-09 13:14:01 +08:00
Timm Bäder
640c1b5a33 gdk: Fix parameter name mismatch 2016-05-08 15:34:28 +02:00
Christian Hergert
ebb894cd64 wayland: use g_signal_handler_disconnect()
Use of g_signal_handlers_disconnect_by_func() needs to do more work than
necessary to find all the matching handlers. Instead, just hold on to the
signal identifier and remove it directly so we hit the fast path.

Not terribly ground breaking in terms of performance gains, but its done
enough to be worthwhile.

https://bugzilla.gnome.org/show_bug.cgi?id=766049
2016-05-06 11:33:12 +03:00
Carlos Garnacho
c14572fdae x11: Rely on passive keyboard grabs with XI2 for DnD
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.
2016-05-05 19:16:25 +02:00
Matthias Clasen
adc90b9e9d wayland: Small improvements to update_direction
Avoid memory allocation if possible, and use the proper
min/max keycodes.
2016-05-03 23:14:05 -04:00
Matthias Clasen
09aa48b748 wayland: Don't emit direction-changed unless it did
We can easily check this, so lets do it.
2016-05-03 22:52:38 -04:00
Matthias Clasen
3b75cadc41 trivial formatting fixes 2016-05-03 22:36:20 -04:00
Olivier Fourdan
e74ecfe22e wayland: fix up/down mix up in discrete events
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
2016-05-03 11:38:06 +02:00
Matthias Clasen
8dd8c4a9de GdkMonitor: Fix refresh-rate property
We were using g_value_set_boolean for an integer property.
2016-05-02 12:42:13 -04:00
Carlos Garnacho
cb6b5e4017 gdkevents: Free motion events discarded by motion compression
Those should be freed together with their list link.
2016-05-01 20:05:56 +02:00
Matthias Clasen
a047269428 Avoid copying an event
Not a big deal, but we can be a bit more efficient when generating
grab-broken events.
2016-05-01 13:26:35 -04:00
Matthias Clasen
a7ee3a6d80 Small docs improvement
Cross reference from gdk_event_get_keycode to
gdk_event_get_scancode.
2016-05-01 13:26:35 -04:00
Matthias Clasen
8041c012fe Drop unused macros
These have been sitting here forever, unused. Time to drop them
2016-05-01 13:26:35 -04:00
Matthias Clasen
6baac526b9 x11: drop a useless list
We were keeping all the event sources in a list, only to remove
them at the end of their life. Not useful.
2016-05-01 13:26:35 -04:00
Matthias Clasen
75e44c50ed wayland: drop a useless list
We were keeping all the event sources in a list, only to remove
them at the end of their life. Not useful.
2016-05-01 13:26:35 -04:00
Matthias Clasen
a829b26de1 wayland: Tag the event source with the acutal display name 2016-05-01 10:52:31 -04:00
Matthias Clasen
55ea6e4dcc wayland: Make gdk_display_get_name work
It should just return the same as gdk_screen_make_display_name.
2016-05-01 10:51:41 -04:00
Matthias Clasen
e502702dd4 Use a variable consistently 2016-04-30 23:15:20 -04:00
Matthias Clasen
4151b6715c Trivial whitespace fix 2016-04-30 21:06:38 -04:00
Matthias Clasen
98f16fdf7a Use the new getter
This avoids the use of generic api in the per-event code path.
2016-04-30 20:59:16 -04:00
Matthias Clasen
7f4b575fc3 gdk: Add a private getter for GdkDevice::input-mode 2016-04-30 20:52:23 -04:00
Matthias Clasen
172093db8c Add a forgotten deprecation
gdk_display_get_screen is marked as deprecated in the docs.
2016-04-30 16:46:11 -04:00
Rico Tzschichholz
0f1e42cd80 broadway: Fix include rules in gdkbroadwaymonitor.h
Fixes 044109c8c7
2016-04-28 10:20:15 +02:00
Руслан Ижбулатов
026cb53875 win32: Port to new monitor api 2016-04-27 23:18:16 -04:00
Matthias Clasen
5c1d0915af x11: Bring back fullscreen-on-all-monitors support
It is unfortunate the EWMH requires Xinerama here - lets do this
without the caching that was previously there, I don't think it is
needed.
2016-04-27 23:18:16 -04:00
Matthias Clasen
d92fda2103 x11: Port to new monitor api 2016-04-27 23:18:16 -04:00
Matthias Clasen
79a0286ab1 x11: Drop Xinerama
It may come back after the monitor conversion.
2016-04-27 23:18:16 -04:00
Matthias Clasen
044109c8c7 broadway: Port to new monitor api 2016-04-27 23:18:16 -04:00
Matthias Clasen
9026289381 wayland: Port to new monitor api 2016-04-27 23:18:16 -04:00
Matthias Clasen
0611cb4823 screen: Implement old monitor apis generically
Implement all the monitor-related GdkScreen apis based on GdkMonitor.
2016-04-27 23:18:16 -04:00
Matthias Clasen
b6c4ba0e2a Add a fallback for unconverted backends
If the monitor vfuncs are not implemented in a display class,
fall back to providing a single monitor object representing
the entire screen. This is not meant to be 'good enough', it
is just to provide some implementation until all backends
implement the monitor vfuncs. When that is the case, the
fallback should be removed.
2016-04-27 23:18:16 -04:00
Matthias Clasen
9d719b9989 display: Add new monitor apis
This follows our general direction of moving functionality
from GdkScreen to GdkDisplay.
2016-04-27 23:18:16 -04:00
Matthias Clasen
837244809e Add GdkMonitor
Add a simple object representing a monitor.
2016-04-27 23:18:16 -04:00
Daniel Stone
210a747ff0 wayland: Ignore NoSymbol keys
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
2016-04-27 14:00:30 +01:00
Carlos Garnacho
14967d8d7d wayland: Perform seat grab focus checks on native windows
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
2016-04-27 13:29:19 +02:00
Jonas Ådahl
1a4f000f3b gdk/dnd: Don't use default display when getting cursor
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
2016-04-26 23:03:24 +08:00
Christian Hergert
f27dd21426 frametimings: reuse previous frame timing in common case
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
2016-04-26 09:06:07 -04:00
Jonas Ådahl
8f64e4a8e3 gdk/dnd: Add missing signal parameter documentation
The cancel reason parameter was missing.

https://bugzilla.gnome.org/show_bug.cgi?id=765577
2016-04-26 20:40:47 +08:00
Jonas Ådahl
145b626c2f wayland: Track orphaned dialogs per display
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
2016-04-26 08:38:18 -04:00
Jonas Ådahl
cb73becfb4 wayland: Clean up naming of GdkWaylandDisplay pointers
The naming of pointers to GdkWaylandDisplay's were inconsistent.
Running the following commands in gtk+/gdk/wayland illustrate the
inconsistency:

$ grep -r '\<display_wayland\>' *.[ch] | wc -l
195
$ grep -r '\<wayland_display\>' *.[ch] | wc -l
81

This patch renames all occurrences of "wayland_display" to
"display_wayland". This is also consistent with naming in the X11
backend. A couple of whitespace changes were done as well in places
where the rename was already done, that added line breaks to long lines
that stood out.

https://bugzilla.gnome.org/show_bug.cgi?id=765474
2016-04-26 08:38:18 -04:00
Chun-wei Fan
7700243bd4 gdk/gdkglcontext.c: Avoid a GCCism
Pointer arithmetic on GLvoid* (a void*) is a GCCism, so cast it to an
unsigned char*, which is the type cairo_image_surface_get_data() returns.
2016-04-26 20:29:23 +08:00