Commit Graph

7602 Commits

Author SHA1 Message Date
Philip Zander
d33c24b31e Win32 IME fixes
See merge request !1063
2019-09-06 20:45:45 +02:00
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
Christoph Reiter
31a57fe389 Drop the mir backend
It depends on libcontent-hub-glib which was dropped from Ubuntu in mid 2017:
https://bugs.launchpad.net/ubuntu/+source/content-hub/+bug/1712874

It was patched downstream to still build until it was disabled at the beginning
of 2018: https://launchpad.net/ubuntu/+source/gtk+3.0/3.22.28-1ubuntu3

This likely means no one has built gtk with mir in 2 years, and there is no plan
to change that, so just remove it.
2019-08-25 22:46:28 +02: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
John Ralls
ef72fe750a Hide Objective-C from outside GdkQuartz.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1737

Don't export any functions taking or returning MacOS types in
gdkquartz.h, gdkprivate-quartz.h, or any header that either includes.

The GdkQuartz internal functions are moved to a new header
gdkinternal-quartz.h, the functions used by quartz-specific
Gtk files are moved to another new header gdkquartz-gtk-only.h, and
the key and event enums to a new header gdkkeys-quartz.h.
2019-06-22 13:37:46 -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
Carlos Garnacho
e9757b9afc gdk/wayland: Listen to wl_surface events on tablet cursors
And update the surface accordingly (eg. scale on hidpi). The mechanism
that did that for wl_pointer has been made generic so it can be shared
with tablets too.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1675
2019-04-18 18:05:19 +02:00
Matthias Clasen
ac739b2a72 wayland: Avoid using uninitialized memory
_gdk_wayland_cursor_get_buffer was not initializing
its out variables in the 'not found' case. This
was showing up in protocol traces as garbage hotspots
being sent to the compositor.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1328
2019-04-18 10:40:09 -04:00
Olivier Fourdan
1f64689c31 wayland: Add support for xdg-output
Previously, the GDK backend for Wayland would deduce the logical size
of the monitors from the wl_output size and scale.

With the addition of fractional scaling which advertises a larger scale
value and then scale down the client surface, the computed logical size
of the monitors in GDK would be wrong and confuse applications which
insist on using the monitor size and position (like Firefox).

The xdg-output protocol aims at describing outputs in a way which is more
in line with the concept of an output on desktop oriented systems by
presenting the outputs using their logical size and position appropriately
transformed.

Add support for the optional xdg-output protocol so that the size and
position of the monitors as reported by GDK is correct even when using
fractional scaling.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1828
2019-04-16 16:14:24 +02:00
Robert Mader
df6ea75a04 gdk/wayland: Use event window to calculate coordinatess for show_window_menu()
The previously used window always was the xdg_toplevel window.
2019-04-14 12:26:45 +02:00
Emmanuele Bassi
a04fef4b9e meson: Preserve compatibility with Autotools build
The Meson build is missing the libtool versioning of the shared
libraries.
2019-04-11 19:33:25 +01:00
Chris Williams
3246d6a738 gdkframeclockidle: Don't permanently skew frame time
Since commit 3b2f9395, the frame time may be set into the future, so
only ensure monotonicity, and don't store the offset. This prevents the
frame time from becoming out of sync with g_get_monotonic_time().

Fixes #1612
2019-04-11 13:25:18 -04:00
Christoph Reiter
5aba13f62d autotools: dist gen-c-array.py and gen-rc.py 2019-04-11 16:46:22 +02:00
Christoph Reiter
068f7f7423 meson: set the soversion to just '0' everywhere
This is what glib did for the meson port, so can't be that wrong.
This also makes the DLL names match the autotools Windows DLLs.
2019-04-11 16:45:37 +02:00
Christoph Reiter
b5a8bd5fe3 meson: Don't depend on meson 0.50
The install arg doesn't add anything here anyway.
2019-04-11 16:45:37 +02:00
Christoph Reiter
d52dad2042 autotools: dist all meson related build files 2019-04-11 16:45:36 +02:00
Christoph Reiter
e41ec3c62e meson: install public broadway headers 2019-04-11 16:45:36 +02:00
Christoph Reiter
b1bc86e905 meson: mkenums: only write basenames in the comments
The autotools build uses relative filenames here while with meson
we get absolute paths. Switch to basename so we get the same result
for both and don't break reproducible builds with absolute paths
in public headers.
2019-04-11 16:45:36 +02:00
Christoph Reiter
59055fd9f7 meson: set interface age; pass soversion to libgdk as well 2019-04-11 16:45:36 +02:00
Christoph Reiter
ca33855793 meson: gdk: add missing pangowin32 dep 2019-04-11 16:45:36 +02:00
Christoph Reiter
74f6832001 meson: add fribidi dep 2019-04-11 16:45:36 +02:00
Chun-wei Fan
c1e40a5fbd meson: Really fix Broadway builds
We must also feed rawinflate.min.js into gen-c-array.py, so that the
windows really show up in the browser when running GTK programs using
broadway.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
6b079afa0a meson: Fix GDK-Win32 build
We have a new source file that we must build,
gdkwin32langnotification.c.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
1cd99d63d1 meson: Build the .rc files on Windows
This will ensure that the version info is easily visible from the
GDK/GTK+ DLLs, and ensure that the print dialogs will have a more modern
look and feel.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
b0a31fefd7 meson: Fix Broadway builds
Make sure the source files are in line with GTK+-3.x Broadway backend
sources.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
4da82356bc meson: Enable GLES Windows builds via libANGLE
Check whether the libepoxy library is built on Windows with support for
GLES.  If so, enable GLES/EGL support on Windows as well.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
ac1f66a35b gdk/meson.build: Force-export gdk_win32_display_manager_get_type()
...on Visual Studio builds, as it seems that the linker is optimizing
that symbol out (hence it is not exported in the DLL).  This is to
ensure that the introspection files for GdkWin32 build.
2019-04-11 16:45:36 +02:00
Chun-wei Fan
2912363104 gdk/meson.build: Fix typo for GdkWin32 Introspection
It is gdk_win32_gir, not gdk_x11_gir...
2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
20c29fd8c0 meson: Fix introspection generation on Linux 2019-04-11 16:45:36 +02:00
Philippe Normand
215c2be76f meson: Set the compatibility version correctly on macOS
And bump to Meson 0.48 as this feature requires it.
2019-04-11 16:45:36 +02:00
Philippe Normand
89d5c543ac meson: Build fixes for macOS 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
a4fe15d9f0 meson: Sync build files with master and update to 3.24 2019-04-11 16:45:27 +02:00
Nirbheek Chauhan
8ec004cc08 Import meson build files from an 3.22
Specifically, from 6dd6660c68
2019-04-11 16:40:33 +02:00
Jan Alexander Steffens (heftig)
2d3936cbe6
Centralize DESKTOP_STARTUP/AUTOSTART_ID handling
Add private API to GDK to move these variables from the environment into
static scope. Also move the DESKTOP_STARTUP_ID validation here to reduce
code duplication.

Use constructors to read them as early as possible; however, do not
unset them until first requested. This avoids breaking gnome-shell and
gnome-settings-daemon, which want to use the DESKTOP_AUTOSTART_ID in
their own gnome-session clients.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1761
2019-04-02 09:14:35 +02:00
Robert Mader
35c4627fac gdk/wayland: Properly calculate coordinates for show_window_menu()
The event received in `gdk_wayland_window_show_window_menu()` can
come from widgets with a GdkWindow. In those cases the coordinates
are relative to the widget, not the root window.
This results in a misplaced window menu.

Properly calculate the coordinates by iterating to the toplevel
window as suggested by Carlos Garnacho.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/684
2019-04-01 11:11:12 +02:00
Christoph Reiter
09e0881a51 gdk/Makefile.am: dist gdkconstructor.h
The file was added in 05bc2f4dc1
2019-03-30 20:03:44 +01:00
Matthias Clasen
e20b7a3a8d Merge branch 'gir-gdkx11-missing-sources' into 'gtk-3-24'
build: Add missing sources for the GdkX11 gir build

See merge request GNOME/gtk!689
2019-03-30 12:28:59 +00:00
Christoph Reiter
15a7a93d10 build: Add missing sources for the GdkX11 gir build
Noticed while diffing .gir files with the meson port.
2019-03-30 11:57:50 +01:00
Christoph Reiter
8034ba4803 build: Include all generated sources for the gdk gir build
The main one is gdkversionmacros.h which resulted in
GDK_MAJOR_VERSION, GDK_MINOR_VERSION and GDK_MICRO_VERSION not being included
in the Gdk-3.0.gir.

Noticed while diffing girs with the meson port.
2019-03-30 11:14:33 +01:00
Philip Chimento
f264e0dbf9 quartz: Update GL context on window resize
The previous version of this patch sent an update message to the
NSOpenGLContext in a GdkGLContext::update vfunc, but that vfunc does not
exist any more.

See: #517
2019-03-29 11:25:29 +01:00
Brion Vibber
f34709807f quartz: implement GdkGLContext for Quartz backend
Current problems:
* other widgets in a GL-painted window are low-resolution on Retina
  display
* something wrong with paint updates; gdkgears demo only updates every
  couple of seconds but reports ~30fps

See: #517
2019-03-29 11:25:29 +01:00
Emmanuele Bassi
ecf3431d3f Merge branch 'gl3-shaders' into 'gtk-3-24'
Use GLSL 3.30 shaders

See merge request GNOME/gtk!671
2019-03-29 09:57:21 +00:00
Emmanuele Bassi
bfcd062e8e Use GLSL 3.30 shaders
We currently ask for anything above 3.2 GL contexts, but we're still
using GLSL 1.50 shaders all over the place. If a GL driver supports GL
3.2+ and GLSL 1.50 only then we'd be in trouble, but the chances of that
happening are really small.
2019-03-27 16:03:43 +00:00
LRN
cddd88064c Merge branch 'ime-load-fix' into 'gtk-3-24'
GDK W32: Test for IME correctly

See merge request GNOME/gtk!658
2019-03-22 15:00:56 +00:00
Руслан Ижбулатов
2e1a55118a GDK W32: Fix property setting to correctly use static strings
The strings that are set are static, so g_value_set_static_string() should
be used to set them instead of g_value_set_string().
2019-03-22 14:52:23 +00:00
Руслан Ижбулатов
3b244c9f11 GDK W32: Test for IME correctly
ImmIsIME() doesn't work (always returns TRUE) since Vista.
Use ITfActiveLanguageProfileNotifySink to detect TSF changes,
which are equal to IME changes for us.

Also make sure that IMMultiContext re-loads the IM when keyboard layout
changes, otherwise there's a subtle bug that could happen:
* Run GTK application with non-IME layout (US, for example)
* Focus on an editable widget (GtkEntry, for example)
* IM Context is initialized to use the simple IM
* Switch to an IME layout (such as Korean)
* Start typing
* Since IME module is not loaded yet, keypresses are handled
  by a default MS IME handler
* Once IME commits a character, GDK will get a WM_KEYDOWN,
  which will trigger a GdkKeyEvent, which will be handled by
  an event filter in IM Context, which will finally re-evaluate
  its status and load IME, and only after that GTK will get
  to handle IME by itself - but by that point input would
  already be broken.
To avoid this we can emit a dummy event (with Void keyval),
which will cause IM Context to load the appropriate module
immediately.
2019-03-22 14:52:18 +00:00
John Ralls
024cb267dd [GdkQuartz] Fix two build issues
1. NSRect and CGRect aren't toll-free bridged in 32 bit builds.
2. NSWindowCollectionBehavior(Dis)AllowTiling is defined beginning in 10.11.
2019-03-21 16:01:51 -07:00
John Ralls
5c039a1aa0 [GdkQuartz] Set the toplevel for the pointer if it's NULL.
Gdk sometimes misses crossing events on popups, so the cached toplevel
may be NULL. If it is, find the toplevel under the pointer and set it.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/623
2019-03-18 13:01:11 -07:00
Carlos Garnacho
ed9a6f755d gdk/wayland: Preserve stored startup id for gtk_surface1.request_focus
The use of the startup ID is now twofold, we reply back with it to end any
corresponding startup notification, but we also use it on
gtk_surface1.request_focus to acknowledge that the activation might raise
the corresponding window.

We should preserve the startup ID for the second to work properly, so avoid
clearing it here. It is inconsequential if the underlying
gtk_shell1.set_startup_id request happens multiple times on no longer existing
startup IDs, so don't bother preventing that from happening.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1754
2019-03-18 12:28:57 +01:00
Matthias Clasen
967c5f7f7f Merge branch 'wip/carlosg/include-constructors-header-3-24' into 'gtk-3-24'
gdk: Include copy of glib/gconstructor.h

See merge request GNOME/gtk!643
2019-03-18 01:09:40 +00:00
Carlos Garnacho
05bc2f4dc1 gdk: Include copy of glib/gconstructor.h
This is named gdkconstructor.h to avoid any possible conflicts. This fixes
the current usages of G_HAS_CONSTRUCTORS, as that header is not installed
by glib.
2019-03-17 21:50:35 +01:00
John Ralls
3a959e984f Force a window resize if the content view frame changes.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1029

Should fix most if not all other cases where system-caused changes to
the NSWindow result in the Gdk coordinates not mapping correctly to the
AppKit coordinates.
2019-03-17 10:15:30 -07:00
John Ralls
0f5603e74f Use n_displays for all monitor counts. 2019-03-11 16:52:07 -07:00