Commit Graph

7549 Commits

Author SHA1 Message Date
Matthias Clasen
340c62ecd6 Merge branch 'issue1044' into 'gtk-3-24'
Fix resize requests being forgotten when maximizing a hidden window

See merge request GNOME/gtk!367
2019-09-03 15:43:07 +00:00
Jonas Ådahl
e9fdb35687 Revert "gdk/wayland: go through monitor to compute scale factor"
This reverts commit 6d545b6d03.

Reverting as this broke multi DPI systems, where a client is expected to
render at scale = 1 if it is only visible on a scale = 1 monitor.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2129
2019-09-03 17:13:17 +02:00
Olivier Fourdan
a1becccd3f wayland: Fix xdg-output v3 support
The xdg_output.done event is deprecated in xdg-output v3, so clients
need to rely on the wl_output.done event instead.

However, applying the changes on the fist wl_output.event when using
xdg-output v3 may lead to an incomplete change, as following xdg-output
updates may follow.

Make sure we apply xdg-output events on wl_output.done events with
xdg-output v3.

https://gitlab.gnome.org/GNOME/gtk/issues/2128
2019-09-03 16:10:33 +02:00
John Ralls
a12931b9f8 Silence compiler type warnings about converting enums to gboolean. 2019-08-28 19:54:58 -07:00
Matthias Clasen
64fe119643 Merge branch 'wip/carlosg/ensure-selection-notify' into 'gtk-3-24'
Ensure to emit GDK_SELECTION_NOTIFY on all circumstances

See merge request GNOME/gtk!1057
2019-08-25 11:54:46 +00:00
Matthias Clasen
3857077701 Merge branch 'build-remove-xiproto-xreply-check' into 'gtk-3-24'
autotools: remove NEED_XIPROTO_H_FOR_XREPLY check

See merge request GNOME/gtk!1058
2019-08-25 11:46:40 +00:00
Matthias Clasen
a579083b17 Merge branch 'fix-opengl-profiling' into 'gtk-3-24'
Fix profiling output when rendering with OpenGL

See merge request GNOME/gtk!1060
2019-08-24 09:52:00 +00:00
Alexander Larsson
e417fa1b7a Fix profiling output when rendering with OpenGL
I was not getting any gtk+ profile markers output from the frame clock
when I was profiling an OpenGL app (gnome-hexgl). I debugged this and
it turns out that the profiling depends on getting the _NET_WM_FRAME_TIMINGS
event from the compositor, and once we switched to OpenGL rendering
this never appeared.

It turns out the reason it didn't is that the compositor only does
so if the client increases the counter tied to the window, and the
x11 gdk code has this optimization where if we do a draw pass
but nothing is actually drawn we don't update the counter.

Unfortunately the detection of whether something was draw or not
is based on some cairo surface hack that breaks when we render with
OpenGL instead. The fix is to just always update the counter if
we're drawing with OpenGL.
2019-08-23 23:18:32 +03:00
Carlos Garnacho
022d0044cc Merge branch 'fix-2070' into 'gtk-3-24'
Fixes incorrect crossing emulation of proximity events in Wayland

See merge request GNOME/gtk!1044
2019-08-21 22:23:10 +00:00
Christoph Reiter
a1c1c788c9 autotools: remove NEED_XIPROTO_H_FOR_XREPLY check
This was added with https://bugzilla.gnome.org/show_bug.cgi?id=148032
to make gtk compile against X11R5, see commit 3b9a31df0

That release is >20 years old now, so we can safely remove it.

The motivation for this is to remove any checks that we don't have in the
meson build.
2019-08-21 20:39:15 +02:00
Julius Lehmann
94960b828f Add slave device option for emulated crossing events under Wayland
This fixes an issue where stylus proximity in/out events emulate enter/leave events.
The emulated events didn't contain the correct slave device and therefore the
resulting device class was set incorrectly. Crossing event emulation now also
works with slave devices.

Closes #2070
Fixes #2070
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2070
2019-08-21 16:23:45 +02:00
Carlos Garnacho
6841c73808 gdk/wayland: Unset clipboard/primary if giving up selection ownership
If gdk_selection_owner_set() is called with a NULL window, we should unset
the related data source for the current selection.
2019-08-20 23:51:04 +02:00
Carlos Garnacho
f43f6900c9 gdk/wayland: Emit GDK_SELECTION_NOTIFY on all failure/unset paths
Either on failure, or when replacing a selection buffer due to a new
wl_offer. We should emit one event for each pending requestor then.
2019-08-20 23:51:04 +02:00
Jonas Ådahl
9dd198e53f gdk/x11: Clamp window size both when creating and resizing
We clamp to 32767 when creating a new X11 GdkWindow due to larger sizes
not being supported, but still try to resize to larger when
gdk_window_resize() is called. Fix this by clamping in both places.

This fixes an issue in mutter where ridiculously sized Java windows
would not show up.
2019-08-06 11:13:55 +02:00
Lionel Landwerlin
6d545b6d03 gdk/wayland: go through monitor to compute scale factor
The current code only goes through the output associated to the
window's wayland surface enter/leave events. That means that to update
the scale factor the window only looks at the outputs on which it
received enter/leave events. That doesn't include a new monitor
connected to the system on which the window might be display next.

The spirit of the existing logic seems to be to go through all the
scale factor available on the current monitors of the system and pick
the highest. So fix the current behavior by looking at the monitor on
the display.

Fixes #1144.

Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2019-08-03 22:36:48 +03:00
Lionel Landwerlin
27b4032680 gdk/wayland: remove unused variable
Signed-off-by: Lionel Landwerlin <llandwerlin@gmail.com>
2019-08-03 22:30:59 +03:00
Matthias Clasen
25dd5d9eb0 Merge branch 'gdkmonitor-x11-manufacturer-stable' into 'gtk-3-24'
gdk: x11: Fill GdkMonitor manufacturer with PNP id from EDID

See merge request GNOME/gtk!848
2019-08-02 12:38:04 +00:00
Carlos Garnacho
a2b9ceaf99 gdk/x11: Store idle ID, and ensure it is eventually unset
This idle happens on mutter around the x11 display being closed, which
has it running after it did actually happen. Ensure the window removes
this idle on dispose.
2019-08-02 12:54:10 +02:00
Olivier Fourdan
ab1e86a3b1 wayland: Add xdg-output v3 support
xdg-output v3 marks xdg-output.done as deprecated and compositors are
not required to send that event anymore.

So if the xdg-output version is 3 or higher, simply set the initial
value `xdg_output_done` to TRUE so we don't wait/expect that event
from the compositor.

https://gitlab.gnome.org/GNOME/gtk/issues/2053
2019-07-26 17:26:05 +02:00
Olivier Fourdan
a393e2ef33 wayland: Update saved size when maximized/fullscreen
If a client issues a `move_resize()` request while the window is
maximized or fullscreen, update the saved size for when it will be
unmaximized/unfullscreened

Related: https://gitlab.gnome.org/GNOME/gtk/issues/1044
2019-07-26 15:51:47 +02:00
Jeremy Tan
ff21730d8e Fix gdkconfig.h generation for GDK_WINDOWING_QUARTZ 2019-07-20 15:10:34 +08:00
James Westman
abaf682870 macOS: Fix GdkScreen::monitors-changed
This signal was not being emitted on macOS, a bug introduced in 941f3c38.
`emit_monitors_changed` was never set to TRUE, so the signal was never
emitted. `emit_monitors_changed` has now been removed, because its
functionality was moved to GdkDisplay.

In addition, kCGDisplayDesktopShapeChangedFlag was removed from the list of
flags that indicate a new/reconfigured monitor, because monitor removals also
include this flag, which caused removed monitors to not be removed from
GdkDisplay.

Fixes #2004.
2019-07-15 15:40:48 -05:00
Priit Laes
50a32b4b99 gdk: x11: Fill GdkMonitor manufacturer with PNP id from EDID
Previously, the manufacturer property of the GdkMonitor was NULL,
and having at least PNP id at GdkMonitor.manufacturer makes it
possible to distinguish between different monitors programmatically.
2019-06-26 12:07:52 +03:00
Christoph Reiter
ecf2c68d97 Merge branch 'gtk3-build-explicit-encoding' into 'gtk-3-24'
build: always use utf-8 when reading/writing text files

See merge request GNOME/gtk!953
2019-06-25 07:27:58 +00:00
Christoph Reiter
5107735c9f build: always use utf-8 when reading/writing text files
open() in text mode should never be used without an encoding because it defaults
to the locale encoding which is rarely what is wanted.

This fixes the Windows build in some cases (depending on the locale/paths used)
2019-06-25 08:53:26 +02:00
John Ralls
3994e75550 Redo the fullscreen MacOS version control to allow building on 10.6
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1686
2019-06-22 14:43:50 -07:00
John Ralls
a26f6d9768 Prevent compile error for pressedMouseButtons when using SDK < 10.6.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1687
2019-06-22 14:30:59 -07:00
Emmanuele Bassi
5b54f86aee Set the monitor's connector under X11
Like we do on Wayland.

In this case, we copy it from the same source as the output name,
because it's going to match.
2019-06-20 22:51:47 +01:00
Emmanuele Bassi
8e08721278 Relay the xdg_output.name to GdkMonitor
The xdg_output interface has a `name` property that reflects the output
name coming from the compositor.

This is the closest thing we can get to a connector name.

Fixes: #1961
2019-06-20 22:51:47 +01:00
Emmanuele Bassi
cdd6fb32c5 Fix regression in GdkScreen.get_monitor_plug_name()
The documentation for get_monitor_plug_name() says that we're returning
the name of the connector for the monitor, but we switched it to using
the model name.
2019-06-20 22:51:47 +01:00
Emmanuele Bassi
af778ec7d0 Add private getter for a monitor connector
The migration from GdkScreen's monitor API to GdkMonitor left out a way
to get the connector's name of a monitor. While there's no real
guarantee that the connector's name is stable, some system components
used it to uniquely identify a monitor until the next plug in/out event.

Since GTK 3 is API stable, we can only add a private setter and getter
functions pair, without a property.
2019-06-20 22:51:47 +01:00
Christoph Reiter
94555371f5 meson: print disabled backends in the final build summary
It's easy to miss what's not getting build otherwise
2019-06-17 17:50:42 +00:00
Matthias Clasen
0872338cf2 wayland: Explicitly require RGBA8888
Its the format we expect to have. If we want to
support 10-bit visuals at some point, that should
be an explicit decision.
2019-06-17 13:04:35 -04:00
Christian Hergert
ef67eb0b3c gdk: backport GdkProfiler
This is a backport of the GdkProfiler from master. It does not include
the pixel bandwidth numbers that come from gdkdrawcontext.c since there
does not seem to be an analog in 3.x.

Additionally, this implements the recent changes for SYsprof's D-Bus
profiler API which adds a Capabilities property and an options hash-table
to the D-Bus interface for forward portability.
2019-06-06 17:17:20 -07:00
Christian Hergert
6033b6457b va_marshaller: add various va_marshallers
We don't need to cover every case with a va_marshaller, but there are a
number of them that are useful because they will often only be connected
to by a single signal handler.

Generally speaking, if I opened into a file to add a va_marshaller, I just
set all of them.
2019-06-01 00:33:32 -07:00
Matthias Clasen
dd25499f1e Merge branch 'overlay-scrolling-for-3' into 'gtk-3-24'
Overlay scrolling for 3

See merge request GNOME/gtk!895
2019-05-31 19:47:00 +00:00
Christian Hergert
0f2b019d89 gtk: rely on default marshallers
Similar to previous removals of g_cclosure_marshal_VOID__VOID we can remove
other marshallers for which are a simple G_TYPE_NONE with single parameter.
In those cases, GLib will setup both a c_marshaller and va_marshaller for
us. Before this commit, we would not get a va_marshaller because the
c_marshaller is set.

Related to GNOME/Initiatives#10
2019-05-31 11:12:29 -07:00
Matthias Clasen
044383fe45 Add a gtk-overlay-scrolling setting
This is in preparation for letting user opt out of
overlay scrolling in the control-center.
2019-05-31 11:54:06 -04:00
Christian Hergert
a8a56e8a0e marshallers: ensure g_cclosure_marshal_VOID__VOIDv is used
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
2019-05-29 13:30:15 -07:00
Matthias Clasen
9b3ac9c946 Merge branch 'mkenums-once-3-24' into 'gtk-3-24'
Use g_once for all the mkenums template files

See merge request GNOME/gtk!866
2019-05-27 09:30:32 +00:00
Olivier Fourdan
034ed1756c wayland: Use scale from core wl_output protocol
The “xdg-output” protocol provides clients with the outputs size and
position in compositor coordinates, and does not provide the output
scale which is already provided by the core “wl_output” protocol.

So when receiving the wl_output scale event, we should update the scale
regardless of “xdg-output” support, otherwise the scale will remain to
its default value of 1 and the surface will be scaled up by the
compositor to match the actual output scale, which causes blurry fonts
and widgets.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1901
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2019-05-22 12:34:11 +02:00
Olivier Fourdan
4ba8971404 Revert "Revert "wayland: Add support for xdg-output""
This reverts commit 8e20c1fac2.
2019-05-22 12:34:11 +02:00
Matthias Clasen
8e20c1fac2 Revert "wayland: Add support for xdg-output"
This reverts commit 1f64689c31.

This was leading to blurry output, and needs more work.

See https://gitlab.gnome.org/GNOME/gtk/issues/1901
2019-05-21 13:25:38 -04:00
Federico Mena Quintero
b565f5d5c2 Use g_once for all the mkenums template files
Without this, initialization of enum/flags values from multithreaded
programs may not work correctly.

Fixes #1617.
2019-05-21 10:46:04 -05:00
Christoph Reiter
6536646720 build: Remove mingw check for SetupDiGetDevicePropertyW
It was mssing when the check was added in 2016, but was fixed upstream
in https://github.com/mirror/mingw-w64/commit/9ef49367378c50553943bd
shortly after.

Assume everyone has updated by now.

See !861 for a related change on the master branch.
2019-05-21 09:18:55 +02:00
John Ralls
4d7d44c717 Replace obsolete GdkScreen-based method of finding the toplevel at point.
With the more current GdkDisplay function.
Also separate the if statements with blank lines.
2019-05-20 14:35:32 -07:00
John Ralls
9c33adf118 Don't call g_object_ref on NULL, it whines.
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1822
2019-05-20 14:35:32 -07:00
Sebastian Dröge
02d4fbe29e GdkWindow - Don't call unimplemented NULL set_startup_id() vfunc on Win32
GdkWindow::set_startup_id() is NULL on Win32 and would cause a segfault
if called.

While the documentation of the main caller of set_startup_id(),
gtk_window_set_startup_id(), mentions that it's not implemented on
Windows it can still be automatically called via Glade and simply doing
nothing on Win32 is going to be less disruptive than a segfault.
2019-05-07 10:04:01 +03:00
Matthias Clasen
fbf88d285e Merge branch 'xdg-output-3-24' into 'gtk-3-24'
[3.24] wayland: Add support for xdg-output

See merge request GNOME/gtk!750
2019-05-01 03:35:19 +00:00
James Westman
b7ec3b163f quartz: Add missing g_object_ref
A g_object_ref() call was missing, sometimes causing crashes during
drag-and-drop operations. The matching g_object_unref() is at
gdk/gdkdnd.c:261.

The logic in this function is still wrong--it finds the wrong GdkWindow under
some circumstances--but this commit fixes the crash.

Part of #1840.
2019-04-22 19:59:14 -05:00