Commit Graph

7110 Commits

Author SHA1 Message Date
Jeremy Tan
a5c8fedf47 GDK W32: Always process all available messages
The GLib main loop blocks on MsgWaitForMultipleObjectsEx to
determine if there are any incoming messages while also allowing
for background tasks to run. If all available messages are not
processed after MsgWaitForMultipleObjectsEx has signaled that
there are available, CPU usage will skyrocket.

From my limited understanding (by inspection of profiling
under Visual Studio):
Key is pressed - MsgWaitForMultipleObjectsEx unblocks, and
sends message to GDK's event handler. Some event is now queued.

g_poll unblocks, calls the g_event_dispatch which finally
resolves to gdk_event_dispatch. This then calls
_gdk_win32_display_queue_events, but since a message is already
queued, it fails to call PeekMessage and returns immediately.

At the next iteration, g_poll again calls MsgWaitForMultipleObjectsEx
which queues yet another event and returns almost immediately, since
there are events available which haven't been processed by PeekMessage.

The dispatch function is then called and the process repeats.

https://bugzilla.gnome.org/show_bug.cgi?id=771568
2016-09-19 12:36:51 +00:00
Руслан Ижбулатов
0274b2c94e GDK W32: Set is_modifier field in GdkKeyEvent
This hardcodes Control, Alt and Shift as modifier keys.

https://bugzilla.gnome.org/show_bug.cgi?id=602773
2016-09-17 20:24:18 +00:00
Matthias Clasen
21bdf617ce Implement gdk_screen_get_monitor_scale_factor generically
This was forgotten when the other screen monitor apis were
ported to GdkMonitor.

https://bugzilla.gnome.org/show_bug.cgi?id=771349
2016-09-14 06:45:21 -04:00
Jonas Ådahl
c529d0a96e wayland: Move and resize popup after it was configured
A popup may have moved and resized when configured. Make sure every
layer knows about this and call gdk_window_move_resize() with the
configured dimension and position. This won't actually move the
window, but might resize it.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
d792400d7c wayland: Transform moved_to_rect result properly
The result of move_to_rect, received from the xdg_popup.configure
event, needs to be translated to the correct coordinate space; that is
from real parent window geometry to coordinates relative to the gdk
window set as transient-for.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
74d237df41 wayland: Use helper to translate to real parent window geometry
Use a helper to translate a coordinate from non-real GdkWindow parent
to window geometry coordinate space of the real GdkWindow parent,
meaning the coordinate space of the GdkWindow of the parent used as a
xdg_popup parent where (0, 0) is inside of the shadow margin.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
bc6630bb7d wayland: Don't pass parent when creating dynamic positioner
When using the dynamic positioner (i.e. positioning from move_to_rect)
we can always rely on having a proper transient-for to position
relative to, so lets drop the ignored parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
9a2ce3a485 wayland: Don't pass transient-for when getting real parent
It's always derived from transient-for so no need to pass it.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
50e33308db wayland: Fix south-west anchor rect calculation
https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
4d2c0a843a wayland: Don't pass non-changing state when calculating popup rects
https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
e656a14764 wayland: Move move_to_rect related code closer together
Move the code used for calculating the result of move_to_rect
(final_rect, flipped_rect etc) closer to the other move_to_rect
functions (i.e. next to create_dynamic_positioner), and let the
xdg_popup configure handler just call the calculation function.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Olivier Fourdan
eb17ee1c26 wayland: unmap popup along with its toplevel
If an application umaps the toplevel from its popup callback, this can
lead to a protocol error.

Make sure we mark popup parent and use that to check if their parent is
the toplevel being unmapped in which case we shall unmap the popup first
to avoid the protocol error.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=770906
2016-09-12 10:03:58 +02:00
Takao Fujiwara
f2ba6ca473 gdkscreen-x11: Enable RandR on VirtualBox
RandR 1.5 is enabled on VirtualBox guest of Fedora 25 but
XRROutputInfo->name is "default". If init_randr15() does not
return TRUE, the monitor size sets 0 because gdk_screen_get_width()
returns 0.

This problem causes GtkStatusIcon not to show the activate menu.

https://bugzilla.gnome.org/show_bug.cgi?id=771033
2016-09-09 16:41:23 -04:00
Timm Bäder
fbca09ecb4 gdkdisplay: Unref seats in finalize 2016-09-08 11:34:13 +02:00
Timm Bäder
476c1c44a5 gdkdisplay-wayland: Fix some memory leaks 2016-09-08 11:34:13 +02:00
Jonas Ådahl
98b0f78200 wayland: Warn when an application tries to map popup incorrectly
When a popup is mapped but will not be the top most popup (for example
the parent is not the current top most popup, or if there already is a
popup mapped but the parent is a toplevel), warn and ignore it instead
of continuing, as continuing would be a protocol violation.

https://bugzilla.gnome.org/show_bug.cgi?id=770745
2016-09-02 18:56:03 +08:00
Matthias Clasen
c9749ad7dc x11: Fix a trap mixup
There was a return between a push/pop of an error trap, and
this managed to trigger the 'unpopped trap' warning in the
displayclose test now. Fix this.
2016-08-29 15:51:05 -04:00
Matthias Clasen
bdbe2de57d Document handle-related Wayland api
In particular, note that this API depends on an unstable
Wayland protocol and thus may have to change.
2016-08-29 13:20:44 -04:00
Jonas Ådahl
340b5964dd wayland: Add API for setting an exported as a parent
Add an API that enables an application to, given an exported window
handle, set its own window as a transient of the window associated with
the exported window handle.

https://bugzilla.gnome.org/show_bug.cgi?id=769788
2016-08-29 13:20:44 -04:00
Jonas Ådahl
127d2ac956 wayland: Add API for creating exported window handles
Using the xdg_foreign protocol, expose a way to get handles to windows
that may be shared between processes.

https://bugzilla.gnome.org/show_bug.cgi?id=769788
2016-08-29 13:20:44 -04:00
Руслан Ижбулатов
b05ed13710 GDK W32: Remove obsolete assertions 2016-08-26 20:46:27 +00:00
Olivier Fourdan
9f57fe9960 wayland: add min/max size from xdg-shell v6
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=764413
2016-08-25 11:04:16 +02:00
Jonas Ådahl
b7964cf5a7 wayland: Implement move_to_rect
Translate move_to_rect parameter into xdg_positioner requests, and use
the generated xdg_positioner to create the popup.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
ceada4adc2 wayland: Port to xdg_shell unstable v6
https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
643f033923 wayland: Move window geometry calculation to helper
We'll use it from more places later.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
d2a80cd235 wayland: Only update the window title if it actually updated
This makes the protocol log less spammy.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
8270699119 wayland: Only sync surface regions once per commit
Only set input, opaque and window geometry regions once per commit.
They are double buffered anyway, so the last one would only take effect
either way; this way reading protocol logs are much more pleasent.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
d2385bec09 wayland: Remove gdk_wayland_display_get_xdg_shell()
Don't expose the xdg_shell struct as it is not yet a stable type that
will stay the same.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
e53d381430 wayland: Get tiled state from gtk_shell instead of xdg_shell
Use our the 'tiled' entry from our new 'state' enum sent via
xdg_surface.configure.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
80dd7566d5 wayland: Fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Matthias Clasen
b8f464e102 wayland: Add some more debug spew 2016-08-25 00:13:13 -04:00
Matthias Clasen
ae720784d9 wayland: Replace g_debug by GDK_NOTE
We have this framework, lets use it.
2016-08-25 00:05:49 -04:00
Matthias Clasen
f66a76d998 Document window-icon related api as 'may not work'
Some platforms simply don't have window icons (such as Wayland).
2016-08-24 14:43:58 -04:00
Carlos Garnacho
87af999b5d wayland: Offer wayland-specific method to set pad actions feedback
The wayland tablet protocol allows notifying the compositor with
descriptions of the actions performed by each tablet element. This
API call allows to hook up in to this wayland-specific feature.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
27f879b835 wayland: Support pad devices in gdk_wayland_device_get_node_path()
We can return the node path on those too, so do that.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
7e961b8bcc wayland: Implement pad event emission
We now send all the set of button/ring/strip/group_mode events.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
cca51b71cb wayland: Create/expose pad devices
These devices are kind of an strange case. Their "master" device is
the keyboard, because they share toplevel focus with it, regardless
of stylus focus. Nonetheless, they are only expected to send the
GdkEventPad* set of events.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
82a46faf41 wayland: Add GdkWaylandDevicePad
This is a subclass of GdkWaylandDevice that implements GdkDevicePad,
all pad features are looked up from the info obtained through the
tablet v2 interface.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
feb09e384c wayland: Implement backbone of pad support
All pad interfaces and features are poked, we just now need
exposing those.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
b8a77d4da3 gdk: Add GdkDevicePad
This is an interface meant to be implemented by the "pad" devices.
This device-specific interface exposes the mapping of all pad features,
it allows retrieving:
- The number of buttons/rings/strips
- The number of groups
- The number of modes a group has
- Whether a given button/ring/strip belongs to a given group

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
f1a9cd466e gdk: Address pad events similarly to keyboard events
We want the same treatment for those, the event will be emitted on the
toplevel, which will then decide what to do with the event.

It just doesn't make much sense to propagate those up/down the hierarchy,
when we want specifically one action being triggered from those.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
0dcb9b316e gdk: Add pad event structs, enum values, and event mask bit
GDK_PAD_BUTTON*,RING and STRIP will be emitted respectively when
pad buttons, rings or strips are interacted with. Each of those
pad components belong to a group (a pad can contain several of
those), which may be in a given mode. All this information is
contained in the event.

GDK_PAD_GROUP_MODE is emitted when a group in the pad switches
mode, which will generally result in a different set of actions
being triggered from the same buttons/rings/strips in the group.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
3f56af3738 gdkdevice: Add GDK_SOURCE_TABLET_PAD input source type for GdkDevices
This will represent a tablet pad.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
3ac56e60c7 wayland: Add wayland-specific method to retrieve a device node path
This will be useful at least for g-c-c, in order to match libwacom
data with GdkDevices.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
942d144d3b gdk: Pass hardware ID on gdk_device_tool_new()
And implement this on wayland, where this information is already obtained.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
40f75e74be gdk: Add a getter for the hardware id of a GdkDeviceTool
Although scarcely used, this information may be useful to retrieve
from the windowing systems that offer this information.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Emmanuele Bassi
74bd3f3810 quartz: Fix typo that broke debug builds 2016-08-22 09:23:02 +01:00
Carlos Garnacho
e3bbeb48bd gdk: Fix gdk_device_tool_get_serial() return value
This is a guint64, not just a guint.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-19 23:56:58 -04:00
Carlos Garnacho
7e11fcaa18 gdk: Fix GdkDevice::tool-changed signal marshaller
GdkDeviceTool is an object, not a boxed type.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-19 23:56:58 -04:00
Руслан Ижбулатов
09004b51a9 Update GTK+ Windows icon (now scles up to 256x256)
Also add the SVG file that was used to produce it (derived
from the old raster logo).

https://bugzilla.gnome.org/show_bug.cgi?id=768081
2016-08-19 23:55:19 -04:00
Olivier Fourdan
f9b91197c0 wayland: Use keyboard serial for implicit grab
An xdg-popup requires a serial that the compositor will compare against
its own serial and will dismiss the popup if it doesn't match.

gtk+ uses either a pointer or touch serial for its helper function
_gdk_wayland_seat_get_last_implicit_grab_serial() but if the menu is
triggered before the user has had any pointer or touch interaction with
the client, using a keyboard shortcut, there is neither pointer nor
touch serial available, and gtk+ will use 0 as the default.

As a result, the compositor will instantly dismiss the xdg-popup. In
this case, gtk+ should use the keyboard serial instead.

Track keyboard serial as well and use the keyboard serial as the value
if there is no newer pointer or touch serial available.

https://bugzilla.gnome.org/show_bug.cgi?id=768017
2016-08-19 23:50:14 -04:00
Matthias Clasen
967e2e0cd3 Minor doc cleanup
gtk-doc is smart about plural links, nowadays.
2016-08-19 23:24:47 -04:00
Matthias Clasen
88248e34b1 Remove an outdated comment
It described as TODO what the code right below it already does.
2016-08-19 23:24:08 -04:00
Jonas Ådahl
cc019de6a5 wayland: Postpone processing move_to_rect params until showing
At the time of move_to_rect() is called, not all state may have been set
up on the impl gdk window, causing the position to sometimes be
slightly offset due to drap shadow margins. For now, work around this
by postponing the processing of the move_to_rect() parameters until
showing, when its more likely that all state (such as shadow margin)
has been set correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=769402
2016-08-18 04:52:03 -04:00
Jonas Ådahl
f6929cfef8 gdkwindow: Use toplevel for getting root cords in move_to_rect()
The Wayland backend manages a set of fake root coordinate spaces, where
each non-relative positioned toplevel (i.e. not popups, popovers,
tooltips etc) make up the basis of separate fake root coordinate spaces.

This means that the Wayland backend doesn't have the abilitiy get a
proper root coordinate when querying on a non-toplevel GdkWindow. To
avoid this issue, first find the toplevel, while translating the anchor
rect coordinates so that they are in the toplevel window coordinate
space. Then use this toplevel to translate the coordinates to root
window coordinate space.

https://bugzilla.gnome.org/show_bug.cgi?id=769402
2016-08-18 04:51:57 -04:00
Jonas Ådahl
4e0ebd0cdf wayland: Don't traverse transient-ofs when faking root coordinate space
The position of each transient-of will be in fake-root coordinate
space; thus we should not accumulate all the positions making it an
offset; each window is already in fake root coordinate space.

https://bugzilla.gnome.org/show_bug.cgi?id=769402
2016-08-18 04:51:51 -04:00
Jonas Ådahl
1f7094a3e5 wayland: Use effective toplevel as popup parent
When using the set transient-for as a popup parent, fetch the effective
toplevel instead, otherwise we will position against the wrong
coordinate.

https://bugzilla.gnome.org/show_bug.cgi?id=769402
2016-08-18 04:51:46 -04:00
William Hua
7665ee4208 mir: group DND, tooltips, and notifications with menu-type windows 2016-08-12 11:37:35 -04:00
Andreas Pokorny
b2719c0383 Remove outdated comments
https://bugzilla.gnome.org/show_bug.cgi?id=768138
2016-08-11 12:23:38 -04:00
Andreas Pokorny
3334e0a21d Use Menus to implement tooltips
The order in which tooltips are created, drawn, shown and then positioned,
always requires repositioning the surface. The tooltip window type only has
limited capability to do so. An alternative could be to use bufferstreams.

https://bugzilla.gnome.org/show_bug.cgi?id=768138
2016-08-11 12:23:38 -04:00
Andreas Pokorny
056ddf2567 Fix execution of dialog
When a dialog is created, the mir event source is already executed on the
call stack. So without the recurse flag it will not be run in the main loop
used for the dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=768138
2016-08-11 12:23:38 -04:00
Matthias Clasen
007ac65f19 Really fix unlinkage for shm_open
Reported in https://bugzilla.gnome.org/show_bug.cgi?id=769603
2016-08-11 07:07:05 -04:00
Andreas Pokorny
f95d270372 Only apply type hint if it would map to a different mir surface type
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:41:27 -04:00
Andreas Pokorny
da17eae747 Apply geometry hints to mir surface
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
96dcf89155 Apply and forward title changes of gdk windows
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
6dfb554558 Only update surface spec when there is no spec change pending 2016-08-10 13:36:38 -04:00
Andreas Pokorny
5a8af1af75 Rework window construction - only recreate surface when necessary
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
83471052cf Forward repeated key presses as further down keys
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
097ed2b40a Fix warning on newer version so mir 0.22 and newer
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Andreas Pokorny
bc4df6d4b3 Fix gcc warning on potentially uninitialized gdk_event. 2016-08-10 13:36:38 -04:00
Andreas Pokorny
252ccb846f Use the surface output event to keep track of the suggested scale value
The event will be sent when the surface becomes visible on an output. With this change the GdkMirWindowImpl keeps track of the scale value and sends a configure event on change.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
2016-08-10 13:36:38 -04:00
Matthias Clasen
a12ee84ec3 wayland: Link against librt
This is required for shm_open.

https://bugzilla.gnome.org/show_bug.cgi?id=769603
2016-08-07 16:11:55 -04:00
Philip Withnall
7b40fdbc21 gdkwindow: Fix potential NULL pointer dereferences in event code
The event code could potentially dereference pointer_info if the
invariant that ENTER_NOTIFY and LEAVE_NOTIFY events are only emitted on
devices which have pointers is violated elsewhere.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2016-08-07 08:17:50 +01:00
Руслан Ижбулатов
5e6c1928b4 W32: Prefer the deadkey combinations that the OS uses
Pick the W32 API for possible deadkey+<something> combinations
and prefer these to other sources of deadkey combos.
Specifically, if W32 API supports at least one combo for a particular
deadkey, only use that data and do not attempt to do other, unsupported
combinations, even if they make sense otherwise.
This is needed to, for example, correctly support US-International
keyboard layout, which produces a combined character for <' + a>
combo, but not for <' + s>, for example.

This is achieved by stashing all the deadkeys that we find in
an array, then doing extra loop through all virtual key codes and
trying to combine them with each of these deadkeys. Any combinations
that produce a single character are cached for later use.

In GTK Simple IM context, call a new GDK W32 function to do a lookup
on that cached combination table early on, among the "special cases"
(which are now partially obsolete).

A limitation of this code is that combinations with more than
one deadkey are not supported, except for combinations that consist
entirely of 2 known deadkeys. The upshot is that lookups should
be relatively fast, as deadkey array stays small and the combination
tree stays shallow.

Note that the use of ToUnicodeEx() seems suboptimal, as it should
be possible to just load a keyboard library (KBD*.DLL) manually
and obtain and use its key table directly. However, that is much more
complicated and would result in a significant rewrite of gdkkeys-win32.
The code from this commit, though hacky, is a direct addition to
existing code and should cover vast majority of the use-cases.

https://bugzilla.gnome.org/show_bug.cgi?id=569581
2016-08-04 16:37:19 +00:00
Руслан Ижбулатов
52c7e07948 GDK W32: Cache multiple keyboard layouts simultaneously
This changes the group/level semantic.
Previously W32 backend used "group 0/1" to denote "AltGr OFF/ON"
and "level 0/1" to denote "Shift is OFF/ON".
Now "group" means "keyboard layout" and there can be up to 255 groups,
while AltGr and Shift are combined into a single level enum that
takes values between 0 and 4.
Unlike X, W32 doesn't do effective group overriding, meaning that
it will never tell the caller that a different group was actually
used (even for universal keys, such as Enter), because key symbol
table is completely fabricated and there's no point in trying to
save a few of kilobytes of RAM by not duplicating universal key
records for all groups.

Also contains many whitespace changes (tab elimination, fixed
indentation) and cleanup (axed a few global variables, these are
now accessed via the default keymap).

https://bugzilla.gnome.org/show_bug.cgi?id=768722
2016-08-04 16:37:18 +00:00
Руслан Ижбулатов
2233566f48 GDK W32: Support UTF-16 surrogate pairs passed via VK_PACKET
This is, essentially, a piece of g_utf16_to_ucs4() built into GDK
W32 keyboard message processing.

https://bugzilla.gnome.org/show_bug.cgi?id=769126
2016-07-28 15:55:11 +00:00
Simon McVittie
f65c116d2a Don't apply GDK_HINT_RESIZE_INC to GDK_WINDOW_STATE_TILED windows
This matches the behaviour of Mutter, Metacity and traditional X11
window managers on the window manager side, and is what we want
for at least gnome-terminal. I can't think of any reason why we'd
want incremental resize in any other tiled window.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=760944

https://bugzilla.gnome.org/show_bug.cgi?id=755947
2016-07-25 09:00:01 -04:00
Matthias Clasen
f44baf51d9 Avoid a division by zero
It appears that xvfb returns nonsense in its xrandr resources.
Avoid a crash when that happens.

https://bugzilla.gnome.org/show_bug.cgi?id=768999
2016-07-25 08:32:24 -04:00
Matthias Clasen
82fd72a477 Opt in to structured logging
Define G_LOG_USE_STRUCTURED, so that all our g_debug, g_warning,
etc calls directly use structured logging and provide source information.
2016-07-22 23:13:20 -04:00
Carlos Garnacho
4a9f17c690 wayland: Fix build
Missing include pointing to tablet-unstable-v1-client-protocol.h,
pays me for not testing on a clean checkout.
2016-07-22 20:58:55 +02:00
Carlos Garnacho
9fe0c1e126 wayland: Use wl_fixed_t on wp_tablet_tool angle arguments
This is an incompatible change in tablet protocol v2.
2016-07-22 19:35:28 +02:00
Carlos Garnacho
536017646e wayland: Update current tablet support to using v2
Only update to using v2 headers/structs. The incompatible changes
to tool events are dealt with in the next commit. Pads aren't handled
in this commit either.
2016-07-22 19:35:09 +02:00
William Hua
748ebd3d72 mir: implement gdk_window_move_to_rect ()
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
William Hua
b3a530cb72 gdkwindow: add gdk_window_move_to_rect ()
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
William Hua
48108c401e gdkwindow: store transient_for window
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
William Hua
0a5bee2751 gdkwindow: store shadow sizes
https://bugzilla.gnome.org/show_bug.cgi?id=756579
2016-07-19 09:38:54 -04:00
Emmanuele Bassi
b5a2bba840 docs: Improve gdk_window_create_similar_image_surface()
The sizes passed are in device pixels and do not take into account the
scaling factor of the window itself. We cannot change the semantics of
the function, so let's at least add a warning for this trap door.
2016-07-11 16:55:10 +01:00
Olivier Fourdan
e032c83822 wayland: remove unneeded statement
seat->pointer_info.focus is already set to NULL 2 lines above, no need to
repeat it there.
2016-07-04 09:46:24 +02:00
Olivier Fourdan
298221bfba wayland: return child only in device_query_state()
On X11, device_query_state() uses XIQueryPointer() which will return a
child window only if the pointer is within an actual child of the given
window.

Wayland backend would return the pointer->focus window independently of
the given window, but that breaks the logic in get_device_state() and
later in gdk_window_get_device_position_double() because the window is
searched based on coordinates from another window without sibling
relationship, breaking gtkmenu sub-menus further down the line.

Fix the Wayland backend to mimic X11's XIQueryPointer() to return a
child only if really a child of the given window.

That's the most sensible thing to do to fix the issue, but the API here
seems to be modeled after the X11 implementation and the description of
gdk_window_get_device_position_double() is not entirely accurate.

https://bugzilla.gnome.org/show_bug.cgi?id=768016
2016-07-04 09:46:18 +02:00
Carlos Garnacho
0d30ad279f wayland: Separate selection buffers and other per-selection atom data
This has most notably impact in selection buffers, because those were
shared across all selection atoms. This turned out wrong on 2 situations:
- Because the selection atom was set at SelectionBuffer creation time, the
  GDK_SELECTION_NOTIFY events generated will have unexpected info if the
  buffer is attempted to be reused for another selection.
- Anytime different selections imply different stored content for the same
  target.

This is better separated into per-selection buffers, so it's not possible
to get collisions if a same target is used across different selections.

https://bugzilla.gnome.org/show_bug.cgi?id=768177
2016-06-30 14:10:26 +02:00
Carlos Garnacho
4b003a75aa wayland: Implement gdk_utf8_to_string_target
The sanitize_utf8() function has been copied from X11 so both
backends behave the same. This allows interaction with older clients
(mainly through Xwayland, and the STRING selection target) that
request non-utf8 text.

https://bugzilla.gnome.org/show_bug.cgi?id=768082
2016-06-30 14:10:26 +02:00
Ignacio Casal Quinteiro
46748b420a gdk: actually fix the previous commit
We do not want it on windows
2016-06-29 15:10:39 +02:00
Ignacio Casal Quinteiro
38fbe68e83 gdk: do not provide display command line argument on windows
There is no need to specify a display on windows.
2016-06-29 15:07:17 +02:00
Olivier Fourdan
0eeaa935b9 wayland: do not set PRIMARY selection if focus is lost
If keyboard focus is (already) lost, do not advertise PRIMARY selection.

https://bugzilla.gnome.org/show_bug.cgi?id=767848
2016-06-20 14:13:29 -04:00
Ray Strode
2f3cb31e55 wayland: fall back to shm_open if memfd unavailable
Debian stable currently ships with a 3.16 kernel, so
it doesn't have memfd available.

This commit adds shm_open fall back code for that case
(for now).

https://bugzilla.gnome.org/show_bug.cgi?id=766341
2016-06-16 12:02:51 -04:00
Ray Strode
bb2ca3b94d wayland: fix error handling for memfd_create
We currently use syscall() directly to invoke memfd_create,
since the function isn't available in libc headers yet.

The code, though, mishandles how errors are passed from syscall().
It assumes syscall returns the error code directly (but negative),
when in fact, syscall() uses errno.

Also, the code fails to retry on EINTR.

This commit moves the handling of memfd create to a helper function,
and changes the code to use errno and handle EINTR.

https://bugzilla.gnome.org/show_bug.cgi?id=766341
2016-06-16 12:00:24 -04:00
Emmanuele Bassi
0ca59bf85a gdk: Unset the DrawingContext <-> cairo_t link on dispose
When disposing a GdkDrawingContext we should unset the association
between the instance and the Cairo context; this avoids stale pointers
in case a reference that has acquired on the Cairo context survives the
lifetime of the GdkDrawingContext.
2016-06-12 18:55:34 +01:00
Emmanuele Bassi
222bcf1a71 gdk: Try harder at tracking drawing contexts
If gdk_cairo_create() is called within a frame draw operation, we can
still associate the Cairo context with a GdkDrawingContext.
2016-06-12 17:27:44 +01:00
Emmanuele Bassi
ddfe3374e3 Avoid a deprecation warning
Some debugging code in GdkWindow still calls gdk_cairo_create().
2016-06-09 21:00:13 +01:00
Emmanuele Bassi
ad78daaf80 gdk: Deprecate gdk_cairo_create()
We have GdkDrawingContext, now, which is in charge of creating Cairo
contexts for drawing on a GdkWindow.

https://bugzilla.gnome.org/show_bug.cgi?id=766675
2016-06-09 17:45:40 +01:00