Commit Graph

7455 Commits

Author SHA1 Message Date
Chun-wei Fan
77e1d0c0c9 gdk/gdkvulkancontext.c: Fix 32-bit Windows builds
The callback function that is used by VkDebugReportCallbackCreateInfoEXT
is decorated with VKAPI_CALL (which is __stdcall on Windows).  This is
not detected on x64 Windows as __stdcall is not really meaningful on x64
Windows, and VKAPI_CALL expands to nothing on non-Windows.

As __stdcall functions are treated differently on 32-bit Windows, the
32-bit compiler does require that the function be declared as __stdcall
so that things will compile, link and run properly.

https://bugzilla.gnome.org/show_bug.cgi?id-773299
2017-06-06 00:06:35 +08:00
Dan Torop
a23ad61a25 wayland: selectively cancel key repeat on key release
Under Wayland, when multiple keys are pressed and the user releases a
key, key repeat should continue unless the key released is the one
currently repeating.

In the case of:

- key1 press
- key1 repeat
- key2 press -> key1 repeat stopped
- key2 repeat
- key2 release

The behavior should be to cancel keyboard repeat, though key1 is still
held down. This is consistent with prior X11/XWayland behavior.

The following also must work:

- key1 press
- key2 press
- key2 release
- key2 press
- key1 release
- key2 should continue to repeat

The fix for bug #778019 should continue to work:

- key1 press
- key1 repeat
- key2 press -> key1 repeat stopped
- key1 release
- key2 should repeat

The choice to change the counter nkeys to the flag repeat_active
helps to solve the second test case.

https://bugzilla.gnome.org/show_bug.cgi?id=781285
2017-06-02 19:13:03 +02:00
Olivier Fourdan
24f9d29093 wayland: fix xdg_surface test in move/resize drag
begin_resize_drag() and begin_move_drag() check for xdg_surface being
not null, but those apply on xdg_toplevel so they should check for
xdg_toplevel being non-null instead.

https://bugzilla.gnome.org/show_bug.cgi?id=781945
2017-06-02 16:19:00 +02:00
Olivier Fourdan
08aade4b7c wayland: check parent surface for subsurface
When an event is received while a tooltip is showing, the GtkTooltip's
event handling code can end up calling gdk_window_set_transient_for()
from gtk_tooltip_set_last_window().

The Wayland GDK backend will try to automatically create a subsurface
in gdk_wayland_window_set_transient_for() but if the parent surface is
gone meanwhile, this will will cause a crash when trying to create a
subsurface from a parent with a null surface.

Checking for the parent is not sufficient, we ought to check for the
parent surface as well to avoid the crash.

https://bugzilla.gnome.org/show_bug.cgi?id=782283
2017-06-02 15:43:06 +02:00
Olivier Fourdan
a84fc38784 wayland: Do not map toplevel utility as popup
Applications can specify the type hint as utility even on toplevel
windows.

When that toplevel is also marked as a transient for another window,
GDK Wayland backend would translate that as an xdg_popup which is not
appropriate.

While utility temp windows should remain mapped as subsurfaces (such as
the ones used by treeviews), regular windows should not translate as
neither a subsurface nor an xdg_popup.

https://bugzilla.gnome.org/show_bug.cgi?id=781945
2017-06-02 15:15:45 +02:00
Rico Tzschichholz
a4e80efee7 gdk/gtk: Fix Since tags for 3.92 symbols
In addition to 406db15066
2017-05-30 15:10:25 +02:00
Debarshi Ray
385a46b5c0 wayland: Don't warn if the display is lost, skip exit handlers
There is no need to have every application log a warning when the
Wayland display server goes away, and we are using _exit instead of
exit elsewhere.

This is also what the X11 backend does (see gdk_x_io_error).

https://bugzilla.gnome.org/show_bug.cgi?id=745289
2017-05-30 09:15:57 +02:00
Daniel Boles
406db15066 gdk/gtk: Fix more AVAILABLE_IN annotations to 3_92 2017-05-28 14:20:19 +01:00
Daniel Boles
b6e13847d5 gdkevents.h: Fix version annotations on new funcs 2017-05-27 15:25:35 +01:00
Carlos Garnacho
3a15c8241e gdk: Remove synthetic crossing event emission due to geometry changes
This just applied to child windows, but now GDK should just take care of
toplevels, which shall get crossing events from the windowing when the right
conditions apply.

Removing this code fixes confused crossing state in widgets and messed up
window_under_pointer tracking (Which now is meant to be toplevels) when any
of the remaining child GdkWindows trigger these crossing events.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
61dd925b32 gdk: Ensure to implicitly deactivate grabs when an impl window is hidden
For some reason this wasn't done on windows with an impl, but it totally should.
Probably hidden by grabs in menus and somesuch being done on a child window.
2017-05-25 16:25:59 +02:00
Timm Bäder
34fdc51392 Constify GdkEvent parameters in gtk_get_event_widget and _event_target 2017-05-25 16:25:59 +02:00
Carlos Garnacho
65de0ebea3 gdk: Make it possible to attach user data to GdkEvents
As event->any.window is the toplevel, this is not useful anymore to
determine the window/widget that is the target for this event. Add
helper functions to attach user data to GdkEvents so the target
widget can be stored on the gtk/ side.

These calls should be made private with the rest of GdkEvent related
API.
2017-05-25 16:25:59 +02:00
Carlos Garnacho
f57f48d61f gdkwindow: Drop csw-side event translation
Now that gtk_main_do_event() is able to handle pointing events in toplevel
coordinates, forward all of these as is. Just minimal handling is still done
on the gdk side for GDK grab accounting, and toplevel tracking for each
pointer.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
799428aaea gdk: Add gdk_event_set_coords() method
A helper function basically for gtk+, so coordinates can be translated
in place depending on the widget it's being delivered to.
2017-05-25 16:25:58 +02:00
Carlos Garnacho
fee289cd06 gdk: Add gdk_rectangle_contains_point() call
A little helper function for a somewhat common operation.
2017-05-25 16:25:58 +02:00
Debarshi Ray
28f8a27d65 wayland: Don't abort when preparing the source if connection is lost
Aborting the application makes it look like an application bug, when
it is the expected thing to do when the Wayland display server goes
way. eg., when the user logs out. The log level is also demoted to
avoid a storm of warnings in the log from all applications whenever
this happens.

This is also what the X11 backend does (see gdk_x_io_error).

https://bugzilla.gnome.org/show_bug.cgi?id=783047
2017-05-25 11:49:37 +02:00
Jonas Ådahl
71adc74f27 GdkWaylandWindow: Unexport when finalizing
The application might not have exported, and it'll be too late for it
at this point anyway, so lets be helpful and not leak it.

https://bugzilla.gnome.org/show_bug.cgi?id=782109
2017-05-09 11:59:06 +08:00
Jonas Ådahl
5c74afb2f1 wayland: Remove self assignment
Don't assign the value of a variable to itself. It was added just for
clarity, but it makes coverity complain, so remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=780301
2017-05-08 17:42:31 -04:00
Jonas Ådahl
9f9aaea319 wayland: Use correct enum type and values
Use the gravity enum values when converting to gravity. It doesn't fix
anything, since the enum values were identical, but it makes a coverity
warning go away.

https://bugzilla.gnome.org/show_bug.cgi?id=780301
2017-05-08 17:42:31 -04:00
Matthias Clasen
c4a5f6a601 Revert "GdkWaylandWindow: Unexport when finalizing"
This reverts commit 251e216052.
2017-05-08 15:59:23 -04:00
Jonas Ådahl
251e216052 GdkWaylandWindow: Unexport when finalizing
The application might not have exported, and it'll be too late for it
at this point anyway, so lets be helpful and not leak it.

https://bugzilla.gnome.org/show_bug.cgi?id=782109
2017-05-08 15:41:11 -04:00
Jonas Ådahl
6d7749898d GdkWaylandWindow: Clear export user data when used
It was only cleared when unexported, but we could just as well clear it
when its used too.

https://bugzilla.gnome.org/show_bug.cgi?id=782109
2017-05-08 15:41:11 -04:00
Emmanuele Bassi
0dad501d16 meson: Remove G_LOG_USE_STRUCTURED from target C flags
The G_LOG_USE_STRUCTURED symbol is defined in the project flags, so we
don't need to add it again in the per-target flags.
2017-05-03 16:22:52 +01:00
Emmanuele Bassi
9b7148cdbd build: Use link_whole for GDK backends
When linking libgdk4 to each backend's static library, we want to use
the whole-archive support.
2017-05-03 15:10:58 +01:00
Emmanuele Bassi
d09ccaaf35 build: Define G_LOG_USE_STRUCTURED in GDK
We want to use the new structured logging support in GLib.
2017-05-03 15:10:58 +01:00
Emmanuele Bassi
9e8ba70d69 build: Add common flags to GDK backends
The common compiler and linker flags control, among other things, the
default visibility of symbols; without them, we leak symbols that ought
to be private.
2017-05-03 15:10:58 +01:00
Emmanuele Bassi
17518ef89b build: Improve consistency of the "coding" style
We're mixing a lot of styles in the Meson build files. This is an
attempt at making everything slightly more consistent in terms of
whitespace and indentation.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
561f41d112 build: Clean up Wayland protocol code generation
We can build the name of the input and output files for the Wayland
protocols we use from the protocol name, stability, and version. This is
similar to how the autotools build does it, except much more clear and
without shelling out twice to sed just to resolve the Makefile rule.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
d35d82fb35 build: Rename GSK resource generator script
Maintain the naming convention, since we have similar scripts for GDK
and GTK already.
2017-05-03 15:10:57 +01:00
Emmanuele Bassi
5e2eaa5dbc build: Add introspection generation
Currently, no platform-specific introspection is generated; there will
be a follow-up commit.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
e18d9a85ca build: Use the common linker flags in GDK and GSK
Instead of hard-coding `-Bsymbolic`.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
68039b610b build: Add compiler warnings and errors
We don't want to build buggy code.
2017-05-03 15:10:56 +01:00
Emmanuele Bassi
9105227b56 build: Do not mix private and public GDK headers
The type generation script inside gtk/ will use the `gdk_headers`
variable, and that must not contain private headers.
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
e1dc4f7ae1 meson: gdk: fix static library names
Fix double lib prefix in filenames (liblibgdk-xyz.a)
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
e850973956 meson: build input modules
We have to work around some ordering problems here. We still
manage to keep most of the guts in modules/input/meson.build,
so it's not too ugly overall.

(The autotools build solves this with a 'make -C ../../input/modules'
inside gtk/Makefile, but that's not something we can or want to do.)
2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
1c14e93e69 meson: check for xinerama 2017-05-03 15:10:56 +01:00
Tim-Philipp Müller
2f3c975058 meson: remove duplicate libm variable
Only need one of libm and mlib
2017-05-03 15:10:55 +01:00
Tim-Philipp Müller
f67a9d58db meson: make sure gsk/gdk generated headers exist for libgtk_dep users
Add back dependencies on libgdk_dep and libsk_dep which are declared
dependencies. We removed this before because these declarations had
link_with: lines that dragged in the static libgdk.a and libgsk.a libs
which are linked into libgtk-4.so anyway and thus shouldn't be used
when linking internal exes/tools against libgtk-4. Remove the static
libs from the declared dependencies and have libgtk link those in
explicitly, so that the declared deps now just provide all the built
dependencies and include dirs and such for declared libgtk_dep users
such as the internal exes/tools, which want all the generated gsk/gdk/gtk
headers to exist before attempting to compile anything against the
gtk+ headers.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
07ffb19c42 meson: gdk, gsk: fix install path of generated files 2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
c7d3fe5e26 meson: gdk: add quartz backend skeleton
Won't even build yet, just put basic bits in place.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
442185388b meson: gdk: win32: add skeleton bits for win32 backend
Won't even build, configure bits still missing.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
cbb6a62496 meson: gdk: wayland: generate private wayland headers first
gdkprivate-wayland.h includes generated wayland client protocol
headers and is included from gdkdisplaymanager.c, so we need to
generate those client protocol headers first also when building
main gdk itself.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
152a25d099 meson: gdk: add Mir backend bits
Completely untested, might not even build.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
e001d95538 meson: gdk: build individual backends as static libs
This is how it's done in the autotools build. Also avoids problems
with multiple source files having the same name (gdkeventsource.c).

Also move broadway backend code into broadway subdir.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
d4881df0d8 meson: gdk: wayland: move wayland bits into wayland subdir 2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
4b969b1b40 meson: gdk: wayland: use array for protocol file generation 2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
22d7b825fb meson: gdk: move x11 bits into x11 subdirectory
Also install headers.
2017-05-03 15:10:54 +01:00
Tim-Philipp Müller
b947e88fbf meson: gdk: update and sync with Makefiles
Also create gdk.gresource.xml at build-time.
2017-05-03 15:10:53 +01:00
Tim-Philipp Müller
95979f4d2f meson: add vulkan bits 2017-05-03 15:10:53 +01:00