Commit Graph

6691 Commits

Author SHA1 Message Date
Carlos Garnacho
f9f5586714 wayland: Make the function to get the last serial a seat one
This will be useful for primary selection.

https://bugzilla.gnome.org/show_bug.cgi?id=762561
2016-02-26 19:59:17 +01:00
Carlos Garnacho
787e1d7113 wayland: Add gtk-primary-selection protocol
This protocol is an internal mirror of the primary selection drafts
being proposed for wayland-protocols. No changes besides prefix/suffix
changes.

https://bugzilla.gnome.org/show_bug.cgi?id=762561
2016-02-26 19:59:17 +01:00
Fredy Paquet
0a6ee5e2cf W32: Fix for commit 1f74f12d9, re-enabling decimal separator key
1f74f12d9 rendered entry of keypad decimal mark unuseable for
several national keyboard layouts, this commit amends that, at
least for W32, and makes GTK+ behave more or less the same way
W32 behaves.

The patch works like this:
- When typing the first character at the keyboard or when switching
  keyboard layouts, the decimal mark character will be cached in the
  static variable "decimal_mark" within gdkkeys-win32.c

- in case of WIN32, gdk_keyval_to_unicode() asks gdkkeys-win32.c for the
  current decimal_mark when converting GDK_KEY_KP_Decimal.

https://bugzilla.gnome.org/show_bug.cgi?id=756751
2016-02-26 17:24:32 +00:00
Руслан Ижбулатов
c61764b0f9 GDK W32: Fix the filling of MINMAXINFO
1) MSDN says that the coordinates of the maximized window
   must be specified as if the window was on the primary display,
   even if nearest display where it ends up is not the primary display.
   So instead of using nearest display work area verbatim,
   use it only to account for taskbar size, while using
   primary display top-left corner (0:0) as the reference point.
2) MSDN says that max tracking size is a system property, we
   should just call GetSystemMetrics() and use that.

https://bugzilla.gnome.org/show_bug.cgi?id=762629
2016-02-26 08:02:03 +00:00
Matthias Clasen
5522ce9649 xi2: Add some more debug spew
Log the valuators we use or ignore.
2016-02-25 21:19:31 -05:00
Matthias Clasen
5b2e883161 Remove redundant words from docs
An either without an or doesn't add anything.
2016-02-25 20:16:21 -05:00
Matthias Clasen
f749152efe Fix a copy-paste error 2016-02-25 20:12:53 -05:00
Matthias Clasen
a4a7740b2f xi2: Set ::num-touches for touch devices
XI2 has this information, so pass it on.
2016-02-25 08:27:08 -05:00
Matthias Clasen
f468f0fbb2 device: Add a num-touches property
Some backends can provide this information for touch devices,
and it can be useful to have, so add this property.
2016-02-25 08:27:08 -05:00
Matthias Clasen
e12663378c x11: Update seat capabilities
The default seat implementation was never returning capabilities,
which is broken. It is visible too, since the inspector shows seat
information now.
2016-02-25 06:18:41 -05:00
Matthias Clasen
c75a833633 x11: More fake tablet blacklisting
Sigh.

Now that we've neutered the QEMU USB tablet, I'm finding that
spice is doing just the same nonsense. It has a fake "spice vdagent
tablet". Blacklist that as well.
2016-02-24 22:22:11 -05:00
William Hua
acbb0c4bdd mir: fix warnings 2016-02-24 13:24:14 -05:00
William Hua
594ba3071b mir: fix GdkSeat-related deprecations 2016-02-24 13:23:18 -05:00
Carlos Garnacho
4ff3d5b7a6 gdk: Avoid 2/3BUTTON event generation if the source device changes
Remember the last source device we're generating multiple clicks for,
just so we can bail out if the device changed. That will just reset
the counting.

https://bugzilla.gnome.org/show_bug.cgi?id=723659
2016-02-23 20:35:01 -05:00
Paolo Borelli
c643d8b402 Win32: fix warning 2016-02-22 21:45:08 +01:00
Paolo Borelli
bc3c855e35 wip _gdk_display 2016-02-22 21:45:08 +01:00
Paolo Borelli
7047099fd8 Win32: fold the gdkinput.c file in gdkdisplay-win32.c
This is similar to what is done in the X11 and wayland backends.
It also gets rid of the _gdk_input_devices global variable
2016-02-22 21:45:08 +01:00
Paolo Borelli
b3a80180c7 Win32: remove leftover function
gdk_devices_list was removed from the API in 3.0 and it is not
in the headers. The win32 implementation lingered on by mistake.
2016-02-22 21:45:08 +01:00
Allin Cottrell
46d3611052 Fix Quartz Full Screen Crash. 2016-02-21 16:22:27 -08:00
Matthias Clasen
e837aa69b6 x11: Some cleanups to the multihead initialization
The significant change here is a memory leak fix in init_xrandr15.
The rest of the changes makes init_xrandr13 and init_xrandr15 more
parallel, and simplifies init_multihead.
2016-02-20 10:54:48 -05:00
Marco Trevisan (Treviño)
1dda932109 X11, GdkScreen: properly implement init_randr15 including output name
https://bugzilla.gnome.org/show_bug.cgi?id=762319
2016-02-20 10:45:44 -05:00
Carlos Garnacho
ebb175021e wayland: Implement gtk_shell.set_startup_id
Fetch the DESKTOP_STARTUP_ID envvar at the same point it's done
for the X11 backend, and notify the startup ID gotten on
notify_startup_complete().
2016-02-19 17:45:42 +01:00
Carlos Garnacho
ce62f0513d wayland: Update gtk-shell protocol to v3
Add a gtk_shell.set_startup_id request, so the application can communicate
to the compositor the startup id that it received through the
DESKTOP_STARTUP_ID envvar, or other means.
2016-02-19 17:45:42 +01:00
Paolo Borelli
7505d49741 Win32: free the monitors array 2016-02-19 15:49:29 +01:00
Paolo Borelli
3aec838313 Win32: chain up screen finalize
Add the proper chain up (in preparation to actually freeing stuff) and
remove the empty dispose implementation
2016-02-19 15:49:29 +01:00
Paolo Borelli
577016126e Win32: remove the _gdk_monitors global variable
Make it a field of GdkWin32Screen since that is the object exposing
all the the getters.
2016-02-19 15:28:38 +01:00
Paolo Borelli
2e7f98a683 Win32: remove the _is_win8_or_above global variable 2016-02-19 15:28:38 +01:00
Matthias Clasen
9c2110122b gdk: Add a way to show included backends
Set GDK_BACKEND=help to see a list of all inluded GDK backends.
2016-02-18 22:03:12 -05:00
Olivier Fourdan
5a253c546a wayland: check for support of xdg_shell interface
When running with a Wayland compositor which doesn't support the
xdg_shell interface, gtk+ will segfault while trying to access the
corresponding wl proxy.

Check for xdg_shell support and do not use Wayland if not present, so
that it can fallback to X11, hoping that Xwayland is usable.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=762258
2016-02-18 15:29:01 +01:00
Jonas Ådahl
38b1f15f12 wayland: Only attach the buffer if there was damage
There is no point in attaching and then committing the same buffer if
there was no damage. This will also make us do less unnecessary backfill
read backs, for the cases where we paint with an empty paint region.

https://bugzilla.gnome.org/show_bug.cgi?id=762120
2016-02-16 16:22:51 -05:00
Jonas Ådahl
64c9ec14fe wayland: Handle after-paint invocations when nothing was painted
If a after-paint was scheduled but nothing was painted, for example when
the it was scheduled by a subsurface wanting to update its position,
we'd still try to read back from the backfill cairo surface and update
the committed cairo surface reference even though no buffer was
attached.

Fix this by adding a new state, 'pending_buffer_attached', which is only
true if a buffer was attached during frame. Only when this is true will
the backfill be read back and the committed cairo surface reference be
updated.

https://bugzilla.gnome.org/show_bug.cgi?id=762120
2016-02-16 16:22:51 -05:00
Carlos Garnacho
38d0d0a687 gdkdnd: Stick to the first gdk_drag_drop_done() result
That way we can let ::cancel callers to override the visual
result of the operation (eg. when detaching notebook tabs on
NO_TARGET).

Also, document gdk_drag_drop_done() so it is mentioned that
this is a one-shot call.

https://bugzilla.gnome.org/show_bug.cgi?id=761954
2016-02-15 19:04:22 +01:00
Carlos Garnacho
4636552a76 gdkdnd: Make GtkDragContext::cancel RUN_LAST
The default implementation code should act as a catch-all fallback,
we let the connected handlers to run first then.

https://bugzilla.gnome.org/show_bug.cgi?id=761954
2016-02-15 18:35:51 +01:00
Carlos Garnacho
aad3135e4c gdk: Add GdkDragCancelReason enum as argument to GdkDragContext::cancel
We should conform to a minimal set of reasons for the gtk side to emit
a better GtkDragResult than GTK_DRAG_RESULT_ERROR. This fixes the notebook
tab DnD feature, where we rely on GTK_DRAG_RESULT_NO_TARGET.

In the wayland side, unfortunately we can't honor either NO_TARGET nor
USER_CANCELLED, we don't know of the latter, so we could return false
positives on the former.

https://bugzilla.gnome.org/show_bug.cgi?id=761954
2016-02-15 18:35:51 +01:00
Carlos Garnacho
d55b8151f2 x11: Avoid setting has_pointer_focus if a EWMH compliant WM is present
This is mostly useful to have focus behave sanely on lack of WM, so avoid
any check there if we're positive there is a WM handling focus.

https://bugzilla.gnome.org/show_bug.cgi?id=677329
2016-02-12 22:05:30 +01:00
Emmanuele Bassi
90d5c7f9e8 mir: Add C++ guards
Avoid missing symbols when compiling C++ including the GDK Mir backend
header.

https://bugzilla.gnome.org/show_bug.cgi?id=761829
2016-02-11 12:01:39 +00:00
Benjamin Otte
033fb5a879 win32: Always pass a window to the default event filters
This has to happen or the event filter cannot identify what type
of display the event is from (ie if it's an XEvent, a broadway
event or a win32 MSG.
2016-02-11 03:44:48 +01:00
Benjamin Otte
ec3ce21beb win32: Remove _gdk_display usge from dnd code 2016-02-11 03:44:47 +01:00
Benjamin Otte
7f266e1a03 win32: Make cursor code work without _gdk_display 2016-02-11 03:44:47 +01:00
Benjamin Otte
76e56c5038 win32: Stop using _gdk_display global in device code
Use gdk_device_get_display() instead.
2016-02-11 03:44:47 +01:00
Benjamin Otte
766b1b9886 win32: Remove deprecation warnings in dnd code 2016-02-11 03:44:46 +01:00
Benjamin Otte
4ce6d10601 win32: Remove deprecation warnings in devicemanager code 2016-02-11 03:44:46 +01:00
Benjamin Otte
584931e94d win32: Use g_set_object()
... instead of a hand-rolled version that does the same thing.
2016-02-11 03:44:46 +01:00
Benjamin Otte
788951c543 win32: Fix empty body warning 2016-02-11 03:44:46 +01:00
Ignacio Casal Quinteiro
eb555979db win32: properly handle show and focus
The first time a window is shown we should always call SW_SHOWNORMAL.
Understand whether to call SW_SHOW or SW_SHOWNORMAL and the specific
ones for the temporary windows depending on IsWindowVisible.
This also fixes the problem when calling gtk_window_present and
the window is snapped to the left or right of the screen.

This patch is based on the patches provided by Yevgen Muntyan
and Aleksander Morgado.

https://bugzilla.gnome.org/show_bug.cgi?id=698652
2016-02-08 13:25:01 +01:00
Yevgen Muntyan
07a994c89f win32: on focus restore the window if iconified
If the window is iconified we want to restore the window
to get the proper size instead of showing it normal which
would change the size of the window.

https://bugzilla.gnome.org/show_bug.cgi?id=698652
2016-02-08 12:58:58 +01:00
Ray Strode
c80dd54924 wayland: stage uncommitted changes to dedicated buffer
Right now we use one buffer for both staged changes (freshly painted
changes waiting for the frame clock to send to the compositor) and
committed changes (changes actively being read by the compositor
process). This creates a problem in the event we need to stage updates
at the same time the compositor is processing committed updates: we
can't change what the compositor is actively processing.

The current solution for handling this contention is to allocate a
temporary buffer on the spot at the time the updates are staged, and to
copy that buffer back to the shared buffer later.  The problem, though,
is that the copy to the shared buffer currently happens as soon as
the updates are finished being staged, not when the shared buffer is
done being processed by the compositor.

In order to address that problem, this commit changes the code to always
stage changes to a dedicated staging buffer.  The staging buffer is
used exclusively by the client until the client is done with it, and then
once that staging buffer is committed, the client never writes to that
buffer again.  If the client needs to stage new updates, it allocates a
brand new staging buffer, draws to it, and back fills the undrawn parts
of the buffer from a copy of the contents of the committed buffer.

As an optimization, the compositor has the option of releasing the
committed buffer back to the client.  If it does so before the client
needs to stage new updates, then the client will reuse the buffer
for staging future updates.  This optimization prevents having to allocate
a new staging buffer and the associated cost of back filling
that new buffer with a readback of the committed buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:02:57 -05:00
Ray Strode
40e91195ad wayland: don't handle buffer release centrally
Right now we handle buffer releases coming from the
compositor in a central place. We add a listener when
first creating the shared buffers.

This is problematic because a buffer can only have
one listener on it at once so users of the buffer
can't get notified when it's released.

This commit moves the buffer listener code from the
centrally managed display code to the cursor and window
code.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:02:57 -05:00
Ray Strode
2c300081c4 wayland: always return FALSE from begin_paint
The client and compositor share access to the window
pixel buffers. After the client hands off (commits)
the buffer to the compositor it's not supposed to write
to it again until it's released by the compositor.

The code tries to deal with this contention by allocating
a temporary buffer and using that in the mean time. This
temporary buffer is allocated by a higher layer of the code
when begin_paint returns TRUE. Unfortunately, that layer of
the code has no idea when the buffer is released, so it ends
up blitting the temporary buffer back to the shared buffer
prematurely.

This commit changes begin_paint to always return FALSE.

A future commit will address the contention problem in
a different way.

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:02:57 -05:00
Ray Strode
1cfa2f4134 wayland: use g_clear_pointer when destroying cairo surfaces
There are a few places where we destroy a cairo surface and
then nullify it. This commit changes those to use
g_clear_pointer instead.

It also drops a cairo_surface_finish call that is unnecessary

https://bugzilla.gnome.org/show_bug.cgi?id=761312
2016-02-06 08:00:35 -05:00