Commit Graph

7544 Commits

Author SHA1 Message Date
Timm Bäder
73b52665e6 gdkevents: Remove gtk_widget_set_events mention
Doesn't exist anymore.
2017-10-20 14:56:29 +02:00
Chun-wei Fan
18abb78bfd Meson: Support Windows builds
Add the necessary machinery into the Meson definition files so that we
can build for Windows.

Since we don't have Wayland or X support for our use case here, disable
them once we know that we are building for Windows, as they are
(otherwise) enabled by default, and enable the items that need to be
built for Windows builds.

Exclude gtk4-launch from Windows builds as that is something that
is not supported on Windows.

As we won't have gio-unix on Windows, and PangoFT2 is optional, don't use
fallbacks for them when we are on Windows (but do use fallbacks for
gio-win32, as it will be used).

Also, clean up meson.build a bit as we can just force-include
msvc_recommended_pragmas.h from GLib since we depend on GLib, and so we
can handle these warnings from msvc_recommended_pragmas.h instead.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-10-20 17:30:58 +08:00
Michael Catanzaro
73ef640736 Revert "gdk/wayland: Avoid idempotent wl_subsurface.set_position calls"
This reverts commit 1607f8c4c6.

https://bugzilla.gnome.org/show_bug.cgi?id=784314
2017-10-19 19:52:11 -05:00
Marc-Antoine Perennou
4808829352 gdk: add accessor for GdkEventOwnerChange::reason
https://bugzilla.gnome.org/show_bug.cgi?id=789198

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-10-19 14:37:28 +02:00
Matthias Clasen
374e4a1e77 Add 3.94 version macros 2017-10-19 12:18:52 +02:00
Carlos Garnacho
1607f8c4c6 gdk/wayland: Avoid idempotent wl_subsurface.set_position calls
These may not result on wl_surface.frame callbacks, yet we do trigger
a frame clock tick that would get stuck on the lack of such callback.

https://bugzilla.gnome.org/show_bug.cgi?id=784314
2017-10-16 11:31:00 +02:00
Timm Bäder
63eb3517be GdkDisplay: Add a private _emit_opened
So we don't have to use the slower g_signal_emit_by_name in startup
paths.
2017-10-10 09:49:35 +02:00
Piotr Drąg
5678b70faf gdk: Translate some more key names
These are used in the Keyboard panel of GNOME Settings.

https://bugzilla.gnome.org/show_bug.cgi?id=787866
2017-10-09 20:33:14 +02:00
Matthias Clasen
10ec3e91f5 vulkan: Add some missing cases to switch 2017-10-06 18:29:00 -04:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Benjamin Otte
c1e9869329 build: Don't turn off critical warnings
-Wint-conversion is important because it checks casts from ints to
pointers.

-Wdiscarded-qualifiers is important to catch cases where we don't
strings when we should.
2017-10-06 16:03:08 +02:00
Matthias Clasen
090b833d8b wayland: fix a typo
This was noticed in the gtk3 backport of these changes.
2017-10-04 20:04:12 -04:00
Georges Basile Stavracas Neto
04456404be -wayland: Safeguard against NULL gtk_surface1
There is no guarantee that the gtk_surface won't be NULL,
and Wayland API does not safeguard against NULL, so we have
to do that ourselves here.

We were also mistakenly cheking for the surface version off
by one, fix that too by checking if the surface version is
equal or greater.
2017-10-04 18:30:34 -03:00
Timm Bäder
29dd0a940e GdkEvent: OWNER_CHANGE events have a selection as well 2017-09-28 20:01:01 +02:00
Timm Bäder
74ce20451f GdkEvent: Unref user_data in free
gdk_event_set_user_data refs it and this was creating pretty bad leaks.
2017-09-28 20:01:01 +02:00
Matthias Clasen
d812fc8a94 gdk: Tone down Vulkan validation
Don't show informational messages by default, only warnings
and errors. This makes it much easier to see what is going
on.
2017-09-26 18:17:27 -04:00
Daniel Elstner
08e37532b9 gdk-wayland: Do not leak dummy 1x1 surface on every draw
When using EGL, neither leak nor re-create the dummy 1x1 Cairo
surface every time gdk_wayland_window_ensure_cairo_surface()
is called.

https://bugzilla.gnome.org/show_bug.cgi?id=775126
2017-09-26 21:14:21 +02:00
Matthias Clasen
171fef4b87 Fix a typo 2017-09-25 17:53:54 -04:00
Rico Tzschichholz
9f259a7391 gdk: Add g-i annotations for new event getters 2017-09-22 14:18:00 +02:00
Daniel Boles
9c7e996bce gdkseatdefault: Grab touch events where applicable
gdk_seat_default_grab() grabs POINTER_EVENTS if the capability is
GDK_SEAT_CAPABILITY_ALL_POINTING. But that enumerator is a union that
includes GDK_SEAT_CAPABILITY_TOUCH, but we never grabbed TOUCH_EVENTS,
an unused macro that was presumably created with this purpose in mind.

So, check which of the ALL_POINTING capabilities we have, and set the
right mask of POINTER_EVENTS and/or TOUCH_EVENTS as required.

As part of this, explicitly let TABLET_STYLUS take over pointer events,
as this is the intended behaviour and was the effective result before.

This should fix touch events being lost in migrating from Device.grab()
to Seat.grab(GDK_SEAT_CAPABILITY_ALL_POINTING), as found by Inkscape.

https://bugzilla.gnome.org/show_bug.cgi?id=781757
2017-09-20 19:19:35 +01:00
Carlos Garnacho
fb81d7fc8f gdk/x11: Implement GDK_CROSSING_TOUCH_BEGIN/END/DEVICE_CHANGE events
The behavior where a touchpoint takes over the pointer position is
really backend dependent. Since this went away from the generic code,
implement it here.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
97139e4027 gdk: Remove remainings of fake crossing event delivery across touch
This was by all lights broken, and is basically an implementation detail
of the X11 backend since the pointer emulating touch just steals the pointer
cursor, so should be reimplemented there.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
f3b0a3780e gdk: Coalesce 2 GdkWindow fields in GdkPointerWindowInfo struct
One used to point to the toplevel and the other to the client-side window
that the pointer pointed to. The latter was made to be like the former in
most places, so put those together, and fix the remaining cases where the
variable might not end up with a toplevel/native window.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
c00567a64c gdk: Remove unused variable
It was supporting API that has been removed.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
0317b0d18d gdk: Remove implicit touch grab accounting
This is not necessary now that there's no client-side windows to track.
The only removed piece that could make sense is emission of grab broken
events, but it's already an stretch since the semantics of those with
multi-touchpoint is unclear.

Anyhow, This should be fixed at the GTK level, while we let GDK deal with
seat/device level grabs.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
44cb3ccfa1 gdk: Remove motion hints
Motion hints are now literally a thing of the past. Everything should be
using the full motion event stream.
2017-09-19 18:40:51 +02:00
Carlos Garnacho
3e1f672170 gdk: Drop generation of synthesized crossing events on grabs
GDK just needs to care about toplevels nowadays, which means these events
are already delivered from the windowing. We don't need to generate
intra-window crossing events ourselves.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
a9988e18b0 gtk: Remove 2BUTTON and 3BUTTON events and event types
Those should be interpreted by widget-local gestures, not guessed at a
high level with no notions of the specific context. Users will want
GtkGestureMultiPress to replace these events.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
403a724164 gdk: Remove array of event masks
This has been unused since all events are just forwarded instead of
checking client-side windows evmasks.
2017-09-19 18:40:50 +02:00
Carlos Garnacho
2985bf3313 gdk/x11: Avoid delivering emulated scroll events
We now just propagate the real event, and let the caller deal
with smooth vs discrete.
2017-09-19 18:39:03 +02:00
Carlos Garnacho
d271b135bb gdk/wayland: Drop emission of emulated scroll events
A wl_pointer.frame can now only result on one scroll event
being emitted.
2017-09-19 18:39:03 +02:00
Carlos Garnacho
6fd905e4e1 gdk/x11: Drop motion/button events emulated from touch
We now always listen to touch events. Just avoid delivering both
types of events.
2017-09-19 18:39:03 +02:00
Matthias Clasen
7306f55912 Add some more GdkEvent getters 2017-09-19 18:39:03 +02:00
Matthias Clasen
66d8483fdf Add more GdkEvents API 2017-09-19 18:39:02 +02:00
Matthias Clasen
5488009150 Add more getters for event fields 2017-09-19 18:39:02 +02:00
Carlos Garnacho
c7431f46b5 gdk: Make GdkEvent structs/union opaque
All users are forced to deal with events as opaque pointers, only
using API to access the info.
2017-09-19 18:39:02 +02:00
Carlos Garnacho
ab5f02771a gdk/wayland: Don't make gtk_shell1 v2 mandatory
It may result in a protocol error on older mutters, as GTK+ will
invariably request a higher version than what's available. Make
GTK+ also accept v1 if it's all the compositor has got.
2017-09-19 18:35:20 +02:00
Georges Basile Stavracas Neto
01911b5ecd wayland: Bump GTK_SHELL1 version to 2
Otherwise, we can't negotiate the latest version with the
compositor, making the compositor use v1 of the protocol and
pretty much ignoring all the edge constraints work.
2017-09-18 23:51:03 -03:00
Georges Basile Stavracas Neto
0bdaebef1e window: Improve detection of edge constraint support
Instead of relying on special values of edge constraints, this
patch adds an internal-only gdk_window_supports_edge_constraints()
function that by default returns FALSE, and is implemented by
GdkWindowWayland and GdkWindowX11.

This way, we can properly detect server-side support for this
feature and adapt accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Georges Basile Stavracas Neto
03204f8cdb x11: Add support for _GTK_EDGE_CONSTRAINTS atom
Following the previous patch, where edge constraints support
was added to the Wayland backend, this patch introduces the
necessary code to handle the _GTK_EDGE_CONSTRAINTS atom from
X11 backend.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Georges Basile Stavracas Neto
e9cc77ecc8 wayland: consider edge constraints in surface configuration
Now that GTK windows have the ability to properly handle
per-edge tiling constraints, this patch extends GTK's
internal Wayland protocol to have a proper enum with the
relevant edge data.

Once this approach is validated, we can think of upstreaming
this work as an official Wayland protocol extension.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Georges Basile Stavracas Neto
019f0af0eb gdk: introduce edge constraint states
These states will be consumed by GtkWindow in order to
have better edge management on tiling situations. Their
values are supplied by the compositor, and will be send
through and X11 Atom or a Wayland protocol extension.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Chun-wei Fan
e5a1de1c19 gdk/gdkconfig.h.meson: Add GDK_WINDOWING_WIN32
This is so that Meson can add this define once it is determined that we
are building for Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=785210
2017-09-15 21:41:15 +08:00
Nirbheek Chauhan
aa3e8ee097 build: Add dependency fallbacks for libs with meson ports
With these changes gtk+ builds for me using fallbacks for all libraries
with fallbacks available. Needs the following changes:

https://github.com/ebassi/graphene/pull/109 (graphene)
https://bugzilla.gnome.org/show_bug.cgi?id=787414 (pango)
https://github.com/mesonbuild/meson/pull/2291 (will be in meson 0.42.1)

https://bugzilla.gnome.org/show_bug.cgi?id=787416
2017-09-12 00:24:58 +05:30
Matthias Clasen
95ae7b7c1e x11: Fix managed dnd
We need to actually trigger the drop from the gdk side.
2017-08-27 08:55:16 -04:00
Matthias Clasen
a683629dc7 Remove an unused field
Drag contexts are objects, so there is no need to carry a
manual refcount around.
2017-08-26 19:54:39 -04:00
Matthias Clasen
5722f25d51 x11: Fix initial drag cursors
Under X, we were not setting the right drag cursor initially,
because at current_action == action == 0, initially. Fix this
by explicitly using the right cursor when grabbing.
2017-08-26 19:54:29 -04:00
Matthias Clasen
44e1c19b42 Revert "wayland: fix filechooser crash"
This reverts commit bd033165e5.

The function already had an early exit, no need for this check.
2017-08-23 10:40:12 -04:00
Lionel Landwerlin
bd033165e5 wayland: fix filechooser crash
The opaque region of the window can be updated before we're requested
its creation on the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=786673
2017-08-23 10:36:30 -04:00
Matthias Clasen
4402335333 wayland: fix filechooser crash
The size of the window can be updated before we're requested its
creation on the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=786673
2017-08-23 10:36:30 -04:00