Compare commits

...

776 Commits

Author SHA1 Message Date
Matthias Clasen 8e9c6171b6 3.24.26 2021-02-23 09:31:37 -05:00
Matthias Clasen db1cb04896 imcontext: Take out the warnings
Don't warn about Compose file constructs we don't
support. We haven't supported these for a long time,
and nobody has every complained. No need to wake
up sleeping dogs.
2021-02-22 15:18:25 -05:00
Emin Tufan Çetin 4f81b5cd91 Update Turkish translation 2021-02-21 18:05:31 +00:00
Emin Tufan Çetin f297e9198d Update Turkish translation 2021-02-21 18:02:23 +00:00
Emin Tufan Çetin b56ce02e0c Update Turkish translation 2021-02-21 18:00:49 +00:00
Emin Tufan Çetin aae92380a1 Update Turkish translation 2021-02-21 13:39:39 +00:00
Emmanuele Bassi c06a593b57 Merge branch 'type-int-cairo-format' into 'gtk-3-24'
Use the proper cairo.Format type instead of overriding to gint via annotations...

See merge request GNOME/gtk!3228
2021-02-20 11:49:11 +00:00
Sebastian Dröge ac69c05a31 Use the proper cairo.Format type instead of overriding to gint via annotations in gdk_window_create_similar_surface() 2021-02-20 12:43:53 +02:00
Matthias Clasen bfe201d70a Merge branch 'unintrusive-compose-preedit-3' into 'gtk-3-24'
sUnintrusive compose preedit 3

See merge request GNOME/gtk!3223
2021-02-18 23:55:28 +00:00
Matthias Clasen 1282cac99d imwayland: Be careful about cursor positions
We don't want to hand out cursor positions based on
the original preedit text and then tweak the text to
be different.
2021-02-18 15:44:21 -05:00
Matthias Clasen 784b236964 Merge branch 'unintrusive-compose-preedit-3' into 'gtk-3-24'
Unintrusive compose preedit 3

See merge request GNOME/gtk!3221
2021-02-18 18:41:37 +00:00
Matthias Clasen f8206f18b1 imwayland: Tweak preedit text
Tweak the preedit text we get from IBus (via the compositor) to
match what GtkIMContextSimple produces for Compose sequences now.

This provides a unified experience.
2021-02-18 13:14:31 -05:00
Matthias Clasen 523d5121d3 imcontext: Make Compose preedit less intrusive
Tweak the preedit display for Compose sequences to
be not so distracting. We only show the Compose key
when it occurs in the middle of the sequence or is
the only key so far, and use · instead of ⎄ for it.

Also, make sure to display dead keys more adequately.
2021-02-18 12:38:22 -05:00
Matthias Clasen a048da02d5 Merge branch 'wip/carlosg/font-settings-lookups-3-24' into 'gtk-3-24'
gdk/wayland: Look for font settings recursively (3.24)

See merge request GNOME/gtk!3219
2021-02-18 17:18:19 +00:00
Carlos Garnacho 4d30400987 gdk/wayland: Look for font settings recursively
Use the infrastructure already available to look up keys, instead.
This does the right thing and looks up the setting across all
sources.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3680
2021-02-18 16:51:28 +01:00
Matthias Clasen f56a5ee260 Merge branch 'wip/jimmac/tiled-resize-area-gtk3' into 'gtk-3-24'
Adwaita: control surface for resize tiled windows

See merge request GNOME/gtk!3212
2021-02-17 03:53:55 +00:00
Matthias Clasen 891d4e9da3 Merge branch 'imcontext-modifier-intent' into 'gtk-3-24'
imcontextsimple: Bring back modifier intent

See merge request GNOME/gtk!3213
2021-02-17 03:40:22 +00:00
Matthias Clasen 8780cde919 imcontextsimple: Bring back modifier intent
This was lost by accident in 85d34932f3.
2021-02-16 19:31:17 -05:00
Jakub Steiner 56f6ac5fcc Adwaita: control surface for resize tiled windows
- window resizing control area is implemented as where the shadows are drawn
    - create a 'fake' shadow for the tiled case to allow easier resizing of
      the tiled window ratio even if it's offset to the side of the border

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3670
2021-02-16 14:23:12 +01:00
Matthias Clasen 03b97b0a8b Merge branch 'wip/jimmac/scrollbars-fine-tune-fix-gtk3' into 'gtk-3-24'
Adwaita: Avoid fine-tune scrollbars jumping

See merge request GNOME/gtk!3210
2021-02-16 12:26:13 +00:00
Jakub Steiner 3d30790280 Adwaita: Avoid fine-tune scrollbars jumping
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3672
2021-02-16 11:41:57 +01:00
Charles Monzat 20ecaaa0e1 Update French translation 2021-02-16 08:52:37 +00:00
Matthias Clasen b201438b39 Merge branch 'wip/jimmac/larger-smaller-scrollbar-gtk3' into 'gtk-3-24'
Adwaita: Scrollbar transitions and size

See merge request GNOME/gtk!3205
2021-02-15 18:08:20 +00:00
Carlos Garnacho dca64da1fe Merge branch 'touch-scroll-scale' into 'gtk-3-24'
Add scaling adjustment for touch dragging a scrolled window

See merge request GNOME/gtk!2615
2021-02-15 17:27:26 +00:00
Jakub Steiner ca34428d17 Adwaita: Scrollbar transitions and size
- tone down the size of the controller again
 - transition between the indicator and control fluidly

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1886
2021-02-15 13:45:21 +01:00
Matthias Clasen 5f13ee0afe Merge branch 'lenient-compose-parsing-3' into 'gtk-3-24'
Lenient compose parsing 3

See merge request GNOME/gtk!3202
2021-02-14 20:35:40 +00:00
Matthias Clasen d11cde0c1c imcontext: Be more lenient in parsing Compose
X11 allows keysyms to be specified in addition to strings.
We only support the strings. In the past, we ignored everything
after the string. Go back to doing that, but issue a warning
that we've ignored the keysym.
2021-02-14 13:03:50 -05:00
Matthias Clasen 052b7d0ca7 Merge branch 'fix-compose-comments-for-3' into 'gtk-3-24'
imcontext: Fix a regression in Compose file parsing

See merge request GNOME/gtk!3200
2021-02-14 17:45:22 +00:00
Matthias Clasen 22960c5c20 imcontext: Fix a regression in Compose file parsing
We accidentally dropped the handing of # comments.
Bring it back.

Fixes: #3664
2021-02-14 12:10:09 -05:00
Balázs Meskó d68898a033 Update Hungarian translation 2021-02-14 00:11:21 +00:00
Matthias Clasen 5c6aa76979 3.24.25 2021-02-12 10:45:40 -05:00
Matthias Clasen abefce0961 Fix distcheck 2021-02-12 10:24:27 -05:00
Matthias Clasen 2ca1fe61a4 Merge branch 'frame-request-api' into 'gtk-3-24'
wayland/window: Add API to overwrite surface frame requests

See merge request GNOME/gtk!3111
2021-02-12 12:46:37 +00:00
Robert Mader d3316a37ed wayland/window: Add API to add extra surfaces for frame callbacks
This is useful when clients use subsurfaces independently of GDK.
For example if a client creates a subsurface that covers a GdkWindow
entirely. If this subsurface is opaque, Wayland compositors may not
emit callbacks for the surface of the GdkWindow any more.
Adding the covering subsurface via this new API ensures the
GdkWindow will continue to update in this case.
2021-02-12 13:18:29 +01:00
Matthias Clasen 6fd951e53d Merge branch 'wip/jimmac/tiled-shadow-fix-fix-gtk3' into 'gtk-3-24'
Adwaita: Bring back borders of tiled windows

See merge request GNOME/gtk!3185
2021-02-11 17:03:24 +00:00
Jakub Steiner 35adc7ed04 Adwaita: Bring back borders of tiled windows
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3661
2021-02-11 15:24:59 +01:00
Matthias Clasen 52eb7b23cb Merge branch 'wip/jimmac/fix-maximized-shadows-gtk3' into 'gtk-3-24'
adwaita: disable shadows when window is maximized, fullscreen, tiled

See merge request GNOME/gtk!3179
2021-02-10 19:20:37 +00:00
Jakub Steiner 6f4ebce914 adwaita: disable shadows when window is maximized, fullscreen, tiled
These shadows cause a significant draw performance drop for maximized
windows. Disabling them increases the chances we can have faster scroll
performance of text.

There is some risk here for systems where they have a dock and you expect
the shadow to draw beneath that dock for transparency reasons.
2021-02-10 18:18:10 +01:00
Matthias Clasen 40295441d1 Merge branch 'fix-imcontext-crash' into 'gtk-3-24'
Fix imcontext crash

See merge request GNOME/gtk!3174
2021-02-09 23:37:27 +00:00
Matthias Clasen d2fe033c21 imcontextsimple: Fix a crash
In the backport, I inadvertendly removed the
set_client_window implementation, which needs
to remain.
2021-02-09 18:11:38 -05:00
Matthias Clasen e3c03e98f9 Merge branch 'im-context-work-for-3' into 'gtk-3-24'
imcontext: Backport compose sequence improvements

See merge request GNOME/gtk!3172
2021-02-09 02:00:00 +00:00
Matthias Clasen 85d34932f3 imcontext: Backport compose sequence improvements
Improve compose sequence handling:
- Show preedit for compose seqences
- Support sequences of up to 20 code points
- Warn when ignoring Compose file features
- Support compose sequences producing multiple characters
- Support hex escapes
2021-02-08 20:28:49 -05:00
Matthias Clasen a0818f5bae Merge branch 'gtk-3-24' into 'gtk-3-24'
printing: Create temporary queues for Avahi printers (Gtk 3)

See merge request GNOME/gtk!3161
2021-02-07 16:14:05 +00:00
Marek Kasik de3e97309f printing: Show all Avahi advertised printers
This commit unsubscribes CUPS backend from a DBus
signal in idle when listening for new items on Avahi.

Since GDBus emits gathered signals in idle while
checking whether the signal has been unsubscribed
it could happen that a signal was not processed
because it was removed from hash table of
subscribed signals.
This caused the situation where printers advertised
on Avahi were not listed in CUPS backend sometimes.

We need those signals since this happens when switching
from a general subscription which listens to signals
for all Avahi services to a specific one which listens
to just _ipp._tcp and _ipps._tcp (chicken and egg problem).
2021-02-05 18:57:19 +01:00
Marek Kasik d07bfbec1d printing: Create temporary queues for Avahi printers
This change extends set of Avahi advertised printers which
works with Gtk's CUPS print backend.

It creates a temporary queue (local printer) for each
Avahi printer in CUPS instead of accessing them directly
(via CUPS library).

This makes some printers work which did not work before and
also gives users more options to change in the print dialog.

This also changes naming of printers to be in accordance with CUPS.
It uses '_' instead of '-' and has hostname appended for CUPS remote
printers.
2021-02-05 18:57:19 +01:00
Matthias Clasen 89f3273651 Merge branch 'uac.meson.3' into 'gtk-3-24'
Meson: Avoid UAC on 32-bit Windows for gtk-update-icon-cache

See merge request GNOME/gtk!3147
2021-02-03 15:42:32 +00:00
Chun-wei Fan a612a42c11 Meson: Avoid UAC on 32-bit Windows for gtk-update-icon-cache
As the program executable name has 'update' in its filename,
gtk-update-icon-cache.exe is considered to be an installer program on 32-bit
Windows [1], which will cause the program to fail to run unless it is running
with elevated privileges (i.e. UAC).

Avoid this situation by embedding a manifest file into the final executable
that tells Windows that this is not a program that requires elevation.

Also make the autotools build files dist the new script and use the new script
to generate the manifest and rc files, instead of hardcoding the generating
bits in gtk/Makefile.am

Fixes issue #3632.

[1]: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc709628(v=ws.10)?redirectedfrom=MSDN,
under section "Installer Detection  Technology"
2021-02-03 14:56:07 +08:00
Jonas Ådahl ddb9bae3d4 Merge branch 'gtk-surface-release-3-24' into 'gtk-3-24'
Support gtk-shell surface release destructor

See merge request GNOME/gtk!2074
2021-01-29 16:21:09 +00:00
Matthias Clasen a8c12a4c96 Merge branch 'gtk-3-24' into 'gtk-3-24'
Adds support for Android/Chrome on-screen keyboard

See merge request GNOME/gtk!3130
2021-01-29 00:59:15 +00:00
Maxim Zakharov b31a80cd64 Adds support for Android/Chrome on-screen keyboard
Adds event listener for input events; converts input data into
key press and key release commands depending on inputType of the event.
2021-01-29 11:23:51 +11:00
Matthias Clasen 6748c7116d Merge branch 'wip/jimmac/larger-scrollbars' into 'gtk-3-24'
Adwaita: make scrollbars larger

See merge request GNOME/gtk!3110
2021-01-25 13:42:16 +00:00
Jakub Steiner d13b9f797a Adwaita: make scrollbars larger
When using scrollbars as active controls, rather than their primary role as indicators,
increase their size as click targets.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1886
2021-01-25 14:15:14 +01:00
Fabio Tomat 0b1ca619a7 Update Friulian translation 2021-01-21 06:42:25 +00:00
Bruce Cowan 16ac1a12fc Update British English translation 2021-01-18 20:34:32 +00:00
Jordi Mas 6fee66a9aa Update Catalan translation 2021-01-18 20:51:57 +01:00
Matthias Clasen aec4dc9387 Merge branch 'gtk_dbg_interactive_gtk3_backport' into 'gtk-3-24'
Allow GTK_DEBUG=interactive even without G_ENABLE_DEBUG defined

See merge request GNOME/gtk!3090
2021-01-18 19:41:25 +00:00
vanadiae 0a9e2d6ed7 gtk-debug: Allow interactive debug even without G_ENABLE_DEBUG
Currently when GTK3 is compiled without G_ENABLE_DEBUG, the inspector
can't be opened with GTK_DEBUG=interactive because it doesn't parse
this env var without G_ENABLE_DEBUG.

Since the inspector is always good to have, this commit now always
parses the GTK_DEBUG env var but only keep the "interactive" flag if
G_ENABLE_DEBUG isn't defined.
2021-01-18 18:35:50 +01:00
Марко Костић 395b30dcfe Update Serbian translation 2021-01-16 13:31:17 +00:00
Matthias Clasen 326d101a57 Merge branch 'wip/carlosg/mark-valid-portal-settings-3-24' into 'gtk-3-24'
gdk/wayland: Mark matched settings from the portal as valid (3.24)

See merge request GNOME/gtk!3077
2021-01-14 18:31:57 +00:00
Carlos Garnacho 02a02fac56 gdk/wayland: Mark matched settings from the portal as valid
Commit e6209de962 added some checks on TranslationEntry.valid in
order to figure out whether using the new font settings or the
old g-s-d ones. However that's only set in the non-sandboxed case.

This makes sandboxed applications fallback to the old (and also
non-existing with modern g-s-d) settings, possibly resulting in
ugly defaults being picked.

Fix this by also marking TranslationEntry elements as valid when
using the settings portal, precisely those entries that we are able
to read and match with our own table.
2021-01-14 16:09:27 +01:00
Carlos Garnacho 7ab4c9a68b Merge branch 'fix-tablet-3.24' into 'gtk-3-24'
Wayland: Fix segfault when receiving tablet/touch events for surfaces that have already been destroyed client-side

See merge request GNOME/gtk!2809
2021-01-10 13:18:15 +00:00
wisp3rwind 19a740e277 Wayland: ignore touch/tablet events on destroyed surfaces
When destroying a wl_surface (e.g. when a window or menu is closed), the
surface may continue to exist in the compositor slightly longer than on
the client side. In that case, the surface can still receive input
events, which need to be ignored gracefully.
In particular, this prevents segfaulting on wl_surface_get_user_data()
in that situation.

Reported in
https://gitlab.gnome.org/GNOME/gtk/-/issues/3296

The same issue for pointers/keyboards was reported in
https://bugzilla.gnome.org/show_bug.cgi?id=693338

and fixed with in
bfd7137ffb
3625f17857
a8fc099a72
2021-01-10 12:00:28 +01:00
Carlos Garnacho cae5e60113 Merge branch 'avoid-pointer-reset' into 'gtk-3-24'
wayland: avoid set_cursor() when unchanged or invisible

See merge request GNOME/gtk!2822
2021-01-06 19:53:30 +00:00
Matthias Clasen c87b21351c Merge branch 'workaround-win32-intel-blit' into 'gtk-3-24'
gdkglcontext-win32.c: Workaround Intel glBlitFramebuffer() issues

See merge request GNOME/gtk!2996
2021-01-06 16:13:02 +00:00
Matthias Clasen f25a5f21fc Merge branch 'gtk-3-24' into 'gtk-3-24'
fix touchscreen events processing in broadway.js

See merge request GNOME/gtk!2972
2021-01-06 16:10:08 +00:00
Fran Dieguez bda6c5ec2b Update Galician translation 2021-01-04 23:07:05 +00:00
Fabio Tomat 51cef47835 Update Friulian translation 2020-12-31 10:24:55 +00:00
Chun-wei Fan f8b7bd6dd6 Fix 'make dist' again
The autotools pattern rules can be off-putting...
2020-12-28 22:11:08 +08:00
Źmicier Turok 72b047b084 Update Belarusian translation 2020-12-27 07:29:47 +00:00
Źmicier Turok 72eb09f8e8 Update Belarusian translation 2020-12-27 07:27:34 +00:00
Chun-wei Fan 7647208fba Try again to fix 'make dist'
It turns out that we must put Directory.Build.props in win32/vs10 and let
automake copy it over to win32/vs15/... so do that, and only dist the copy
in win32/vs15.
2020-12-24 18:10:16 +08:00
Chun-wei Fan 8f325b475b win32/Makefile-newvs.am: Fix 'make dist'
We need to account for the lack of Directory.Build.props in win32/vs10...
2020-12-24 17:05:10 +08:00
Chun-wei Fan ac7dd63b02 Visual Studio projects: Support arm64/aarch64 builds better
Update the NMake Makefiles used for generating the various sources be able to
cope with an ARM64 build environment, and update the project files, in
particular for Visual Studio 2017 (VisualStudioVersion 15.0) so that we can
pull in the system .lib's that were somehow excluded from the default list
on ARM64 builds.

Also, add a custom Directory.Build.props in win32/vs15 so that we do not
try to build with the Windows 8.1 SDK by defualt, which is not ready for ARM64
builds, but instead uses the appropriate Windows 10 SDK that supports this.

Update the README.win32 file to give people instructions on how ARM64 builds
can be carried out.
2020-12-24 16:27:58 +08:00
Chun-wei Fan a7b93d62d5 Visual Studio Projects: Improve search for Harfbuzz headers
Look in the include/harfbuzz directory that is under the pre-defined prefix
directory, as Pango 1.44.x and later pulled in HarfBuzz headers for all builds
2020-12-24 13:57:28 +08:00
Chun-wei Fan 985e17772b Visual Studio projects: Do not hardcode gdbus-codegen path
Instead, use the $(GDBUS_CODEGEN) NMake Makefile variable, so that it may be
overridden if needed
2020-12-24 13:48:36 +08:00
Danial Behzadi 856fb75413 Update Persian translation 2020-12-23 15:23:18 +00:00
Emmanuele Bassi 138f104fa4 Merge branch '324.c89' into 'gtk-3-24'
Fix gtk-3-24 builds on older C89-esque compilers

See merge request GNOME/gtk!2995
2020-12-23 13:45:28 +00:00
Chun-wei Fan 79e512ab0b gdkglcontext-win32.c: Workaround Intel glBlitFramebuffer() issues
Intel OpenGL drivers have an issue where the results of a series of
glBlitFramebuffer() can delay updating the display, when we use GDK_GL=always,
which is manifested when attempting to enter text in text boxes.

This attempts to work around this issue by requiring a glFlush() call and a
retry to the same glBlitFramebuffer() calls to avoid delays in keystrokes when
using GDK_GL=always and when not using libANGLE OpenGL/ES emulation, when an
Intel OpenGL driver is being used.

Special thanks to Lukas K. for the analysis and coming up with a workaround,
which this patch builds upon.

Fixes issue 3487
2020-12-23 19:01:31 +08:00
Chun-wei Fan 91343251b9 gtk/fallback-c89.c: Add fallback for fmin()
fmin() is a function that is introduced with C99/C++11, so check for the
presence of it and provide a simple implementation for it if it does not
exist.

Also update the config.h.win32.in template accordingly, since this
function is provided on Visual Studio 2013 or later.
2020-12-23 12:52:19 +08:00
Chun-wei Fan ecd6b0b9a4 gtk/gtkscrolledwindow.c: Declare variables at top-of-block
This way, the code can be built on C89-esque compilers.
2020-12-23 11:24:34 +08:00
Chun-wei Fan de6498f18c Visual Studio: Use G_ENABLE_DEBUG for all builds
This way, we can enable the built binaries to print out diagnostic
messages as needed by the values we set via the envvar GDK_DEBUG.

The release configs of the Visual Studio project files follow the
settings of Meson's `debugoptimized` build settings.
2020-12-23 10:46:58 +08:00
Matthias Clasen f89aeecc4f Merge branch 'cursor-aspect-ratio-gtk3' into 'gtk-3-24'
Cursor aspect ratio fixes for gtk 3

See merge request GNOME/gtk!2965
2020-12-21 19:26:39 +00:00
sicklylife eec24a0982 Update Japanese translation 2020-12-20 08:02:07 +00:00
sicklylife a4ab1cfebe Update Japanese translation 2020-12-20 07:57:27 +00:00
Maxim Zakharov ba845fa7b2 fix touchscreen events processing in broadway.js
Makes event listeners active explicitly if supported; corrects
handling for deleted surfaces preventing javascript errors in
accessing deleted objects; makes event identifiers unique for
broadwayd when executing in Chrome on Android.

Partially fixes #1493
2020-12-18 12:22:47 +11:00
Sebastian Keller 2a89189f1a textview: Use correct aspect ratio when invaldiating cursor
The size of the cursor depends on either the gtk-cursor-aspect-ratio
GtkSetting or as of the previous commit on the GtkSetting or the
cursor-aspect-ratio style property. GtkTextView was only considering the
style property.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Sebastian Keller 0165cce645 stylecontext: Add style property fallback for gtk-cursor-aspect-ratio
The gtk-cursor-aspect-ratio GtkSetting was only recently introduced and
replaced the cursor-aspect-ratio style property. This was causing old
configurations that used CSS to modify this property to no longer apply.
This commit introduces a fallback from the GtkSetting to the style
property if the value of the setting is unchanged.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Sebastian Keller 6c5489ab25 settings: Support loading float values from keyfiles
The gtk-cursor-aspect-ratio property got added as a float property.
However there is no parser for float values from keyfiles which meant
that it could not be changed from settings.ini.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3441
2020-12-16 20:49:39 +01:00
Emmanuele Bassi b933d57632 Merge branch 'pixbuf-from-surface-leak' into 'gtk-3-24'
gdkpixbuf-drawable: Free the pixbuf on Cairo error

See merge request GNOME/gtk!2952
2020-12-14 15:40:12 +00:00
Adrien Plazas c4f8eb7ec9 gdkpixbuf-drawable: Free the pixbuf on Cairo error
This avoids leaking the pixbuf.
2020-12-14 16:18:45 +01:00
Jordi Mas 7208c97c7d Update Catalan translation 2020-12-10 16:06:18 +01:00
Matthias Clasen 69e7ab649c Merge branch 'fix-gtk-nautilus-typo' into 'gtk-3-24'
[Gtk3] GtkNativeDialog: Fix a typo in the docs

See merge request GNOME/gtk!2930
2020-12-08 03:21:26 +00:00
Phaedrus Leeds 59dfeaceff GtkNativeDialog: Fix a typo in the docs 2020-12-07 17:17:39 -08:00
Matthias Clasen de8329b3ce 3.24.24 2020-12-05 19:49:26 -05:00
Emmanuele Bassi 4d410489c5 Merge branch 'notebookpage_child' into 'gtk-3-24'
gtknotebookpageaccessible: do not fallback to child accessible for extents

See merge request GNOME/gtk!2924
2020-12-05 00:03:57 +00:00
Samuel Thibault 4ffe5a4954 gtknotebookpageaccessible: do not fallback to child accessible for extents
When the notebook page does not have a label, it should not fallback to
asking its child accessible for extent, since the child might be asking
exactly the converse when it is a socket, thus getting in an infinite
loop. When the page does not have a label, is does not really make sense to
give it an extent anyway.

Fixes atk#18
2020-12-05 00:34:32 +01:00
Carlos Garnacho 850a086adb Merge branch 'wip/exalm/accumulate-scrolling-backport' into 'gtk-3-24'
scrolledwindow: Accumulate velocity with kinetic scrolling

See merge request GNOME/gtk!2818
2020-12-01 13:14:40 +00:00
Kjartan Maraas 76b7f2704c Update Norwegian Bokmål translation 2020-11-30 14:02:18 +00:00
Daniel Șerbănescu b8af685a43 Update Romanian translation 2020-11-20 09:27:14 +00:00
Milo Casagrande 50c4fbff72 Update Italian translation 2020-11-16 08:50:42 +00:00
Matthias Clasen 0bbe4150a8 Merge branch 'button-fill-var-removal-gtk3' into 'gtk-3-24'
Adwaita: Stop using $button_fill (for gtk-3-24)

See merge request GNOME/gtk!2829
2020-11-15 13:45:57 +00:00
nana-4 6da446c1be Adwaita: Stop using $button_fill
The $button_fill hack for button.circular is pretty awkward and is
currently broken. Instead of relying on it, allow the button() mixin to
have an additional background-image optionally.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3354
2020-11-14 13:21:25 +09:00
Jordi Mas 8f44694d2c Update Catalan translation 2020-11-13 20:24:15 +01:00
wisp3rwind cf7f7df10c wayland: avoid set_cursor() when unchanged or invisible
In pointer_surface_update_scale(), only rescale the cursor surface when
the scale has actually changed and the cursor is on at least one output.

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3350

Right now, this issue is not completely understood, so it might also
involve some questionable handling of cursor surface by sway/wlroots.

However, irrespective of that issue, this patch avoids unnecessary calls to the
compositor, and there should be no drawback: Whenever the pointer enters
a new output, pointer_surface_update_scale() will be called again, such
that correct scaling of the cursor is still ensured.

There is a slight difference: When the cursor leaves the last output,
previously the image was reset to scale factor 1. Now, it keeps whatever
was last. That might be more sensible than the previous behaviour,
assuming that it's likely that when the cursor enter an output again, it
has the same scaling. Alternatively, if one cares about resource usage
at this level, it might make more sense to destroy the surface then
rescaling to 1.
2020-11-13 16:20:02 +01:00
Chris Lord 1d62a010ef scrolledwindow: Accumulate velocity with kinetic scrolling
Accumulate existing velocity when decelerating from a swipe if the swipe
velocity is above a certain fraction of that existing velocity.
2020-11-12 18:56:14 +05:00
Jakub Steiner 46cf2849d2 Merge branch 'wip/jimmac/sass-fixes-and-render-css' into 'gtk-3-24'
Adwaita: !global vars no longer in sass

See merge request GNOME/gtk!2815
2020-11-12 12:26:16 +00:00
Jakub Steiner 811c7f2266 Adwaita: !global vars no longer in sass
- render changes from dab79f5d77
2020-11-12 13:05:45 +01:00
Jakub Steiner a84b41abfd Merge branch 'treeview-header-button-border-css' into 'gtk-3-24'
Highlight treeview header button border with more contrasting color on hover

See merge request GNOME/gtk!2467
2020-11-12 09:23:06 +00:00
crvi dab79f5d77 Adwaita: Make treeview header button borders more visible
The existing treeview header button border in GTK3 is close to
invisible. The preferred way to find the border for a treeview column
is to hover the mouse near the beginning of the header button text
expecting the default cursor to switch to 'col-resize' cursor. This
works only when all column headers in the view are left aligned. After
adding a few numeric columns to the view, whose headers are right
aligned, it becomes really hard to find the location of the border
between a left aligned and right aligned column header.

This change addresses the issue by using high contrast colors for
borders of treeview header button - in line with the colors used in
Adwaita theme in GTK4.

See merge request GNOME/gtk!2467
2020-11-12 01:37:03 +05:30
Matthias Clasen e792e077fa Merge branch 'wip/dont-set-invalid-xdg-surface-geometry' into 'gtk-3-24'
wayland: Bail loudly if invalid geometry is set

See merge request GNOME/gtk!2808
2020-11-11 15:18:27 +00:00
Jonas Ådahl ba31560970 wayland: Bail loudly if invalid geometry is set
There is some bug somewhere where the geometry ends up being correct.
Mutter didn't handle this gracefully, and is to be changed to simply
respect the protocol and error out the client that sends bogus data.

Prepare for this by instead of sending bogus data, complain loudly if it
would happen dropping the invalid geometry on the floor instead of
sending it.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1527
2020-11-11 10:17:59 +01:00
Enrico Nicoletto cfd21b0991 Update Brazilian Portuguese translation 2020-11-10 20:41:12 +00:00
Andika Triwidada ebda6125a4 Update Indonesian translation 2020-11-08 12:07:23 +00:00
Matthias Clasen a1757170da Fix a11y test results
The color palette change is reflected in the a11y dump
for the color chooser.
2020-11-07 22:40:41 -05:00
Matthias Clasen 13f6790fdb expander: Documentation update
Document GtkExpander:label-fill as ignored.

Fixes: #3331
2020-11-07 12:03:46 -05:00
kai-berlin bd4b55ddbf broadway: Set modifier state of scroll events
Set modifier state of scroll events, so Ctrl-scroll
works.

Fixes: #2733
2020-11-03 19:43:21 -05:00
Christian Kirbach 2560af284d Update German translation 2020-11-01 14:02:13 +00:00
Matthias Clasen 0f0dad24f4 Fix the build with older pango
pango_font_family_get_face() was only introduced
in pango 1.46. Work around this for older releases.
2020-10-29 22:22:33 -04:00
Matthias Clasen 9536d3aeaa fontchooser: Fix family-only mode
When the level does not include the style, we only
include one face of each family in the list. But we
were just choosing the first face (typically, a light
or extra-light style). Improve this by picking the
default face (normally, the regular face), which is
the expected behavior.
2020-10-29 21:59:24 -04:00
Asier Sarasua Garmendia 9cfda52d22 Update Basque translation 2020-10-29 20:56:33 +00:00
Matthias Clasen 628d94936a Merge branch 'gtk-3-24' into 'gtk-3-24'
gdk: Fix parent relative background crash

See merge request GNOME/gtk!2753
2020-10-27 21:42:34 +00:00
Sam Bazley a91de44755 gdk: Fix parent relative background crash
When setting a window's background to ParentRelative on X11, the window
depths must match to avoid a BadMatch error. Query the X server for the
parent window rather that relying on the parent passed to
gtk_window_new() to prevent crashes with reparented windows.

Fixes: #3288
2020-10-27 18:29:21 +00:00
Jordi Mas i Hernandez d955636da5 Update Catalan translation 2020-10-22 17:57:33 +00:00
Carlos Garnacho f4c366044b Merge branch 'wip/exalm/swipe' into 'gtk-3-24'
gestureswipe: Count last event when calculating velocity

See merge request GNOME/gtk!2714
2020-10-21 16:58:27 +00:00
Alexander Mikhaylenko 847d378fea gestureswipe: Count last event when calculating velocity
The last event, matching lifting the finger/releasing the mouse button,
is important when there's a large delay between it and the previous events,
as in when performing a movement, stopping, then releasing fingers as
opposed to doing a swipe.

If this event is skipped, doing this will result in kinetic deceleration
matching the previous finger movement, while the expected behavior would
be no deceleration.

See also 97f540622a for a similar fix in
GtkEventControllerScroll.
2020-10-21 20:57:30 +05:00
Goran Vidović fab2558747 Update Croatian translation 2020-10-19 16:36:42 +00:00
Emmanuele Bassi 0ac222fab2 Merge branch 'wip/exalm/screensaver' into 'gtk-3-24'
gtkapplication-dbus: Initialise screensaver-active property

See merge request GNOME/gtk!2716
2020-10-19 10:36:01 +00:00
Bob Ham 6f6b5faaa2 gtkapplication-dbus: Initialise screensaver-active property
When GtkApplication starts listening to the screensaver's D-Bus
status, the screensaver-active property is not initialised and
applications making use of the property are out of sync until the
first state change.  Any application starting when the screensaver is
active will think it's inactive.

To fix this, we set the property when we first start monitoring the
screensaver.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1091
2020-10-19 14:51:19 +05:00
Daniel Mustieles ddb7cab4ac Updated Spanish translation 2020-10-19 09:16:03 +02:00
Matthias Clasen c5d39c3582 Merge branch 'meson-epoxy-subproject' into 'gtk-3-24'
meson: Fix error when epoxy is a subproject on Windows

See merge request GNOME/gtk!2691
2020-10-15 01:22:14 +00:00
Xavier Claessens aeba990793 meson: Fix error when epoxy is a subproject on Windows
epoxy_dep cannot be used in a configure time check when it comes from a
subproject. Use variables set in pc file instead.

This requires https://github.com/anholt/libepoxy/pull/231.
2020-10-14 20:05:05 -04:00
Matej Urbančič a51e5551ba Update Slovenian translation 2020-10-14 21:04:41 +00:00
John Ralls b46f50079b [Mac Keys] Restore command-key bindings.
Lost in transition from gtkrc to css.
2020-10-13 14:36:13 -07:00
John Ralls 715dc780fd [Mac Keybindings] Removed duplicate lines. 2020-10-13 14:36:13 -07:00
John Ralls d0b09a8823 [imquartz] Set the filter key to passthrough regardless of selector.
Remove all of the selectors. They just set the passthrough anyway so
there's not much point to maintaining them and they weren't the
complete set of possible selectors.
2020-10-13 14:36:12 -07:00
Juliano de Souza Camargo 146229bd47 Update Portuguese translation 2020-10-12 16:33:40 +00:00
Emmanuele Bassi 1eee1980ed Merge branch 'file-chooser-docs' into 'gtk-3-24'
gtkfilechooser: Fix open() references in documentation

See merge request GNOME/gtk!2682
2020-10-12 12:26:45 +00:00
Philip Withnall 7072d57d12 gtkfilechooser: Fix open() references in documentation
While it’s true that you can pass the results of
`gtk_file_chooser_get_filename()` straight to `open()` or `fopen()` on
Linux, you can’t do so on Windows as it expects the filename to be in
the ANSI codepage. Using the GLib wrappers `g_open()`/`g_fopen()`
instead means that the appropriate UTF-8 → UTF-16 → `wopen()`/`wfopen()`
conversions are done.

Spotted by Fabian Keßler in
https://gitlab.gnome.org/GNOME/glib/-/issues/2212.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-10-12 12:12:33 +01:00
Emmanuele Bassi 57b0ac9b42 Merge branch 'socketplug' into 'gtk-3-24'
GtkPlug/Socket: add accessibility support

See merge request GNOME/gtk!1147
2020-10-11 16:38:00 +00:00
Aurimas Černius 2e7c6edca8 Updated Lithuanian translation 2020-10-11 17:26:25 +03:00
Charles Monzat 2674a3a9d4 Update French translation 2020-10-11 10:04:31 +00:00
Marek Černocký 8d1a37757d Updated Czech translation 2020-10-10 12:16:58 +02:00
Piotr Drąg 7fd47a81e1 Update Polish translation 2020-10-10 12:13:47 +02:00
Anders Jonsson b7df2c7172 Update Swedish translation 2020-10-08 20:28:18 +00:00
Samuel Thibault 7ee6fb2ec0 GtkPlug/Socket: add accessibility support
When a plug is embedded in a socket, we need to also plug the at-spi
tree, so that screen readers can find the at-spi content of the plugged
widgets.

This change does this plugging automatically: on the plug widget, an
additional _XEMBED_AT_SPI_PATH property is set to provide the at-spi path
(just like we have _XEMBED_INFO for other X11 information), and when
embedding it, the socket reads it, and makes it as its only child.

Since GtkPlugAccessible can not inherit both from AtkPlug (a child of
AtkObject) and from GtkContainerAccessible (a child of AtkObject), we
actually make GtkPlugAccessible a child of an AtkPlug, and that's what
will be embedded (in at-spi terms) into an AtkSocket.

Similarly, GtkSocketAccessible can not inherit both from AtkSocket and
GtkContainerAccessible, so we make it a parent of the AtkSocket that
embeds the AtkPlug.

This change depends on atk 2.35.1 which implements the at-spi technical
details.

This separates out atk-bridge-2.0 dependency, which is not part of atk,
but of at-spi2-atk.
2020-10-08 22:00:21 +02:00
Matthias Clasen b34cfc89e6 Merge branch 'scrollto' into 'gtk-3-24'
Implement ATK's scrollSubstringTo()

See merge request GNOME/gtk!2671
2020-10-08 19:47:34 +00:00
Yuri Chornoivan 40af368523 Update Ukrainian translation 2020-10-08 06:18:32 +00:00
LRN 69b43edd55 Merge branch 'w32-transient-ordering-rollback' into 'gtk-3-24'
GDK W32: transient Z-order rollback

See merge request GNOME/gtk!1769
2020-10-08 05:16:11 +00:00
Sean Farley 8d5357ee56 Allow LPR backend to print PDF and PS file formats
At least from GTK v3.22.30, the code disallows attempts to print PDF and
PS files using the LPR backend. Although it is not easy or possible for
GTK to determine if the printer can print these formats by querying lpr,
the print backend should allow lpr to try.

There are two uses cases:
- A filter is being used by lpr, specified in the printcap file, to process the
  files prior to printing them.
- The printer can print PDF and PS files directly. There are many printers that
  can print these formats, so GTK should allow for the possibility.
2020-10-07 16:53:34 -04:00
Matthias Clasen c91e65ba10 colorchooser: Bring color names back
These are useful for accessibility.
2020-10-07 15:36:23 -04:00
Martin Pieuchot df670047ea Implement ATK's scrollSubstringTo()
This implementation is based on gtk_text_view_scroll_to_iter() and
thus shares its limitations for the sake of simplicity.

A single offset is opportunistically picked to build the iterator
needed for gtk_text_view_scroll_to_iter().  That means that substrings
spanning over multiple lines or larger than the current window might
not be displayed optimally after scrolling.

Partially closes #1625, the toPoint() variant has been discarded.
2020-10-07 20:20:05 +02:00
Matthias Clasen 989b8ef34a Merge branch 'cloudprovider-crash' into 'gtk-3-24'
gtkplacessidebar: Disconnect and unref cloud_manager in dispose

See merge request GNOME/gtk!2669
2020-10-06 22:29:38 +00:00
Jan Alexander Steffens (heftig) d3d9788d71 gtkplacessidebar: Disconnect and unref cloud_manager in dispose
The manager's providers-changed signal can fire after the sidebar has
been freed. Make sure we disconnect the sidebar from the manager.

https://bugs.archlinux.org/task/57984
https://bugs.archlinux.org/task/68123
2020-10-06 23:51:36 +02:00
Matthias Clasen bd2b635b6e Merge branch 'BUG_gtktreeview_headers_focus_on_click_GTK3' into 'gtk-3-24'
GtkTreeviewColumn: don't focus-on-click header buttons

See merge request GNOME/gtk!1805
2020-10-05 18:19:11 +00:00
Matthias Clasen c4c00461fe Merge branch 'issue2780' into 'gtk-3-24'
cssnode: Bail out nicely if there is no settings

See merge request GNOME/gtk!2646
2020-09-30 15:05:52 +00:00
Olivier Fourdan 33059211f4 gtksettings: Avoid a possible NULL pointer dereference
_gtk_settings_get_style_cascade() checks for the given GtkSettings to be
non-NULL, but does so after using the pointer to get the
GtkSettingsPrivate.

Make sure we use the GtkSettings pointer only after the precondition is
verified.

https://gitlab.gnome.org/GNOME/gtk/-/issues/2780
2020-09-30 15:22:15 +02:00
Olivier Fourdan cec7ff1ba7 cssnode: Bail out nicely if there is no settings
On gdk_display_close(), the GtkSettings attached to the display are
freed.

Yet the gtk CSS code may still be called from the widget unparent,
leading to a segfault.

Check if the GtkSettings is not NULL and bail out nicely if not.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2780
2020-09-30 15:22:15 +02:00
Matthias Clasen 88e8a5272e Merge branch 'cursor-docs' into 'gtk-3-24'
gdkcursor: Add annotations for gdk_cursor_new_for_display()

See merge request GNOME/gtk!2640
2020-09-29 13:32:36 +00:00
Philip Withnall 4d5368e56e gdkcursor: Add annotations for gdk_cursor_new_for_display()
It can fail on Wayland, and is also (transfer full).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-09-29 14:05:38 +01:00
Yosef Or Boczko f6e3dfd73e Update Hebrew translation 2020-09-28 19:00:12 +00:00
Yosef Or Boczko 02d1d9714e Update Hebrew translation 2020-09-28 18:58:52 +00:00
Matthias Clasen 0eda000cef Merge branch 'entry-icon-press-event-type-3.24' into 'gtk-3-24'
[3.24] Fix event type annotation on GtkEntry::icon-press / icon-release

See merge request GNOME/gtk!2524
2020-09-28 16:10:49 +00:00
Milo Casagrande 9f04a52b51 Update Italian translation 2020-09-28 07:40:10 +00:00
Jordi Mas f308d2877e Update Catalan translation 2020-09-27 23:41:27 +02:00
Aurimas Černius cbfc2f7443 Updated Lithuanian translation 2020-09-27 22:06:28 +03:00
Matthias Clasen 9a693c7228 Merge branch 'issue2591' into 'gtk-3-24'
gdk/wayland: Add support for primary-selection-unstable-v1

See merge request GNOME/gtk!2627
2020-09-27 14:42:00 +00:00
Robert Mader 5bd8f8c5a3 gdk/wayland: Add support for primary-selection-unstable-v1
Additionally to gtk_primary_selection, the gtk-private predecessor,
support the upstream unstable protocol.

This allows the primary selection to work on Kwin and potentially
other compositors, as well as dropping the private version eventually.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/2591
2020-09-27 13:40:40 +02:00
Matthias Clasen d3cd68f11d scrolledwindow: Fix critical when unsetting scroll cursor
When installing the scroll cursor, add a weak ref to scrolled_window
that clears it if finalised. Unset the weak ref when the uninstalling
the cursor, and when the widget is destroyed.

Patch by Michael James Gratton

Fixes: #749
2020-09-26 20:55:42 -04:00
Juliano de Souza Camargo 96f403d608 Update Portuguese translation 2020-09-26 12:44:34 +00:00
Juliano de Souza Camargo a1ed9d2a4a Update Portuguese translation 2020-09-26 12:41:02 +00:00
Charles Monzat 47d25d8b97 Update French translation 2020-09-25 18:09:47 +00:00
Benjamin Schaaf d4943ef2fb Add scaling adjustment for touch dragging a scrolled window
If a GtkScrollable uses a different scale than pixels the offset from a
drag must be adjusted to match this scale. This fixes issues like this
https://gitlab.gnome.org/GNOME/vte/-/issues/283 where the terminal
widget uses rows instead of pixels as its scale for each GtkAdjustable
thus causing a 1 pixel vertical drag to scroll 1 row.
2020-09-26 03:08:03 +10:00
Matthias Clasen abe4225d9d Merge branch 'wip/jimmac/gtk3-scss-export' into 'gtk-3-24'
HighContrast: render CSS

See merge request GNOME/gtk!2611
2020-09-23 17:01:32 +00:00
Jakub Steiner 8ad9958737 HighContrast: render CSS
- scss was not manually procss, thus things like new public color for
  @text_view_bg were not exported

Fixes https://gitlab.gnome.org/GNOME/vte/-/issues/284
2020-09-23 18:19:45 +02:00
Balázs Meskó 1ec3ed966d Update Hungarian translation 2020-09-23 14:35:33 +00:00
Matthias Clasen 3f5f1ec957 Merge branch '3166-gtk-show-uri-deprecation' into 'gtk-3-24'
gtkshow: Document that gtk_show_uri is deprecated

See merge request GNOME/gtk!2595
2020-09-23 12:19:00 +00:00
Matthias Clasen 045517ae9c Merge branch 'backport-1793' into 'gtk-3-24'
build: clean up .pc generation

See merge request GNOME/gtk!2605
2020-09-23 11:58:17 +00:00
Matthias Clasen c989d87c74 Merge branch 'gtk-3-24-inkscape-1879' into 'gtk-3-24'
gtktreeview: Fix child access after TEST_EXPAND_ROW

See merge request GNOME/gtk!2609
2020-09-23 11:50:49 +00:00
Efstathios Iosifidis 954af8f0bb Update Greek translation 2020-09-22 09:58:03 +00:00
Thomas Holder e35378ba37 gtktreeview: Fix child access after TEST_EXPAND_ROW
In gtk_tree_view_build_tree with recurse=TRUE, the TEST_EXPAND_ROW
signal might invalidate the child iterator. Getting the iterator after
the signal (instead of before) fixes the issue.

Fixes https://gitlab.com/inkscape/inkscape/-/issues/1879
2020-09-22 09:27:29 +02:00
Daniel Mustieles 90b737529d Updated Spanish translation 2020-09-21 08:38:13 +02:00
Marek Černocký 2b73b35981 Updated Czech translation 2020-09-21 08:30:06 +02:00
Jan Tojnar 24f9cc76c0 build: clean up .pc generation
Path concatenation is much nicer than the unwieldy format method.
Since paths returned by get_option are relative to prefix, they will be joined as before.

As a bonus, this fixes weird platforms like NixOS that actually pass absolute includedir under a different prefix.
2020-09-20 13:16:34 -04:00
Emin Tufan Çetin c28e247e87 Update Turkish translation 2020-09-20 06:33:11 +00:00
Kukuh Syafaat 5d9646810f Update Indonesian translation 2020-09-20 03:05:42 +00:00
Baurzhan Muftakhidinov bcc2d455e4 Update Kazakh translation 2020-09-19 12:16:41 +00:00
Bruce Cowan e1fa808a33 Update British English translation 2020-09-19 11:40:17 +00:00
Mario Blättermann e9e8a7b73b Update German translation 2020-09-19 08:29:31 +00:00
Asier Sarasua Garmendia 2f635ad61b Update Basque translation 2020-09-19 07:32:13 +00:00
Fran Dieguez 81f19a011b Update Galician translation 2020-09-18 23:12:43 +00:00
Rafael Fontenelle 041a4c202b Update Brazilian Portuguese translation 2020-09-18 21:08:01 +00:00
Peter Bloomfield ad03ab2ebb gtkshow: Document that gtk_show_uri is deprecated
Due to the deprecation in gtkshow.h, there is proper deprecation warning
for C code. But, for bindings (python in one case), there is no warning,
due to missing "Deprecated:" annotation in gtkshow.c

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3166
2020-09-18 17:00:41 -04:00
Anders Jonsson 8497f07124 Update Swedish translation 2020-09-18 12:50:08 +00:00
Matthias Clasen 0fd8168b3a Merge branch 'cut-finger-3-24' into 'gtk-3-24'
assets: adjust gesture graphic

See merge request GNOME/gtk!2591
2020-09-18 02:34:54 +00:00
Jakub Steiner 059137f714 assets: adjust gesture graphic
- quick, somebody on the internet is offended!

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3074
2020-09-17 21:43:37 -04:00
Matej Urbančič 8d2542c867 Update Slovenian translation 2020-09-17 20:05:48 +00:00
Goran Vidović 1c07a20ca4 Update Croatian translation 2020-09-17 15:38:21 +00:00
Goran Vidović 7284ec12d9 Update Croatian translation 2020-09-17 15:17:47 +00:00
Goran Vidović ea45c02561 Update Croatian translation 2020-09-17 15:02:24 +00:00
Piotr Drąg 4b6ce6b231 Update Polish translation 2020-09-17 16:51:49 +02:00
Yuri Chornoivan 2b983539bb Update Ukrainian translation 2020-09-17 13:33:33 +00:00
Matthias Clasen 268ca8784d Merge branch 'colorchooser-palette-3-24' into 'gtk-3-24'
colorchooser: Backport the new color palette

See merge request GNOME/gtk!2586
2020-09-17 13:24:53 +00:00
Matthias Clasen 8cafaebe8b colorchooser: Backport the new color palette
Add more and better colors to the default color palette.
2020-09-16 18:37:27 -04:00
Stephan Woidowski 0372d98159 Update British English translation 2020-09-15 14:36:15 +00:00
Matthias Clasen 498d513c4b Merge branch 'wip/wayland-dummy-resize-configure' into 'gtk-3-24'
wayland: Emit dummy configure event when resizing while fixed

See merge request GNOME/gtk!2542
2020-09-13 13:14:05 +00:00
Rūdolfs Mazurs d1ea91c650 Update Latvian translation 2020-09-12 08:46:28 +00:00
Rūdolfs Mazurs 9cec4fd7fd Update Latvian translation 2020-09-12 08:43:50 +00:00
Danial Behzadi 84cfbe3491 Update Persian translation 2020-09-08 12:05:43 +00:00
Marek Černocký bdd4cc6661 Updated Czech translation 2020-09-08 10:40:21 +02:00
Милош Поповић d54b622573 Update Serbian translation 2020-09-08 04:51:30 +00:00
Jonas Ådahl a184b5bf51 wayland: Emit dummy configure event when resizing while fixed
When a fixed size is active (e.g. the window is maximized),
gtk_window_resize() shouldn't take immediate effect, so the request was
dropped. This made GTK unhappy if this happened, it will freeze updating
the window until it received the new size it demanded.

Handle this by being nice and emitting a dummy GDK_CONFIGURE event with
the old size where we previously ignored it. It won't resize the window
immediately, so it shouldn't have a visible effect, and the size GTK
requested is still saved away for when the window is unmaximized, but
emitting the event will make GTK receive the event it expects.

We still drop the request on the floor, e.g. if we still haven't seen
the initial configuration, just as we do when actually doing the resize.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2907
2020-09-07 17:57:32 +02:00
Marek Černocký 3d273cc073 Updated Czech translation 2020-09-07 14:33:33 +02:00
Dušan Kazik a04204855d Update Slovak translation 2020-09-07 08:53:29 +00:00
Alexandre Franke 4445dfcbc3 Update French translation 2020-09-06 12:45:18 +00:00
Claude Paroz be5c0a2fe2 Update French translation 2020-09-06 11:25:32 +02:00
Matthias Clasen 016e8c55ab 3.24.23 2020-09-03 18:04:35 -04:00
Fabio Tomat 33829cdec9 Update Friulian translation 2020-09-03 08:52:33 +00:00
Sebastian Dröge ec1a48e830 Fix event type annotation on GtkEntry::icon-press / icon-release
This is not only a GdkEventButton but can also be a GdkEventTouch.
Having this annotation wrong causes bindings code to fail whenever a
wrongly typed event comes through.
2020-09-03 09:36:00 +03:00
Emmanuele Bassi 96fd5a24db Merge branch 'gesture-nullable-sequence-3.24' into 'gtk-3-24'
[3.24] Annotate sequence argument of GtkGesture signals as nullable

See merge request GNOME/gtk!2521
2020-09-02 13:33:05 +00:00
Sebastian Dröge d4868da99c Annotate sequence argument of GtkGesture signals as nullable 2020-09-02 15:29:42 +03:00
Balázs Meskó e85a298528 Update Hungarian translation 2020-09-02 09:39:16 +00:00
Balázs Meskó dfbafa27e7 Update Hungarian translation 2020-09-02 05:44:13 +00:00
Matthias Clasen cd673a95c1 Merge branch 'wip/carlosg/tracker2-fallback' into 'gtk-3-24'
searchengine: Prepare for apps linking to Tracker 2.x

See merge request GNOME/gtk!2513
2020-09-01 13:27:18 +00:00
Asier Sarasua Garmendia b543567c9e Update Basque translation 2020-09-01 12:25:48 +00:00
Carlos Garnacho e2d05f0625 searchengine: Prepare for apps linking to Tracker 2.x
Given it does seem likely Tracker is going to miss the goal to get all
applications ported to Tracker 3, the scenario where there's applications
linking to Tracker 2.x while GTK was built with Tracker 3 support becomes
more likely.

Avoid the upcoming GType clashes if that were the case, and resort to the
good (I lie) old Tracker 2 search engine.
2020-09-01 13:22:12 +02:00
Matthias Clasen 4efd805110 Merge branch 'wip/carlosg/last-device-refcount' into 'gtk-3-24'
gdk: Keep a reference on the last source device

See merge request GNOME/gtk!2510
2020-08-31 14:57:35 +00:00
sicklylife 39fb8d3cec Update Japanese translation 2020-08-31 14:30:16 +00:00
Carlos Garnacho a98001978c gdk: Keep a reference on the last source device
This device may go away, which means we have a pointer to a possibly
stale object. Keep a reference here, and let future events bring this
accounting up-to-date when the mouse pointer is next updated via other
device.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/855
2020-08-31 15:43:54 +02:00
Matthias Clasen d2dd065b95 Merge branch 'fix-resource-leak-in-gdk-display-close' into 'gtk-3-24'
Fix resource leak in gdk_display_close() under Wayland

See merge request GNOME/gtk!2508
2020-08-31 13:04:20 +00:00
Julien Ropé f26c026aaf Fix resource leak in gdk_display_close() under Wayland
When using the gdk_display_close(), the handle to the Wayland compositor was not released.
This could cause the consumption of all available handles, preventing other processes from accessing the display.

Fixing this by calling wl_display_disconnect() when releasing the GdkWaylandDisplay object.

Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-08-31 14:01:38 +02:00
Boyuan Yang bea26415d8 Update Chinese (China) translation 2020-08-29 14:23:05 +00:00
Changwoo Ryu bac71be6bb Update Korean translation 2020-08-29 03:59:09 +00:00
Changwoo Ryu 63127d6902 Update Korean translation 2020-08-29 03:50:42 +00:00
Jiri Grönroos a57047c289 Update Finnish translation 2020-08-28 14:44:11 +00:00
Matthias Clasen 3795d0ad8c Merge branch 'wip/exalm/hotspot-fix-324' into 'gtk-3-24'
wayland: Fix dnd hotspot movement

See merge request GNOME/gtk!2491
2020-08-26 23:48:48 +00:00
Matthias Clasen 4e02e292a6 Merge branch 'wip/carlosg/shuffle-font-mouse-settings-3.24' into 'gtk-3-24'
Look up font and mouse settings in gsettings-desktop-schemas (3.24)

See merge request GNOME/gtk!2490
2020-08-26 23:45:15 +00:00
Alexander Mikhaylenko c67e3f37da wayland: Fix dnd hotspot movement
_gdk_wayland_window_offset_next_wl_buffer() moves the window relatively to
its current position, pass it a delta instead of new position.
2020-08-27 04:02:24 +05:00
Carlos Garnacho b1bbb37154 gdk/wayland: Use double-click/drag-threshold settings from g-d-s
Handle both these settings, and the older settings-daemon ones for
backwards compatibility. The keys are already checked for existence
in the schema, so it will just use the existing ones.
2020-08-27 00:30:51 +02:00
Carlos Garnacho e6209de962 gdk/wayland: Look for font settings in gsettings-desktop-schemas
Prefer this location, but also look for the old location in
settings-daemon for backwards compatibility. This applies to both
direct settings lookups and via the settings portal.
2020-08-27 00:30:38 +02:00
Nathan Follens c2bc13b8b9 Update Dutch translation 2020-08-25 14:41:15 +00:00
Nathan Follens 1b3756869a Update Dutch translation 2020-08-25 14:37:51 +00:00
Juliano Camargo 06396838f9 Update Portuguese translation 2020-08-23 22:49:22 +00:00
Juliano Camargo 448babd29e Update Portuguese translation 2020-08-23 22:47:20 +00:00
Goran Vidović 3352a9d3bc Update Croatian translation 2020-08-23 19:49:17 +00:00
Boyuan Yang 88efe7f853 Update Chinese (China) translation 2020-08-23 14:57:05 +00:00
Matej Urbančič de04aaf82d Updated Slovenian translation 2020-08-20 18:15:24 +02:00
Marek Kasik 963e5dd0c8 printing: Use original names for remote CUPS printers
CUPS uses resource paths in the form of "printers/printer_name"
or "classes/class_name" so it is enough to remove the "printers/"
or "classes/" prefix and use the string behind it as a name.

There was recently introduced a wrong check for the prefix.
This commit fixes it in the way it was originally intended.
2020-08-20 13:55:46 +02:00
Марко Костић 1dcd916c7e Update Serbian translation 2020-08-18 21:04:30 +00:00
Jakub Steiner 3caa5bd4fe Merge branch 'wip/jimmac/error-labels-insensitive-gtk3' into 'gtk-3-24'
Adwaita: error labels insensitive & backdrop states

See merge request GNOME/gtk!2451
2020-08-18 11:04:14 +00:00
Jakub Steiner 6a97b1ff27 Merge branch 'gtk-3-24' into 'wip/jimmac/error-labels-insensitive-gtk3'
# Conflicts:
#   gtk/theme/Adwaita/_common.scss
#   gtk/theme/Adwaita/gtk-contained-dark.css
#   gtk/theme/Adwaita/gtk-contained.css
2020-08-18 10:35:38 +00:00
Jakub Steiner 72513972d7 Adwaita: error labels insensitive & backdrop states
- address colored labels for the two states

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063#note_891618
2020-08-18 12:28:56 +02:00
sicklylife 1ce4f4c514 Update Japanese translation 2020-08-18 10:04:36 +00:00
sicklylife 26f36fcb2a Update Japanese translation 2020-08-18 09:47:32 +00:00
Jakub Steiner e25d5d89d8 Merge branch 'wip/jimmac/error-labels-insensitive-gtk3' into 'gtk-3-24'
Adwaita: error labels insensitive & backdrop states

See merge request GNOME/gtk!2448
2020-08-17 08:39:35 +00:00
Jakub Steiner 629431ba0e Adwaita: error labels insensitive & backdrop states
- address colored labels for the two states

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063#note_891618
2020-08-17 09:57:31 +02:00
Matthias Clasen 653251f69e Merge branch 'wip/jimmac/error-entries-and-labels-gtk3' into 'gtk-3-24'
Adwaita: error labels and entries

See merge request GNOME/gtk!2441
2020-08-15 13:10:30 +00:00
Matthias Clasen ebafe781b4 widget-factory: Backport error state examples
Backport changes from master to introduce error
states in the preference dialog on page 2.
2020-08-15 08:46:03 -04:00
Jakub Steiner 22af449b46 Adwaita: error labels and entries
See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063
2020-08-14 14:17:59 +02:00
Fran Dieguez 007243c151 Update Galician translation 2020-08-12 22:38:12 +00:00
Fran Dieguez 9574f961c3 Update Galician translation 2020-08-12 22:34:36 +00:00
John Ralls 69135bcfe3 Accommodate macOS 11.0 Big Sur in gdk_quartz_osx_version.
This may need to be changed next year, it depends on what Apple
decides to do with version numbers going forward.

Also updated GdkOSXVersion to include Catalina and Big Sur.
2020-08-11 17:08:53 -07:00
Matthias Clasen 0d30d36326 3.24.22 2020-08-10 11:59:46 -04:00
Christian Kirbach cc65c67a0d Update German translation 2020-08-09 18:45:16 +00:00
Jakub Steiner 52b2148b28 Merge branch 'wip/jimmac/vte-bg-color-gtk3' into 'gtk-3-24'
Adwaita: add public color for text views

See merge request GNOME/gtk!2402
2020-08-07 17:33:13 +00:00
Jakub Steiner c09b9904c8 Adwaita: add public color for text views
- define @text_view_bg to complement @theme_text_color for high
  contrast legible text views.

Fixes https://gitlab.gnome.org/GNOME/vte/-/issues/226
2020-08-07 18:55:04 +02:00
Jakub Steiner 2427ebf9ba Adwaita: sass wasn't re-rendered
- particularly the typographic fix c80ac1c05d
2020-08-07 18:53:15 +02:00
Matthias Clasen ccc30804d2 Merge branch 'wip/oholy/gtkmountoperation-newline-gtk-3-24' into 'gtk-3-24'
gtkmountoperation: Drop the new line character when splitting a message

See merge request GNOME/gtk!2400
2020-08-07 13:31:29 +00:00
Matthias Clasen a0e7a231a8 Merge branch 'cherry-pick-267ea755' into 'gtk-3-24'
placesview: Always open default location after mounting

See merge request GNOME/gtk!1288
2020-08-07 13:08:03 +00:00
Ondrej Holy ec1e2fac95 gtkmountoperation: Drop the new line character when splitting a message
When asking for a password, the message string is split on primary
and secondary if it contains a newline character. However, the newline
character is currently part of both strings, which creates weird
spacing between the GtkLabels. I suppose this is bug, which was not
visible as in most cases (if not all) the message string hasn't
contained the new line characters so far. But we are going to change
that now, see GNOME/gvfs!82. Let's drop the new line character similarly
as it is done when asking for a question, or showing processes in order
to fix the weird spacing.
2020-08-07 10:30:13 +02:00
Jordi Mas d5b42f78aa Fixes to Catalan translation 2020-07-26 21:36:12 +02:00
Chun-wei Fan ffe2df7b6a MSVC builds: Make file generating less disrupting
Update the NMake Makefiles to invoke glib-compile-resources with
'start /min' so that when gdk-pixbuf-pixdata, json-glib-format
and xmllint are invoked by glib-compile-resources, cmd.exe windows
will not popup whenever these auxiliary tools are invoked, when one
builds GTK with the Visual Studio projects.

This will reduce the distraction that is caused during the time the
source files are generated, as a popup cmd.exe window will disrupt the
window focus as they appear, and will make the process a bit quicker.
2020-07-25 11:57:04 +08:00
Chun-wei Fan d1dcf88d75 MSVC Projects: Correct generated files paths
This should be more of a cosmetic change, more for the project files,
but let's keep things in good order.
2020-07-25 11:12:21 +08:00
Chun-wei Fan a3ed7a150b README.win32: Update sections on MSVC builds
There are some out-of-date info regarding Visual Studio builds, so let's
make those more up-to-date.
2020-07-25 11:01:17 +08:00
Chun-wei Fan 55f46809de meson/MSVC builds: Use -utf-8 where available
This avoids the build from erroring out on C4819 (Unicode handling issue in
Visual Studio compiler), notably when running on Chinese, Japanese and
Korean locales.
2020-07-24 10:47:35 +08:00
Chun-wei Fan 0cbeee3857 Merge branch 'move-msvc-projects' into 'gtk-3-24'
Visual Studio projects: move projects to win32/

See merge request GNOME/gtk!2248
2020-07-24 02:43:18 +00:00
Chun-wei Fan 2dca4e310d Merge branch 'gtk3.win.egl.unfullscreen' into 'gtk-3-24'
gdkwindow-win32.c: Fix GLES glitches during un-fullscreen

See merge request GNOME/gtk!645
2020-07-24 02:39:25 +00:00
Chun-wei Fan 844555384b Merge branch 'gles-windows-arm64' into 'gtk-3-24'
GDK/Win32: Force GLES if running on ARM64

See merge request GNOME/gtk!827
2020-07-24 02:37:33 +00:00
Chun-wei Fan 522e5d4fa5 Merge branch 'win32-native-input' into 'gtk-3-24'
Use native Windows API for converting keystrokes to characters

See merge request GNOME/gtk!991
2020-07-24 02:27:41 +00:00
Matthias Clasen 63a0e76646 Merge branch 'wip/Jehan/gio-querymodules-pkg-config' into 'gtk-3-24'
build-aux: search various Glib/GIO utilities in .pc file.

See merge request GNOME/gtk!2128
2020-07-23 20:30:03 +00:00
Matthias Clasen 607b859a0b Merge branch 'gdkkeysyms' into 'gtk-3-24'
gdk: update gdkkeysyms.h with ./gdkkeysyms-update.pl script

See merge request GNOME/gtk!2270
2020-07-21 20:53:55 +00:00
Ian Douglas Scott 72d80b8002 gdk: update gdkkeysyms.h with ./gdkkeysyms-update.pl script
There is a default keybinding set with `XF86Keyboard`, but GTK isn't
aware of this keysym. This adds it, as well as a couple others.

See https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/commit/751e44568c73f80097e57ff83952f249468b4e9f
2020-07-21 13:22:04 -07:00
Philip Zander 5b81864211 Fix 2 warnings, formatting 2020-07-16 15:44:08 +02:00
Philip Zander 9bf9c76365 Remove VK_PACKET handling code that has become unnecessary 2020-07-16 15:01:50 +02:00
Philip Zander 5413892b7d Formatting 2020-07-16 15:01:50 +02:00
Philip Zander e6f05da6ef Use native Windows API for converting keystrokes to characters
Instead of using the incomplete GTK-internal emulation, use the WM_CHAR
messages sent by Windows. Make the IME input method the default for all
languages on Windows.
2020-07-16 15:01:47 +02:00
Chun-wei Fan 1feb169bfa Visual Studio projects: move projects to win32/
This will simplify our source tree a bit
2020-07-16 18:57:03 +08:00
Chun-wei Fan dd5fd12343 gtk/gtkfilechoosernativeportal.c: Fix on C89 compilers
Make sure we declare variables at the top of the block-we can't declare
variables in a for loop initilization in this case.
2020-07-16 18:31:37 +08:00
Chun-wei Fan 6f54881851 gtkcssshadowvalue.c: Fix build on older Visual Studio
This code made use of isnan(), which is not provided by pre-2013 Visual
Studio, so fix the build by including fallback-c89.c in place of math.h,
and update fallback-c89.c to include the implementation of isnan() for
Visual Studio, which is copied from the fallback-c89.c in gdk/.
2020-07-16 18:28:06 +08:00
Jonas Ådahl b4d17ebcbe Merge branch 'wl_resize_saved' into 'gtk-3-24'
prefer manually requested size over the configure hint

See merge request GNOME/gtk!1919
2020-07-16 07:50:10 +00:00
Christian Rauch 8e99b3f079 wayland: prefer a manually requested size over the configure hint
When a window receives a resize request, it might ignore this new size and
use the compositor's size hints instead to restore to floating mode.

This commit changes that behaviour in that a window will always prefer
the manually resized dimensions over the compositor's hint.
2020-07-15 16:14:25 +01:00
Matthias Clasen 4da9692061 Merge branch 'wip/jimmac/large-title-letterspacing-gtk3' into 'gtk-3-24'
Adwaita: revert letter-spacing for large-title

See merge request GNOME/gtk!2244
2020-07-14 11:17:12 +00:00
Jakub Steiner c80ac1c05d Adwaita: revert letter-spacing for large-title
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2932
2020-07-14 12:26:45 +02:00
Chun-wei Fan 245c67c8c9 meson.build: Fix generating .pc files for Visual Studio
On Visual Studio, Cairo could have been found manually by looking for the .lib
files, and the previous update to fix this was incorrect, as it added the
libraries to the required packages instead of the required libraries.  This
fixes this mishap
2020-07-14 14:14:26 +08:00
Matthias Clasen b1fe8b5ab4 Merge branch 'wip/sadiq/fix-entry-magnifier' into 'gtk-3-24'
entry: Restrict magnifier popover within the entry size

See merge request GNOME/gtk!2228
2020-07-13 12:15:29 +00:00
Matthias Clasen e363b3a23c Merge branch 'wip/sadiq/fix-textview-select-all' into 'gtk-3-24'
text-view: Fix select-all from touch bubble

See merge request GNOME/gtk!2227
2020-07-13 11:32:08 +00:00
Mohammed Sadiq c5fe16caa6 text-view: Fix select-all from touch bubble
The 'select-all' signal requires a boolean argument to specify
whether to select all or none.  So explicitly pass TRUE to select
all text instead of letting the demons choose one for us.
2020-07-13 16:27:50 +05:30
Mohammed Sadiq cadd794d2c entry: Restrict magnifier popover within the entry size
The magnifier shown with touch input should not go beyond the widget
limits.
2020-07-12 06:37:09 +05:30
Emmanuele Bassi e0da315783 Merge branch 'wip/mbiggio/quartz-device-axes-reset' into 'gtk-3-24'
quartz: mimic source device axes

See merge request GNOME/gtk!2208
2020-07-10 15:48:18 +00:00
Kukuh Syafaat 7733159540 Update Indonesian translation 2020-07-10 12:06:17 +00:00
Milo Casagrande 7a90d4b7c3 Update Italian translation 2020-07-10 07:12:20 +00:00
Matthias Clasen b5f73f1426 Merge branch 'wip/smcv/gtk3-gresource-internal' into 'gtk-3-24'
build: Don't export GResource-related symbols with newer GLib

See merge request GNOME/gtk!2218
2020-07-09 16:26:43 +00:00
Simon McVittie b4d120fcb4 build: Don't export GResource-related symbols with newer GLib
This makes the desired behaviour explicit, and matches the behaviour
seen with Meson, where "external : false" is the default.

Before GNOME/glib!1468, not passing --internal to the resource compiler
meant "no special export attribute, do what you would normally do",
so these symbols were not exported due to our global use of
-fvisibility=hidden.

However, since GNOME/glib!1468, not passing --internal to the resource
compiler results in the symbols being decorated with G_MODULE_EXPORT,
which overrides -fvisibility=hidden. This was necessary because Windows
DLLs normally behave a bit like the equivalent of ELF libraries with
-fvisibility=hidden.

Signed-off-by: Simon McVittie <smcv@debian.org>
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/2919
2020-07-09 16:57:42 +01:00
Matthias Clasen 6ab0addc64 Merge branch 'wip/carlosg/tracker3-dist-fix' into 'gtk-3-24'
autotools: Teach about tracker3 search engine

See merge request GNOME/gtk!2217
2020-07-09 15:37:48 +00:00
Carlos Garnacho b999c8d826 autotools: Teach about tracker3 search engine
Add --enable-tracker3 option (off by default, like in meson) and
hook the tracker3 search engine to build. Also, make sure it's part
of dist.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2912
2020-07-09 17:05:57 +02:00
Emin Tufan Çetin 0ebceebe37 Update Turkish translation 2020-07-09 07:04:08 +00:00
Matthias Clasen 3dd3695ac4 Merge branch 'printing-portal-fix' into 'gtk-3-24'
Printing portal fix

See merge request GNOME/gtk!2210
2020-07-09 03:27:41 +00:00
Casey Jao 6c911248c9 Remember to call print_cb even if print operation is cancelled.
Closes #2917.
2020-07-08 21:51:16 -04:00
Biggio 4b953dee70 quartz: mimic source device axes
Input devices such as stylus pens have additional axes besides (x,y)
coordinates. In order for these devices to work properly, their additional
axes need to be mimicked from the physical device to the associated
virtual pointer when they become active.
2020-07-08 15:26:06 +02:00
Matthias Clasen f8e043b864 Merge branch 'wayland_surface_app_id_changing_3_24' into 'gtk-3-24'
Wayland surface app id changing

See merge request GNOME/gtk!2206
2020-07-07 21:22:03 +00:00
Jordi Mas 19a9718542 Update Catalan translation 2020-07-07 23:16:18 +02:00
Caolán McNamara 2b74662b2b gtk#767 add a way to change the application_id of a toplevel wayland GdkSurface
so LibreOffice can reuse toplevels and get the right task icons

references;
 https://gitlab.gnome.org/GNOME/gtk/-/issues/767
 https://lists.freedesktop.org/archives/wayland-devel/2019-July/040704.html
 https://gitlab.freedesktop.org/wayland/wayland-protocols/commit/e0d6ad1d5e7e80321285a9b14ca3329289eb02e6
 https://bugs.documentfoundation.org/show_bug.cgi?id=125934
 https://bugzilla.redhat.com/show_bug.cgi?id=1334915
 https://bugreports.qt.io/browse/QTBUG-77182
2020-07-07 21:14:21 +01:00
Emmanuele Bassi faa748d4c9 Merge branch 'gtk3-fix-menu-touch' into 'gtk-3-24'
menu: Fix touch support by using pointer emulation under X11

See merge request GNOME/gtk!1794
2020-07-07 15:20:03 +00:00
Chun-wei Fan 98996aa60b GDK/Win32: Force GLES if running on ARM64
If GLES support is enabled on Windows, force GLES mode if we are running
on a ARM64 version of Windows (i.e. Windows 10 for ARM).

This is required as ARM64 versions of Windows only provide a software
implementation of OpenGL 1.1/1.2, which is not enough for our purposes.
Thus, we could make instead use the GLES support provided via Google's
libANGLE (which emulates OpenGL/ES 3 with Direct3D 9/11), so that we
can run GtkGLArea programs under OpenGL/ES in ARM64 versions of Windows.

Note that eventually we could update the libepoxy build files for Windows
to not check nor enable WGL when building for ARM64 Windows, as the WGL
items do not work, although they do build.
2020-07-07 16:53:01 +08:00
Baurzhan Muftakhidinov b8b966ef80 Update Kazakh translation 2020-07-05 11:27:00 +00:00
Emmanuele Bassi 5e50b493ec Merge branch 'protocol' into 'gtk-3-24'
modules/input: don't dist generated protocol sources

See merge request GNOME/gtk!2183
2020-07-02 19:08:28 +00:00
Ross Burton 1bc6f7ef47 modules/input: don't dist generated protocol sources
For some reason modules/input adds the C code that is generated by
wayland-scanner to EXTRA_DIST. This results in a race where depending
on the timestamps of the tarball and the timestamp of the system
wayland-protocols either the generated source in the tarball or a
regenerated source will be used.

This doesn't actually impact the code generated, but it does break
reproducible builds as the list of source files changes.
2020-07-02 19:05:23 +01:00
Matthias Clasen 74ff79ef60 Merge branch 'wip/chergert/fix-gtk3-textview-pixelcache' into 'gtk-3-24'
textview: invalidate pixelcache for some invisible changes

See merge request GNOME/gtk!2171
2020-06-29 22:33:03 +00:00
Christian Hergert 30b2e1e7a3 textview: invalidate pixelcache for some invisible changes
When making changes above the current visible region, we might need to
invalidate the pixelcache as the Y positions will no longer match. This
usually is not needed because changes are made interactively and are made
onscreen.

Other cases, though, can include an application changing the first line
of the buffer automatically. We lose the ability to pixelcache well in
this scenario, but that is unlikely an issue since rapid Y geometry resize
or scrolling is less likely to be occuring. For situations where this is
an issue, you can avoid removing the \n from the buffer so line heights
are uneffected.

Fixes #2882
2020-06-29 15:07:59 -07:00
Carlos Garnacho bf2d6ab5d6 Merge branch 'wip/Jehan/GtkIMContextWayland' into 'gtk-3-24'
modules: add a weak pointer to the GtkIMContextWayland.

See merge request GNOME/gtk!2166
2020-06-29 17:23:09 +00:00
Matthias Clasen 8b5bddcecc Merge branch 'quantize-corner-mask-cache' into 'gtk-3-24'
CSS: Quantization for corner mask cache

See merge request GNOME/gtk!2103
2020-06-29 16:11:34 +00:00
Luca Bacci 18f56ddf53 Limit corner mask cache
Fixes issue #2853
2020-06-29 17:06:28 +02:00
Luca Bacci 8d21c14592 Quantization for corner mask cache
Fixes issue #2853
2020-06-29 17:06:22 +02:00
Daniel Mustieles c68329819a Updated Spanish translation 2020-06-29 16:33:19 +02:00
Daniel Mustieles 1ed30e7394 Updated Spanish translation 2020-06-29 16:02:34 +02:00
Jehan b592ded80a modules: focus out the GtkIMContextWayland upon finalization.
In particular, it will NULL-ified the current global context if this is
the finalized one, avoiding dangling invalid pointers.
2020-06-29 11:02:08 +02:00
Matthias Clasen ab4b85f88c 3.24.21 2020-06-28 17:14:01 -04:00
Aurimas Černius d9b436535a Updated Lithuanian translation 2020-06-28 22:19:24 +03:00
Jehan 8df0c81807 build-aux: fallback to default glib-compile-schemas & gio-querymodules.
The pkg-config variables have been added in GLib 2.62.0. Let's fallback
to default names for these tools in such case (`pkg-config` still
returns a 0 return value, but with empty output for absent variables).
2020-06-28 12:42:14 +02:00
Jehan 87dfcd8152 build-aux: search various Glib/GIO utilities in .pc file.
Some distributions are renaming Glib/GIO utilities for multi-arch
reasons so pkg-config variables have been added to find the correct name
of a tool. GTK+ should use these variables instead of searching in PATH.
See glib#1796.
2020-06-28 12:41:59 +02:00
Rafael Fontenelle badbde5041 Update Brazilian Portuguese translation 2020-06-28 00:13:48 +00:00
Piotr Drąg a3e4481959 Update Polish translation 2020-06-27 12:05:28 +02:00
Baurzhan Muftakhidinov 0b63509d13 Update Kazakh translation 2020-06-26 06:06:35 +00:00
Anders Jonsson c76896dadf Update Swedish translation 2020-06-25 20:12:09 +00:00
Baurzhan Muftakhidinov 09819e75d2 Update Kazakh translation 2020-06-25 06:28:48 +00:00
Daniel Șerbănescu d839742415 Update Romanian translation 2020-06-24 16:06:04 +00:00
Jakub Steiner 1118708976 Merge branch 'adwaita-fix-gtk-3-24' into 'gtk-3-24'
Remove .tile from checkbox style selector

See merge request GNOME/gtk!2018
2020-06-24 12:40:01 +00:00
Yuri Chornoivan da7b0af94b Update Ukrainian translation 2020-06-24 06:12:54 +00:00
Matthias Clasen 40bbcfebcb Merge branch 'cursor-aspect-ratio-for-3' into 'gtk-3-24'
Add a gtk-cursor-aspect-ratio setting

See merge request GNOME/gtk!2144
2020-06-23 21:14:58 +00:00
Matthias Clasen 804ae299a7 Add a gtk-cursor-aspect-ratio setting
Add a setting that controls how thick the text caret is drawn.
This setting replaces a style property that we used to have.
The default value is 0.04.
2020-06-23 16:51:09 -04:00
Matthias Clasen 79762f0be2 Merge branch 'wip/jimmac/notebook-legibility-gtk3' into 'gtk-3-24'
Adwaita: notebook legibility fixes

See merge request GNOME/gtk!2143
2020-06-23 20:48:43 +00:00
Jakub Steiner de348ba984 Adwaita: notebook legibility fixes
- make inactive tabs more legible

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2652
2020-06-23 22:24:57 +02:00
John Ralls 04ed7fe7db [Quartz]Fix some deprecation and unused variable warnings. 2020-06-20 11:16:18 -07:00
John Ralls c6036592c9 [Quartz]Silence type mismatch warning. 2020-06-20 10:20:20 -07:00
John Ralls 3f5cf71039 [Quartz] Correct availability macro name. 2020-06-20 10:06:19 -07:00
John Ralls c884308da3 [Quartz] Only normal toplevels should be in the Windows menu.
The Quartz Window Manager adds to the Windows menu all NSWindows with
titles. Since we assign a default title to all windows that produced a
rather cluttered Windows menu containing among other things dialogs.
Setting aside that dialogs don't belong in the Windows menu, if
a dialog was hidden for reuse instead of destroyed it would persist in
the Windows menu and if clicked there would show, but because it wasn't
running wouldn't respond to events and so couldn't be hidden again and
would remain on top of its parent window.

Ref: https://bugs.gnucash.org/show_bug.cgi?id=797807
2020-06-20 09:49:44 -07:00
John Ralls ae97f04498 Fix symbol deprecation warning. 2020-06-20 09:49:43 -07:00
John Ralls 0e30a96404 Use NSTextInputContext discardMarkedText when MacOS is Lion or later.
NSInput manager has been deprecated since 10.6
2020-06-20 09:49:09 -07:00
Matthias Clasen 114f374623 Merge branch 'gtkapplication-quartz-openfiles-fix' into 'gtk-3-24'
quartz: Gtkapplication-quartz openFiles - inhibit cmdline events

See merge request GNOME/gtk!2110
2020-06-18 20:05:20 +00:00
Friedrich Beckmann 7d9a939f99 quartz: gtk-application - inhibit openFiles events from cmdline
When an application is started via cmdline, then openFiles events
from MacOS are generated although gtkapplication already interprets
the cmdline arguments and opens suitable arguments as files. So they
would be opened twice. Depending on the exact situation the
openFiles event can also be issued before the startup signal
is given. Depending on the application this can result in a crash
due to unexpected behaviour. I took this idea from the
gedit-app-osx.m file. Also from Jesse van den Kieboom.

See:
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2098#note_842975
https://gitlab.gnome.org/GNOME/gtk/-/commit/a3ad7fa80f764fb7bcbe
https://gitlab.gnome.org/GNOME/gedit/-/blob/master/gedit/gedit-app-osx.m#L592
2020-06-18 21:08:28 +02:00
Matthias Clasen a3ad7fa80f Merge branch 'gtk-application-quartz' into 'gtk-3-24'
quartz: Bugfix - Add openFiles delegate to gtk_application (#463)

See merge request GNOME/gtk!2098
2020-06-16 16:41:27 +00:00
Friedrich Beckmann 665f8b6b87 quartz: added open capability to gtk_application
This patch implements the openFiles delegate which is required
to open files which are associated with an application via the
Finder or via open on the command line. The patch has been
proposed by jessevdk@gmail.com.

See: https://gitlab.gnome.org/GNOME/gtk/-/issues/463

I tested the patch with the GNU pspp application on MacOS with
the quartz backend.
2020-06-16 16:59:06 +02:00
Benjamin Otte 947c3e9f72 Merge branch 'benzea/fix-css-update' into 'gtk-3-24'
Fix CSS update loop

See merge request GNOME/gtk!2093
2020-06-15 20:13:56 +00:00
Benjamin Berg 7a5caf1bc0 cssnode: Don't queue_validate/deque_validate invisible nodes
Otherwise setting/unsetting the parrent may cause on an invisible widget
may cause the style to be continuously updated.

Fixes: #2849
2020-06-15 21:31:16 +02:00
Matthias Clasen 3065f47ab5 Merge branch 'michaelweghorn/issue1820_gtkfilechoosernativeportal_get_filter' into 'gtk-3-24'
Make gtk_file_chooser_get_filter work for the portal GtkFileChooserNative (issue #1820)

See merge request GNOME/gtk!1960
2020-06-15 17:52:58 +00:00
Matthias Clasen 46a7ffc336 Merge branch 'michaelweghorn/issue1820_gtkfilechoosernative_get_filter' into 'gtk-3-24'
gtk_file_chooser_get_filter Make gtk_file_chooser_get_filter work for the non-portal GtkFileChooserNative (issue #1820)

See merge request GNOME/gtk!1959
2020-06-15 17:51:36 +00:00
Alexander Larsson 7638bcc8e9 Merge branch 'frame-clock-alternative-approach' into 'gtk-3-24'
Frame clock alternative approach

See merge request GNOME/gtk!1931
2020-06-15 10:49:41 +00:00
Yariv Barkan cf91cf4825 frame clock: fix scheduling
Fix scheduling of the frame clock when we don't receive "frame drawn"
messages from the compositor.

If we received "frame drawn" events recently, then the "smooth frame
time" would be in sync with the vsync time. When we don't receive frame
drawn events, the "smooth frame time" is simply incremented by constant
multiples of the refresh interval. In both cases we can use this smooth
time as the basis for scheduling the next clock cycle.

By only using the "smooth frame time" as a basis we also benefit from
more consistent scheduling cadence. If, for example, we got "frame
drawn" events, then didn't receive them for a few frames, we would still
be in sync when we start receiving these events again.
2020-06-15 08:53:23 +02:00
Yariv Barkan b80bc06b99 frame clock: adjust reported frame time
When an animation is started while the application is idle, that often
happens as a result of some external event. This can be an input event,
an expired timer, data arriving over the network etc. The result is that
the first animation clock cycle could be scheduled at some random time,
as opposed to follow up cycles which are usually scheduled right after a
vsync.

Since the frame time we report to the application is correlated to the
time when the frame clock was scheduled to run, this can result in
uneven times reported in the first few animation frames. In order to fix
that, we measure the phase of the first clock cycle - i.e. the offset
between the first cycle and the preceding vsync. Once we start receiving
"frame drawn" signals, the cadence of the frame clock scheduling becomes
tied to the vsync. In order to maintain the regularity of the reported
frame times, we adjust subsequent reported frame times with the
aforementioned phase.
2020-06-15 08:53:17 +02:00
Asier Sarasua Garmendia 40fc27fd55 Update Basque translation 2020-06-13 20:16:55 +00:00
Asier Sarasua Garmendia 4c98203d91 Update Basque translation 2020-06-13 19:42:21 +00:00
Yuri Chornoivan f1d1d24369 Update Ukrainian translation 2020-06-12 06:36:39 +00:00
Rafael Fontenelle 4e8d8724b6 Update Brazilian Portuguese translation 2020-06-11 15:03:50 +00:00
Matthias Clasen 7df7d6dca7 Merge branch 'builder-parameters-speedup-gtk-3' into 'gtk-3-24'
gtkbuilder: Eliminate array reallocations in get_parameters()

See merge request GNOME/gtk!2072
2020-06-11 11:52:57 +00:00
Sebastian Keller 9459be11a9 wayland: Signal gtk-shell surface destruction to the server
This adds a "release" destructor for the gtk_surface1 interface which
signals to the server that a surface has been destroyed on the client
side, which the current "destroy" does not do.

Ideally the protocol would have specified a destroy request marked as
destructor to handle this automatically, however this is no longer
possible due to the destroy method being implicitly generated in the
absence of an explicit request in the protocol. Adding a destroy request
marked as destructor now would generate a new destroy method that
unconditionally would send the request to the server, which would break
clients running on servers not supporting that request.
2020-06-11 11:38:21 +02:00
Philip Withnall fb998ff52d gtkbuilder: Eliminate array reallocations in get_parameters()
`gtk_builder_get_parameters()` is a hot path, being called twice for
each object in each UI file in an application. The majority of objects
have ≤ 8 properties, which are each filtered into either `parameters` or
`filtered_parameters`.

Unfortunately, both of those arrays are created as empty `GArray`s, and
adding 8 elements to an empty `GArray` hits the worst possible case of
reallocating and `memcpy()`ing the array 3 times. As the array size is
doubled with each reallocation, the cost is not particularly well
amortised when the array size is small.

From the `ObjectInfo`, we actually know how many properties there are in
total, so just allocate the arrays at the right size to begin with.

This saves 7% of the instruction cycles needed to start up
gnome-software to the point where it’s showing its main window,
according to callgrind. gnome-software is making around 5500 calls to
`gtk_builder_get_parameters()`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-06-10 19:59:03 +01:00
Michael Weghorn d59b28d5f4 Make gtk_file_chooser_get_filter work for portal case
This makes 'gtk_file_chooser_get_filter' work for the
portal native file chooser by handling the corresponding
'current_filter' argument in the response retrieved via
D-Bus.

In order to try to map the retrieved 'current_filter' to one
of the existing list of filters, use the retrieved filter's name,
similar to how xdg-desktop-portal-gtk does it when evaluating the
'current_filter' input parameter in 'options'.)

Note: This depends on the following merge/pull requests
which fix the filter handling in gtk for native file choosers
and introduce the 'current_filter' handling for FileChooser portal.

* https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1959
* https://github.com/flatpak/xdg-desktop-portal/pull/493
* https://github.com/flatpak/xdg-desktop-portal-gtk/pull/311

This fixes #1820 for desktop portal case.

Fixes: #1820
2020-06-09 22:52:11 +02:00
Jordi Mas 996e22bde9 Fixes to Catalan translation 2020-06-06 22:59:03 +02:00
Emmanuele Bassi 99472280fb Merge branch 'gtk-3-24-gtk_file_chooser_set_current_name-fix-type' into 'gtk-3-24'
gtk_file_chooser_set_current_name: fix type of name argument

See merge request GNOME/gtk!2044
2020-06-05 11:25:04 +00:00
Thomas Holder 1573ff6803 gtk_file_chooser_set_current_name: fix type of name argument
The description says UTF-8 string, but the annotation said filename.
2020-06-05 12:43:49 +02:00
Yariv Barkan c7c404833f frame clock: schedule in refresh intervals
When the application does not receive "frame drawn" signals we schedule
the clock to run more or less at intervals equal to the last known
refresh interval. In order to minimize clock skew we have to aim for
exact intervals.

(cherry picked from commit f5de46670b)
2020-06-05 11:59:52 +02:00
Alexander Larsson 3466bfdf2d frame clock: Better handle non-regular clock cycles
We try to step the frame clock in whole refresh_interval steps, but to
avoid drift and rounding issues we additionally try to converge it to
be synced to the physical vblank (actually the time we get the
frame-drawn message from the compositor, but these are tied together).

However, the convergence to vsync only really makes sense if the new
frame_time actually is tied to the vsync. It may very well be that
some other kind of event (say a network or mouse event) triggered
the redraw, and not a vsync presentation.

We used to assume that all frames that are close in time (< 4 frames
apart) were regular and thus tied to the vsync, but there is really no
guarantee of that. Even non regular times could be rapid.

This commit changes the code to only do the convergence-to-real-time
if the cause of the clock cycle was a thaw (i.e. last frame drawn and
animating). Paint cycles for any other kind of reason are always
scheduled an integer number of frames after the last cycle that was
caused by a thaw.

(cherry picked from commit 91af8a705b)
2020-06-05 11:50:04 +02:00
Alexander Larsson 87721d0da7 frame clock: Track if paint is caused by thaw or not
When we get to a paint cycle we now know if this was caused by a
thaw, which typically means last frame was drawn, or some other event.

In the first case the time of the cycle is tied to the vblank in some
sense, and in the others it is essentially random. We can use this
information to compute better frame times. (Will be done in later
commits.)

(cherry picked from commit 82c314f1af)
2020-06-05 11:49:56 +02:00
Emmanuele Bassi d60746ae6c Merge branch 'issue-2820' into 'gtk-3-24'
docs: Update the link to the GtkBuilder schema

See merge request GNOME/gtk!2042
2020-06-05 09:46:56 +00:00
Emmanuele Bassi e9c4c80102 docs: Update the link to the GtkBuilder schema
The link to the file is still using the old cgit format, which redirects
to master, where the RNC file is gone.

Fixes: #2820
2020-06-05 10:16:19 +01:00
Alexander Larsson ede4d06192 Fix frameclock going backwards
When we run the frameclock RUN_FLUSH_IDLE idle before the paint,
then gdk_frame_clock_flush_idle() sets
```
  priv->phase = GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT
```
at the end if there is a paint comming.

But, before doing the paint cycle it may handle other X events, and
during that time the phase is set to BEFORE_PAINT. This means that the
current check on whether we're inside a paint is wrong:

```
  if (priv->phase != GDK_FRAME_CLOCK_PHASE_NONE &&
     priv->phase != GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS)
    return priv->smoothed_frame_time_base;
```

This caused us to sometimes use this smoothed_frame_time_base even
though we previously reported a later value during PHASE_NONE, thus
being non-monotonic.

We can't just additionally check for the BEGIN_PAINT phase though,
becasue if we are in the paint loop actually doing that phase we
should use the time base. Instead we check for `!(BEFORE_PAINT &&
in_paint_idle)`.

(cherry picked from commit a36e2bc764)
2020-06-05 11:06:42 +02:00
Matthias Clasen 5762cc0958 Merge branch 'fribidi-include-gtk3' into 'gtk-3-24'
wayland: Remove unused fribidi include

See merge request GNOME/gtk!2038
2020-06-04 19:40:42 +00:00
Sebastian Keller 7998c53396 wayland: Remove unused fribidi include
The included fribidi header is not used in gdkkeys-wayland.c and already
included in gdk.c which causes linker issues due to the header defining
a global variable.
2020-06-04 21:08:20 +02:00
Kjell Ahlstedt 52d944ec44 flowbox: Don't use a removed child after it has been unparented
In gtk_flow_box_remove(), call g_sequence_remove() before the child is unparented.

See MR !2029
2020-06-04 08:24:08 -04:00
Neville 7fd126e2af Adwaita: Remove .tile from checkbox style selector
Currently .tile style is required for the larger blue checkboxes.
The .tile style is removed since it adds unwanted style to elements.
Also the selector to ignore list elements has been modified since
it currently checks for checkboxes that are not lists.
2020-06-03 20:56:39 +05:30
Matej Urbančič e169c35613 Updated Slovenian translation 2020-06-01 22:12:10 +02:00
Christoph Reiter 366374a3a0 CI: switch MSYS2 jobs to 64bit
g-i randomly fails, maybe its a 32bit toolchain issue, so try switching
to 64bit which should be more tested/used nowadays.
2020-06-01 18:09:45 +02:00
Matthias Clasen 92f11144f3 Merge branch 'gtk-3-24' into 'gtk-3-24'
Fix GPtrArray sorting function

See merge request GNOME/gtk!1984
2020-06-01 14:46:14 +00:00
Matthias Clasen 2b96159c9d Merge branch 'wip/exalm/revert-decoration' into 'gtk-3-24'
Adwaita: Revert black decoration background

See merge request GNOME/gtk!1985
2020-05-30 14:41:29 +00:00
Alexander Mikhaylenko 60f69462fc Adwaita: Revert black decoration background
Before I tried this change, I thought it might break apps that do
transparent window background. So I checked a few that did this:
gnome-terminal, tilix, kgx. It worked, so it must work everywhere, right?

However, it just so happens that vte is drawn using CAIRO_OPERATOR_SOURCE
operator rather than CAIRO_OPERATOR_OVER like everything else. This means
that if vte widget is transparent, anything below it, like a black
decoration background, won't be shown.

So really it is still broken, so reverting it.
2020-05-30 15:22:40 +05:00
Tristan Partin 6a507c0b63 Fix GPtrArray sorting function
GPtrArray's GCompareFunc passes a double pointer that needs to be
dereferenced in order to use the data you are actually wanting to
compare.

See: https://developer.gnome.org/glib/stable/glib-Pointer-Arrays.html#g-ptr-array-sort
2020-05-29 15:24:09 -05:00
Alexander Larsson 1a598c32d9 frame-clock: Ensure we're always monotonic
A call to frame gdk_frame_clock_get_frame_time() outside of the paint
cycle could report an un-error-corrected frame time, and later a
corrected value could be earlier than the previously reported value.

We now always store the latest reported time so we can ensure
monotonicity.

(cherry picked from commit a27fed47e0)
2020-05-28 17:48:32 +02:00
Alexander Larsson 687b49c18a frame-clock: New approach in smoothing frame clock
In commit c6901a8b, the frame clock reported time was changed from
simply reporting the time we ran the frame clock cycle to reporting a
smoothed value that increased by the frame interval each time it was
called.

However, this change caused some problems, such as:
 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1415
 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1416
 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1482

I think a lot of this is caused by the fact that we just overwrote the
old frame time with the smoothed, monotonous timestamp, breaking
some things that relied on knowing the actual time something happened.

This is a new approach to doing the smoothing that is more explicit.
The "frame_time" we store is the actual time we ran the update cycle,
and then we separately compute and store the derived smoothed time and
its period, allowing us to easily return a smoothed time at any time
by rounding the time difference to an integer number of frames.

The initial frame_time can be somewhat arbitrary, as it depends on the
first cycle which is not driven by the frame clock. But follow-up
cycles are typically tied to the the compositor sending the drawn
signal. It may happen that the initial frame is exactly in the middle
between two frames where jitter causes us to randomly round in
different directions when rounding to nearest frame. To fix this we
additionally do a quadratic convergence towards the "real" time,
during presentation driven clock cycles (i.e. when the frame times are
small).

(cherry picked from commit 9ef3e70040)
2020-05-28 17:10:14 +02:00
Alexander Larsson ac30f9b4cc frame clock: Use compositor refresh rate info even if presentation time not set
On my X11 + nvidia setup gnome-shell doesn't report presentation times.
However it does report refresh rate. We were mostly using this in our
calculation except when computing predicted presentation time, were
it fell back on the default 60Hz.

(cherry picked from commit f1215d2d77)
2020-05-28 17:05:51 +02:00
Alexander Larsson c03480cbd3 FrameClock debug: Log drawn_time if set
(cherry picked from commit e2a4be0243)
2020-05-28 17:05:38 +02:00
Tim Sabsch e930c7ef64 Update German translation 2020-05-23 21:58:30 +00:00
Michael Weghorn baddc90c26 filechoosernative: Make get_filter work for (non-portal) native chooser
'gtk_file_chooser_get_filter' did not work for GtkFileChooserNative,
since the previous way did not properly handle the delegate dialog,
s.a. commit a136cbae8f
("filechoosernative: forward current_filter to delegate dialog",
2018-11-29) for details, wich basiscally fixed the same thing for
the 'gtk_file_chooser_set_filter' case.

This fixes #1820 for the fallback dialog. A solution for the portal
one (which also requires changes to xdg-desktop-portal and
xdg-desktop-portal-gtk as well) will be suggested in a subsequent step.

Bug: #1820
2020-05-23 14:02:34 +02:00
Jordi Mas 31ae4096b5 Update Catalan translation 2020-05-22 15:28:21 +02:00
Jakub Steiner 1f8c019d1e Merge branch 'theme-linked-button-fixes-gtk3' into 'gtk-3-24'
Adwaita: Fix and simplify the linked buttons styling (GTK3)

See merge request GNOME/gtk!1948
2020-05-22 09:30:16 +00:00
Matthias Clasen aed01a338e Fix the flipping-icons test
Remove icons that no longer have an rtl variant
in Adwaita.

Fixes: #2561
2020-05-21 22:29:28 -04:00
Ondrej Holy cb9b7278d6 trash-monitor: Rate limit updates
Trash monitor queries info from gvfsd-trash after each file monitor
change which can be problematic when too many changes happen in
a short time. Let's rate limit the number of queries...

Fixes: #1010
2020-05-21 21:16:20 -04:00
nana-4 34d85329a9 Adwaita: Fix and simplify the linked buttons styling
- Remove various unnecessary overrides for linked buttons.
- Add missing outline styles to the %linked_vertical ones.
- Consistently use :not(.vertical) instead of :dir(ltr|rtl) for linked
  combo buttons.
- Remove :only-child styling from the messagedialog button. The
  :only-child is equivalent to :first-child:last-child, so we don't need
  the styling there specially.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2752
Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/2549
2020-05-21 00:51:54 +09:00
Ignacio Casal Quinteiro b510de34ea Merge branch 'wip/nacho/macos-pen-input' into 'gtk-3-24'
Support for macOS Pen / Eraser input #1551

See merge request GNOME/gtk!1937
2020-05-20 07:11:14 +00:00
Matthias Clasen 88fc1640ed Merge branch 'BUG_double_popover_focus_filechooser_GTK3' into 'gtk-3-24'
filechooser: set default widget early for 'Rename' popover

See merge request GNOME/gtk!1592
2020-05-19 23:26:56 +00:00
Matthias Clasen 45a5ffd056 Merge branch 'wip/carlosg/tracker3-3-24' into 'gtk-3-24'
(3.24) Add Tracker3 search engine

See merge request GNOME/gtk!1945
2020-05-19 22:38:08 +00:00
Carlos Garnacho df8e6ea32e gtksearchenginetracker3: Pre-fill GFileInfo from query
Provide the minimal info necessary. Improves apparent responsiveness
(since we don't visibly clear and repopulate the list) and saves doing
file stat/reads on every file in the result set.
2020-05-19 22:03:39 +02:00
Carlos Garnacho ae776046fc gtksearchengine: Add tracker3 search engine
Make this dependency optional at build time, and prefer it over
the old tracker <= 2.x implementation.
2020-05-19 22:03:39 +02:00
Carlos Garnacho 5858f7c5bd gtksearchengine: Add autoptr handler for this type
So subclasses can just use G_DECLARE_*_TYPE.
2020-05-19 22:03:20 +02:00
Carlos Garnacho 99031f885e gtksearchengine: Add "got_results" argument to ::finished
The filechooser tries to figure out whether it got results by poking
the model, but all files might go through the async GFileInfo querying
state.

Make all search engines (and the composite one) just notify about this
fact, so the file chooser can behave appropriately without waiting for
the async operations to finish.
2020-05-19 22:03:20 +02:00
Matthias Clasen 85473d942c Merge branch 'source-device-testinput' into 'gtk-3-24'
testinput: we must get the source of the source device

See merge request GNOME/gtk!1938
2020-05-19 15:42:30 +00:00
Ignacio Casal Quinteiro 05df57654f testinput: we must get the source of the source device
The tablet device is the source device of the event. We must use
the source device to properly detect what kind of source we must
use to properly set the color.
2020-05-19 16:42:35 +02:00
Andreas Butti ecbed15d47 Support for macOS Pen / Eraser input #1551
This fix is based on this patch: https://bugzilla.gnome.org/show_bug.cgi?id=695701
2020-05-19 16:10:07 +02:00
LRN 0e8eedee16 Merge branch '324-print-paper' into 'gtk-3-24'
W32: Ensure paper size/orientation is preserved

See merge request GNOME/gtk!695
2020-05-18 08:55:47 +00:00
Yi-Jyun Pan c15eb34792 Update Chinese (Taiwan) translation 2020-05-16 15:19:48 +00:00
Matthias Clasen 5c73b870c1 Merge branch 'wip/carlosg/tablet-disconnects' into 'gtk-3-24'
gdk/wayland: Handle disorderly tablet/pad disconnects

See merge request GNOME/gtk!1909
2020-05-15 19:30:36 +00:00
Carlos Garnacho 948782b7e5 gdk/wayland: Handle disorderly tablet/pad disconnects
If the tablet gets removed/freed while there are pad events in flight,
we leave a dangling pointer from the pad to the tablet, which may
lead to invalid reads/writes when handling the pad event(s).

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2748
2020-05-15 18:47:14 +02:00
Matthias Clasen a94753429c Merge branch 'wip/exalm/kinetic_scrolling_gtk3' into 'gtk-3-24'
eventcontrollerscroll: Fix the history push condition

See merge request GNOME/gtk!1903
2020-05-14 22:41:13 +00:00
Alexander Mikhaylenko 97f540622a eventcontrollerscroll: Fix the history push condition
Once upon a time, there was a function called gdk_event_get_scroll_deltas().
It returned %TRUE when an event had scroll deltas and that was used as the
condition to decide whether to push scroll deltas to the scroll history,
even when the both deltas are 0 for the stop event at the end of scrolling.

When GtkScrolledWindow kinetic scrolling code was adapted for
GtkEventControllerScroll, it was replaced with a (dx != 0 && dy != 0)
check. This prevented the stop event from getting into the history, and
instead allowed non-smooth scrolling to affect the history as they have
synthetic deltas with one of the values being -1 or 1 and the other on 0.

Instead, check the direction as we already have it as a local variable.
2020-05-15 01:37:40 +05:00
Emmanuele Bassi 0efc217dda Merge branch 'gtk-3-24' into 'gtk-3-24'
force redraw in glareawhen buffer_age is 0

See merge request GNOME/gtk!1868
2020-05-14 13:48:41 +00:00
sicklylife 28d6c19135 Update Japanese translation 2020-05-13 15:14:19 +00:00
sicklylife 44d2e6a0f4 Update Japanese translation 2020-05-13 15:09:45 +00:00
Matthias Clasen 4f7c3610d6 Merge branch 'wip/sadiq/entry-select-all' into 'gtk-3-24'
entry: Always show “select-all” button on touch popup

See merge request GNOME/gtk!1857
2020-05-13 15:05:21 +00:00
Emmanuele Bassi 8a60e251f4 Merge branch 'wip/smcv/aboutdialog-licenses' into 'gtk-3-24'
Fix addition of new licenses to GtkLicense

See merge request GNOME/gtk!1876
2020-05-11 18:03:33 +00:00
Simon McVittie 4db3f142d7 aboutdialog: Document the new licenses added in 3.24.20
Originally part of b4c79bad "Assorted documentation fixes" by
Matthias Clasen.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-05-11 18:35:58 +01:00
Simon McVittie 177aeca5a1 aboutdialog: Update precondition checks for new licenses added in 3.24.20
To avoid making this mistake again, add a static assertion that the
enum is in sync with gtk_license_info, and use the length of
gtk_license_info for the precondition check.

Signed-off-by: Simon McVittie <smcv@debian.org>
Resolves: #2734
2020-05-11 18:35:58 +01:00
Alynx Zhou 530f0c0300 Remove platform specific code 2020-05-11 10:13:17 +08:00
Aurimas Černius 9a46b17a8b Updated Lithuanian translation 2020-05-10 22:34:15 +03:00
Rene Hopf 69334021a2 force redraw in glareawhen buffer_age is 0
Reading form the back buffer is not allowed on software renderers,
and this is reported by the buffer age, so reading from GL_BACK
should not be done when the age is 0

Closes #64
2020-05-10 21:21:08 +02:00
Kukuh Syafaat 1906ed0df5 Update Indonesian translation 2020-05-10 14:49:36 +00:00
LRN 625035e214 Merge branch 'gtk-3-24-w32-xsettings-defaults-2' into 'gtk-3-24'
GDK W32: Use SPI_GETFONTSMOOTHINGTYPE instead of SPI_GETCLEARTYPE

See merge request GNOME/gtk!1865
2020-05-10 13:50:48 +00:00
Руслан Ижбулатов f67bad2346 GDK W32: Use SPI_GETFONTSMOOTHINGTYPE instead of SPI_GETCLEARTYPE
It turns out that SPI_GETCLEARTYPE always returns TRUE.

Fixes #1774 (for real this time).
2020-05-10 07:17:50 +00:00
Christoph Reiter 8b9ce87fc7 CI: install brotli in msys2
Not a direct dependency, but the freetype package is missing it atm
2020-05-10 08:31:37 +02:00
Daniel Șerbănescu 628245fbf5 Update Romanian translation 2020-05-09 17:13:51 +00:00
Mohammed Sadiq c823a4d673 entry: Always show 'select-all' button on touch popup
On touch, the popup shown shall contain the 'select-all' button
only if a selection is in progress and if the entry is editable.
Let the button be shown always if selectable so that it’s more helpful.
2020-05-07 18:09:40 +05:30
Milo Casagrande 0ee7d8bc7c Update Italian translation 2020-05-05 12:17:46 +00:00
Peter Mráz adf0cdad05 Update Slovak translation 2020-05-04 08:26:43 +00:00
Matthias Clasen 373dd2a27e Merge branch 'wip/lantw/meson-Check-for-debug-and-optimization-in-the-same-way-as-GTK-4' into 'gtk-3-24'
meson: Check for debug and optimization in the same way as GTK 4

See merge request GNOME/gtk!1818
2020-05-03 14:16:50 +00:00
Ting-Wei Lan 6d9a3e3ade meson: Check for debug and optimization in the same way as GTK 4
This should make it more consistent for people who use both GTK 3 and
GTK 4. It also makes it less likely to accidentally disable debug.
2020-05-03 18:12:57 +08:00
Matthias Clasen 9151187e3e Merge branch 'filechooser-fix-for-3' into 'gtk-3-24'
filechooser: Translate type column

See merge request GNOME/gtk!1817
2020-05-03 00:27:20 +00:00
Matthias Clasen 86b0b80dfa filechooser: Translate type column
When the code for this was copied from nautilus,
we forgot to adapt it for running in a library
instead of an application - gettext() doesn't work
in a library.

Fixes: #2690
2020-05-02 20:07:33 -04:00
Matthias Clasen b59aa9af37 Merge branch 'for-3-24' into 'gtk-3-24'
appchooserdialog: Don't show broken subtitles

See merge request GNOME/gtk!1810
2020-05-01 17:54:09 +00:00
Florian Müllner f28c6d34a7 appchooserdialog: Don't show broken subtitles
Commit 07beb6dba2 made GtkAppChooserWidget useful with no content-type,
however when used in a GtkAppChooserDialog, this will lead to a confusing
"Opening (null) files" subtitle.

Fix this by omitting the subtitle altogether in that case.
2020-05-01 18:22:39 +02:00
Nelson Benítez León 1a9aa675e4 GtkTreeviewColumn: don't focus-on-click header buttons
currently when mouse clicking on a column header
to sort it it is grabbing keyboard focus, this
should not happen, keyboard focus should remain
where it was before. This can be seen on the
GtkFileChooser widget, when having the keyboard
focus on the file list items and clicking on a
column header to sort it the keyboard focus is
now on the header.
2020-04-30 22:30:17 -04:00
Alynx Zhou 721ce22a86 menu: Fix touch support by using pointer emulation under X11
GtkMenu under X11 cannot handle touch events properly,
so just disable touchscreen grabbing for it, which makes
it fallback to pointer emulation.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/945

menu: Fix grab on other backend
2020-04-30 10:16:25 +08:00
Matthias Clasen c3b912722e Merge branch 'win32-new-runner-gtk3' into 'gtk-3-24'
CI: Switch to new Windows runners

See merge request GNOME/gtk!1798
2020-04-29 22:14:33 +00:00
Christoph Reiter 503ec2fdb7 CI: Switch to new Windows runners
They use powershell instead of cmd.exe, use the tag win32-ps instead of win32,
and run Windows 2016 instead of 2012r2.

The old runners will be switched off in the comming weeks.
2020-04-29 20:44:36 +02:00
Matthias Clasen cd78e080b1 Merge branch 'wip/albfan/offscreen-window' into 'gtk-3-24'
Offscreen window reaching driver implementations

See merge request GNOME/gtk!1746
2020-04-28 23:15:06 +00:00
Alberto Fanjul 1e2d72144a Prevent crashes on gdk wayland implementation using offscreen windows 2020-04-28 15:14:53 +02:00
Emmanuele Bassi 0576aff947 Merge branch 'missing-dist' into 'gtk-3-24'
Add check-version.py to the Autotools dist

See merge request GNOME/gtk!1776
2020-04-27 19:40:42 +00:00
Emmanuele Bassi c2f51e1de6 Add check-version.py to the Autotools dist
Otherwise Autotools isn't clever enough to deal with it.
2020-04-27 20:22:14 +01:00
Matthias Clasen 2e2e22a270 Merge branch 'ci-version-check' into 'gtk-3-24'
Keep interface age in sync between Autotools and Meson

See merge request GNOME/gtk!1775
2020-04-27 18:28:45 +00:00
Emmanuele Bassi 00aaba4d5b meson: Sync up the interface age 2020-04-27 18:47:59 +01:00
Emmanuele Bassi c348d78e37 Add interface age to the version check
We have a fourth component of the version tuple that can go out of sync,
so we should check it.
2020-04-27 18:46:56 +01:00
Matthias Clasen db39ce2b16 Bump to 3.24.20
I misplaced the 3.24.19 tag, so try again :(
2020-04-27 10:36:13 -04:00
Matthias Clasen 53a481b01b 3.24.19 2020-04-27 09:33:54 -04:00
Matthias Clasen 521a382d79 HighContrast: regenerate css 2020-04-27 08:47:35 -04:00
Peter Bloomfield 3b5e10ef4d file-system-model: Refactor a helper
Push more common code into the helper for
gtk_file_system_model_query_done() and
gtk_file_system_model_one_query_done().
2020-04-27 08:21:45 -04:00
Peter Bloomfield 326077d2ed file-system-model: Avoid use-after free
This is a possible fix for https://gitlab.gnome.org/GNOME/gtk/-/issues/2657

Use a NULL return from g_file_query_info_finish() to detect cancellation
of the query, and avoid derferencing a stale pointer.
2020-04-27 08:18:48 -04:00
LRN 95fd38426c Merge branch 'gtk-3-24-w32-xsettings-defaults' into 'gtk-3-24'
GDK W32: Correctly infer gtk-xft-antialias & gtk-xft-rgba

See merge request GNOME/gtk!1741
2020-04-26 21:36:00 +00:00
Руслан Ижбулатов 217158995a GDK W32: Correctly infer gtk-xft-antialias & gtk-xft-rgba
Instead of hardcoding gtk-xft-antialias, use SPI_GETFONTSMOOTHING to
determine whether antialiasing is enabled.

Make gtk-xft-rgba query more complex - try to determine display
orientation, then use that to rotate subpixel structure. This
won't help with monitors that have naturally vertical subpixels,
but should improve things for monitors that are rotated (as long
as Windows display settings are adjusted accordingly).

Partially fixes #1774
2020-04-26 20:40:57 +00:00
Руслан Ижбулатов 00f06f2480 GDK W32: Remove stacking functions
Stacking functions enforce non-native stacking behaviour that is
mostly unneeded, and doing so introduces bugs and complicates things.
2020-04-26 19:16:02 +00:00
Руслан Ижбулатов 83ebdbdbf4 Revert "GDK W32: Use SWP_NOOWNERZORDER everywhere it can be applied"
This reverts commit fc2008f240.

Turns out, we *don't* have code to maintain Z-order. Restacking
code is not doint that, it just enforces a few weird Z-order-related
behaviours.
2020-04-26 19:11:45 +00:00
Matthias Clasen e6e86176dc Merge branch 'fix-signature-mismatch' into 'gtk-3-24'
Fix small oversight in function definition signature

See merge request GNOME/gtk!1751
2020-04-23 18:05:09 +00:00
Luca Bacci 1697be5e44 Fix function signature 2020-04-23 19:21:36 +02:00
Jakub Steiner be159ab93c Merge branch 'wip/exalm/solid-csd' into 'gtk-3-24'
theme: Fix decoration background

See merge request GNOME/gtk!1742
2020-04-23 14:26:32 +00:00
Alexander Mikhaylenko d46aa9f49e theme: Fix decoration background
'window' is not the only toplevel css name, there are also 'dialog' etc.

Move it before .solid-csd style so that .solid-csd background takes
precedence.
2020-04-23 19:06:33 +05:00
Jakub Steiner e12747870b Merge branch 'wip/jimmac/gtk3-public-hc-colors' into 'gtk-3-24'
HC: export public colors

See merge request GNOME/gtk!1749
2020-04-23 12:42:16 +00:00
Jakub Steiner 16b4ae8486 HC: export public colors
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2641 and
https://gitlab.gnome.org/GNOME/gtk/-/issues/2650
2020-04-23 14:24:46 +02:00
Jakub Steiner 1f9f370346 Merge branch 'wip/jimmac/gtk3-uniform-checkboxes' into 'gtk-3-24'
Wip/jimmac/gtk3 uniform checkboxes

See merge request GNOME/gtk!1748
2020-04-23 12:13:53 +00:00
Jakub Steiner 30906f3240 Adwaita: lower glyph contrast for checkboxes
- stylistic choice didn't sit well with majority of the design team
2020-04-23 13:57:58 +02:00
Emin Tufan Çetin 35b9677006 Update Turkish translation 2020-04-21 10:58:14 +00:00
Guillaume Bernard 8f7f6bffbc Update French translation 2020-04-20 20:56:21 +00:00
Rafael Fontenelle fc3bb14b82 Update Brazilian Portuguese translation 2020-04-20 20:47:19 +00:00
Daniel Mustieles d36da44f2b Updated Spanish translation 2020-04-20 15:54:29 +02:00
Emmanuele Bassi 95ea8fd932 Merge branch 'ci-version-check' into 'gtk-3-24'
Add check on build system version

See merge request GNOME/gtk!1723
2020-04-19 18:33:13 +00:00
Emmanuele Bassi 93faac9d8e Add check on build system version
Since we're shipping both Meson and Autotools build systems for GTK3,
and both of them have a version field, it's bound to happen that the
GTK version defined in either build systems will go out of sync.

Let's add a check in both builds so that something will fail before
doing a release in case the versions do not match.
2020-04-19 18:47:57 +01:00
Matthias Clasen bcf08abef0 meson: bump version 2020-04-19 09:29:54 -04:00
Anders Jonsson 15d71079fe Update Swedish translation 2020-04-18 20:47:01 +00:00
Matthias Clasen 01ca0d2f53 Merge branch 'BUG_sibebarplaces_avoid_click_focus_GTK3' into 'gtk-3-24'
GtkPlacesSidebar: avoid location clicks to grab focus

See merge request GNOME/gtk!1714
2020-04-18 19:51:38 +00:00
Nelson Benítez León 7c343a87d1 GtkPlacesSidebar: avoid location clicks to grab focus
Sibebar location rows should not grab focus on click.

Fixes filechooser issue #1469
2020-04-18 14:38:47 -04:00
Piotr Drąg 74a630321b Update Polish translation 2020-04-18 16:32:59 +02:00
Goran Vidović a79c1f40c6 Update Croatian translation 2020-04-18 13:06:25 +00:00
Dz Chen 609fb27e11 Update Chinese (China) translation 2020-04-18 09:09:08 +00:00
Yuri Chornoivan d78d8b245f Update Ukrainian translation 2020-04-18 04:57:48 +00:00
Emmanuele Bassi 633f0fa52a Merge branch 'jjardon/3_24_more_licenses' into 'gtk-3-24'
3.24: gtk/gtkaboutdialog: Add some more very common licenses:

See merge request GNOME/gtk!1672
2020-04-17 21:50:45 +00:00
Matthias Clasen 3483a3e134 Merge branch 'BUG_filechooser_async_data_loss_GTK3' into 'gtk-3-24'
GtkFilechooserWidget: prevent oblivious selection of file

See merge request GNOME/gtk!1682
2020-04-17 20:30:07 +00:00
Matthias Clasen 27d7f55aba Merge branch 'macos-esc-fix' into 'gtk-3-24'
Fix quartz input method filtering Esc keypress

See merge request GNOME/gtk!1696
2020-04-15 23:04:04 +00:00
Matt Rose 3236c09d7d Fix quartz input method filtering Esc keypress 2020-04-15 16:48:02 -04:00
Charles Monzat 98918b689e Update French translation 2020-04-15 14:04:04 +00:00
Jiri Grönroos 25c2b8693a Update Finnish translation 2020-04-15 13:57:10 +00:00
Matthias Clasen 0459569b49 Avoid a critical in the Emoji chooser
If event_widget is NULL, just dismiss the popover.

https://gitlab.gnome.org/GNOME/gtk/-/issues/2199
2020-04-14 15:37:59 -04:00
Emin Tufan Çetin 5c7fca7405 Update Turkish translation 2020-04-14 16:06:31 +00:00
Daniel Mustieles 9ea19ea9b0 Updated Spanish translation 2020-04-14 12:46:09 +02:00
Nelson Benítez León e6ff990145 GtkFilechooserWidget: prevent oblivious selection of file
which could happen after confirming the "file overwrite"
dialog and may result in a different file being overwritten
causing data loss.

The oblivious file selection can be done by a mouse
click or keyboard press sent inadvertently just after
confirming the "file overwrite" dialog.

Fixed by adding a flag to ignore any button/key press
events sent to the file list. We set this flag just
after the user accepts the "file overwrite" dialog,
which means the enclosing GtkfilechooserDialog is about
to get closed. And we restablish the flag when the dialog
is shown again (in its map() handler).

Fixes data loss issue #2288
2020-04-13 16:33:10 -04:00
Aurimas Černius c8d058137a Updated Lithuanian translation 2020-04-13 22:41:19 +03:00
Anders Jonsson 48088579d8 Update Swedish translation 2020-04-13 18:40:02 +00:00
Matthias Clasen 7360d470c9 Merge branch 'gtk-3-24' into 'gtk-3-24'
Remove the blacklist list in convert-emoji.c since now it is supported

See merge request GNOME/gtk!1681
2020-04-13 15:27:40 +00:00
Mathieu H 73737bcc4f Remove the blacklist list in convert-emoji.c since now it is supported 2020-04-13 15:27:40 +00:00
Yuri Chornoivan dea11781a5 Update Ukrainian translation 2020-04-13 05:28:06 +00:00
Matthias Clasen e51cfe2349 Merge branch 'window-set-focus-docstring-fix' into 'gtk-3-24'
window: Fix docstring formatting on 'set-focus' signal

See merge request GNOME/gtk!1677
2020-04-12 22:50:07 +00:00
Collin May d536fa5aa4 window: Fix docstring formatting on 'set-focus' signal
This comment was added in 93bcca7f02 but missed a
colon so it never actually generated documentation and the nullable annotation
never made it into GObject-introspection language bindings.

This crude regex does not catch any other instances of this mistake. The @
symbol is used to disambiguate signal doc comments from property doc comments,
since property docs usually don't have parameters.

$ pcre2grep -rM '\\* [A-Z][A-Za-z]*:([a-z\-]*):\n +\* @' gtk/
2020-04-12 15:09:54 -07:00
Matthias Clasen 476afca97d Merge branch 'fix-issue-2604' into 'gtk-3-24'
Fix message dialog not shown when the user tries to create a folder but a file...

See merge request GNOME/gtk!1676
2020-04-12 18:31:09 +00:00
Luca Bacci 0352d88b8a Fix message dialog not shown when the user tries to create a folder but a file with the same name exists
Fixes issue #2604
2020-04-12 15:05:18 +02:00
Javier Jardón adc2f4ad9e 3.24: gtk/gtkaboutdialog: Add some more very common licenses:
- BSD 3-Clause "New" or "Revised" license
- Apache License 2.0
- Mozilla Public License 2.0
2020-04-12 13:11:22 +01:00
sicklylife 15737d7a94 Update Japanese translation 2020-04-12 08:51:04 +00:00
sicklylife a1f43f53b4 Update Japanese translation 2020-04-12 08:42:56 +00:00
Matthias Clasen a2b101ba5b Merge branch 'fno-common-3-24' into 'gtk-3-24'
Add a missing extern, to fix building with -fno-common (3.24 branch)

See merge request GNOME/gtk!1632
2020-04-11 15:16:55 +00:00
Matthias Clasen f9decb0cd6 3.24.18 2020-04-09 18:33:59 -04:00
Emmanuele Bassi 85389c4bcf Merge branch 'docs-urls' into 'gtk-3-24'
docs: Update the links in the FAQ

See merge request GNOME/gtk!1654
2020-04-08 18:18:16 +00:00
Emmanuele Bassi 23d6764a6d docs: Update the links in the FAQ
The GTK website has been updated, and we don't use Bugzilla any more.

Fixes: #2593
2020-04-08 18:47:20 +01:00
Matthias Clasen f8dd5b6b84 Merge branch 'wip/smcv/missing-xinclude-content' into 'gtk-3-24'
[gtk3] Add miscellaneous unpackaged files to dist tarball

See merge request GNOME/gtk!1653
2020-04-08 15:10:02 +00:00
Simon McVittie c37bbb2641 Add miscellaneous unpackaged files to dist tarball
Various files are in git but not in dist tarballs. Some of them look
like potentially useful references for downstream distributors.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-08 13:43:28 +01:00
Simon McVittie 76b87660ba examples: Add exampleapp.desktop to dist tarballs
This should fix the last known instance of "MISSING XINCLUDE CONTENT"
in the generated documentation when using srcdir != builddir with
Autotools.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/723
Bug-Debian: https://bugs.debian.org/672369
2020-04-08 13:38:59 +01:00
Matthias Clasen a5dc7bbfc1 Merge branch 'wip/warn-less-about-temps' into 'gtk-3-24'
wayland: Move warning about transient-less temporaries to map()

See merge request GNOME/gtk!1650
2020-04-08 11:02:26 +00:00
Jonas Ådahl cf060b4c7d wayland: Move warning about transient-less temporaries to map()
We shouldn't warn in a funtion that seemingly only checks how something
eventually should be mapped.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2589
2020-04-08 11:43:49 +02:00
Matthias Clasen 99bae0fb5f Merge branch 'wip/wayland-unconfigured-cut-shadow-2' into 'gtk-3-24'
wayland: Always store unconfigured size

See merge request GNOME/gtk!1638
2020-04-07 11:31:56 +00:00
Emmanuele Bassi 67866bd8bc Merge branch 'wip/smcv/reproducible-resources' into 'gtk-3-24'
build: Generate gdk.gresource.xml in sorted order

See merge request GNOME/gtk!1644
2020-04-07 11:06:59 +00:00
Simon McVittie b35cd705a7 build: Generate gdk.gresource.xml in sorted order
The order in which the resources get embedded matters for reproducible
builds. In the Meson build system, gen-gdk-gresources-xml already sorts
the list, but in the Autotools build system they were previously taken
in readdir() order.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-07 10:50:04 +01:00
Jonas Ådahl c5d9c8be2b wayland: Always store unconfigured size
This means it'll always be as up to date GdkWindow::width/height. We
still skip the resize for non-configured windows though, to avoid
mapping with the wrong size.

The commit f06ee688fe also accidentally
removed the unconfigured size setting completely, so this essentially
adds it back, but always sets it.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2582
2020-04-07 09:00:26 +02:00
Matthias Clasen cdd4349bfe Merge branch 'wip/fix-epiphany-and-libreoffice-menus' into 'gtk-3-24'
Fix some Epiphany and LibreOffice menus

See merge request GNOME/gtk!1640
2020-04-06 20:34:30 +00:00
Jonas Ådahl f06ee688fe wayland: Don't inhibit premature resize for popups
So now we essentially only inhibit the premature resize for toplevel
windows, where it is most crucial. For popups, this didn't work for two
reasons: we relied on the owner of the popup (application) to resize
according to the configured size. For custom popup operators like
Epiphany and LibreOffice, this didn't work out well, since they simply
didn't.

Making gdk do it for them in case they didn't themself did make the
popups show up properly, but there were still some weirdness in
LibreOffice where tooltips didn't still didn't get the right size. So,
even though the size set by application may be different from the one
later configured by the display server, let the applications have their
way and see their resize result immediately. It's fairly likely to be
what they eventually get anyway.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2583
2020-04-06 22:02:02 +02:00
Jonas Ådahl 92aa63c203 wayland: Set unconfigured size on impl construction
Who knows who might use this for something, so lets make the
unconfigured size slightly more predictable. This doesn't fix anything
known to be broken though.
2020-04-06 22:01:12 +02:00
Matthias Clasen dc79e07228 Merge branch 'wip/smcv/wayland-configure-positive-sizes' into 'gtk-3-24'
wayland: Guard against nonsense sizes being configured

See merge request GNOME/gtk!1639
2020-04-06 13:00:30 +00:00
Simon McVittie 46165b52e5 wayland: Guard against nonsense sizes being configured
With the fixes from !1638, it shouldn't be possible for this to happen
any more. However, non-positive sizes make no sense regardless, so if
this does somehow happen, let's make sure *something* reasonable happens.

The practical result of this assertion being hit is that we emit a
critical warning and then behave the same as if !1634 had been merged,
which is known to solve the issue for the submitter.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-06 13:33:09 +01:00
Matthias Clasen e6ec3f4b95 Merge branch 'wip/wayland-unconfigured-cut-shadow' into 'gtk-3-24'
Fix restoring size from past sessions

See merge request GNOME/gtk!1637
2020-04-06 11:49:45 +00:00
Jonas Ådahl 814d1e7f06 wayland: Store unconfigured size without margin
We get the unconfigured size request either with or without the shadow
margin already configured, so to get some consistency with the 'saved
size', cut away any potential shadow margin from the size before
storing.

Then when using, add it back, so we always create a configure event with
the correct size.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2576
2020-04-06 12:13:01 +02:00
Jonas Ådahl 2e5f344e3c wayland: Always update unconfigured size
If the window size didn't change, we should still update the
unconfigured size as the window size might not be up to date.
2020-04-06 12:05:58 +02:00
Jonas Ådahl a4984cfd40 wayland: Use helpers to add/remove margins from sizes 2020-04-06 12:05:13 +02:00
John Ralls 26c75f31f4 Merge Thomas Holder's raise transient window into gtk-3-24. 2020-04-05 14:20:27 -07:00
Matthias Clasen 7fedb39b4b Merge branch 'custom-surface-resize' into 'gtk-3-24'
Do not require an initial configure for custom Wayland surfaces

See merge request GNOME/gtk!1633
2020-04-05 19:11:19 +00:00
William Wold 5a52af20cb Do not require an initial configure for DnD windows
Fixes #2075
2020-04-05 07:11:45 -04:00
William Wold 12fc9a45ef Do not require an initial configure for custom Wayland surfaces
There is no way for custom Wayland surfaces to get configure events, so an
initial configure event should not be required to resize a custom surface.

Fixes #2578.
2020-04-05 05:28:55 -04:00
Martin Storsjö 01d4c29ce3 Add a missing 'extern' attribute, to fix building with -fno-common
With C compilers defaulting to -fcommon, this isn't an issue, but
upcoming compilers (GCC 10 and Clang 11) will default to -fno-common,
ending up with duplicate definitions of this variable.
2020-04-05 00:26:19 +03:00
Ibai Oihanguren Sala 8c97702a07 Update Basque translation 2020-04-04 13:44:01 +00:00
Matthias Clasen 5a0891c69d Merge branch 'gtk-3-24' into 'gtk-3-24'
docs: Do not call GTK APIs if gtk_init_check returns FALSE

See merge request GNOME/gtk!1617
2020-04-04 03:18:01 +00:00
Nicola Fontana 392d4de8a9 docs: Do not call GTK APIs if gtk_init_check returns FALSE
See issue #994.
2020-04-03 22:59:59 +02:00
Rūdolfs Mazurs 4ce11106c8 Update Latvian translation 2020-04-03 20:47:38 +00:00
Matthias Clasen 4480c0ffc6 3.24.17 2020-04-03 13:07:53 -04:00
Matthias Clasen da1686eb47 Fix build issues with HighContrast theme 2020-04-03 12:54:32 -04:00
Matthias Clasen eecd33146e Merge branch 'wip/dont-postpone-subsurface-resize' into 'gtk-3-24'
wayland: Don't postpone resizes for subsurfaces

See merge request GNOME/gtk!1620
2020-04-03 16:43:19 +00:00
Jonas Ådahl 749d940887 wayland: Don't postpone resizes for subsurfaces
Subsurfaces won't ever receive a configure event.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2570
2020-04-03 18:04:44 +02:00
Matthias Clasen c67d0f0d1d Merge branch 'wip/carlosg/fix-surrounding-text-again' into 'gtk-3-24'
imwayland: Clamp the surrounding string end correctly

See merge request GNOME/gtk!1619
2020-04-03 15:39:30 +00:00
Matthias Clasen 0fbc3581bc Merge branch '3.24-meson-bump' into 'gtk-3-24'
meson: Bump to latest version of the 3.24 branch

See merge request GNOME/gtk!1613
2020-04-03 12:25:32 +00:00
Carlos Garnacho d7fb15c822 imwayland: Clamp the surrounding string end correctly
In the paths where len > MAX_LEN and cursor/anchor are separated by
at least MAX_LEN from text edges, we were clamping the right end of
the surrounding string at MAX_LEN. Oops.

This end anchor may go as far as the string length, although just
up to len - MAX_LEN in real terms (due to the condition above that
caches cursor/anchor positions being near enough the text end).

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2565
2020-04-03 12:57:44 +02:00
Philippe Normand c010a95d8c meson: Bump to latest version of the 3.24 branch
3.24.16 was tagged without bumping the version in the Meson build definitions.
2020-04-03 10:52:29 +01:00
Matthias Clasen d5264673cb wayland: Load .Compose in imwayland too
GtkIMContextSimple loads custom compose sequences
in its set_client_window implmentation, so we need
to chain up in order to not lose those.
2020-04-02 17:30:54 -04:00
Matthias Clasen 94a2827ed9 Merge branch 'keyboard-focus' into 'gtk-3-24'
gdk/wayland: Clear modifiers when we lose keyboard focus

See merge request GNOME/gtk!1609
2020-04-02 19:23:36 +00:00
Jan Alexander Steffens (heftig) c27cb675b7 gdk/wayland: Clear modifiers when we lose keyboard focus
When we `Alt+Tab` away from a GTK application, it loses keyboard focus.
If we don't clear the modifiers, events from other devices that we
receive while unfocused will assume `Alt` is still pressed. This results
in e.g. Firefox navigating through the history instead of scrolling the
page when using the mouse wheel on it.

We don't get any information about modifiers while we are missing
keyboard focus, so assuming no modifiers are active is the best we can
do.

The shell sends us a modifier update immediately before we regain
keyboard focus, so the state shouldn't get out of sync.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2112
2020-04-02 20:45:55 +02:00
Matthias Clasen 263467ca3d Merge branch 'wip/window-state-change-fixes' into 'gtk-3-24'
Some Wayland window state change resize fixes

See merge request GNOME/gtk!1606
2020-04-02 17:25:31 +00:00
Jonas Ådahl 3b91c20eac wayland: Add margin to saved size when restoring size
We're normally going from a fixed size to a floating state when we're
using the saved size, meaning we're practically always going towards a
state where the shadow margin will non-empty. However, if we don't
include any margin when creating a new configure request, we'll end up
resizing to a slightly smaller size as gtk will cut off the margin from
the configure request when changing the window widget size.

This wasn't visible when e.g. going from maximized to floating, as we'd
add the shadow margin at a later point, which would effectively "grow"
the widnow size, but when we're going from tiled to floating, we both
start and end with a non-empty shadow margin, meaning we'd shrink ever
so slightly every time going between tiled and floating.
2020-04-02 18:10:03 +02:00
Jonas Ådahl 50aa947e51 wayland: Treat being tiled as maximized when saving size
We should never save a size when we're tiled, just as we shouldn't when
we're maximized. This fixes returning to the correct floating size after
having been tiled or maximized.
2020-04-02 18:10:03 +02:00
Jonas Ådahl 04b7853a38 wayland: Respect fixed size when resizing
If a window is configured with a fixed size (it's tiled, maximized, or
fullscreen), ignore any resize call that doesn't respect this. The set
size will instead be saved, when appropriate, so that the new size is
used when e.g. unmaximizing.

This makes it possible to call 'gtk_window_resize()' while the window is
maximized, without the window actually changing size until it's
unmaximized. Changing size to a non-maximized size is a violation of the
xdg-shell protocol.
2020-04-02 18:10:03 +02:00
Jonas Ådahl 7f12dc2b66 wayland: Postpone window resize requests until configured
An application may want to set a fallback size of a window while still
mapping maximized. This is done by calling gtk_window_resize() before
gtk_window_maximize() and before gtk_window_show(). When the window is
mapped, it should have a maximized size, and if it eventually is
unmaximized, it should fall back to the size from the earlier
gtk_window_resize() call.

What happens before this commit is that the initial window size ends up
respecting the first gtk_window_resize() dimensions, and not the window
dimension configured by the Wayland display server (i.e. maximized
dimensions).

Fix this by postponing any configure events until we received our
configuration from the display server. If we got one with a fixed size
(e.g. we're maximized, tiled etc), we use that, otherwise we look at the
one that was previously configured by gtk which corresponds to the
"preferred" size when not being maximized.

This fixes Firefox being started in a maximized state when using the
Wayland backend.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2538
2020-04-02 18:09:56 +02:00
Thomas Holder e278f38905 macOS: fix #2436 raise transient window on focus 2020-04-02 17:57:18 +02:00
Matthias Clasen f5b393fef0 Merge branch 'wip/smcv/libdir-independent-valgrind-suppressions-gtk3' into 'gtk-3-24'
[3.x] supp: Use a single suppressions file for lib, lib64 and multiarch

See merge request GNOME/gtk!1604
2020-04-02 14:47:16 +00:00
Simon McVittie 8afd623989 supp: Use a single suppressions file for lib, lib64 and multiarch
In addition to the traditional library directory lib and the 64-bit
multilib directory lib64, this will cover Debian-style multiarch
(lib/x86_64-linux-gnu etc.), Arch Linux 32-bit (lib32), x32 and
various others.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-04-02 09:30:44 +01:00
Jiri Grönroos b62860b1b8 Update Finnish translation 2020-04-01 14:51:22 +00:00
Matthias Clasen 58cfd44307 Merge branch 'BUG_filechooser_new_folder_focus_GTK3' into 'gtk-3-24'
gtkfilechooserwidget: set 'New folder' button focus-on-click

See merge request GNOME/gtk!1595
2020-04-01 04:28:22 +00:00
Matthias Clasen d8ab9c4259 Merge branch 'BUG_buttons_with_menu_onclick_GTK3' into 'gtk-3-24'
GtkMenuButton: disable focus-on-click

See merge request GNOME/gtk!1596
2020-04-01 02:56:51 +00:00
Nelson Benítez León 527a99e598 GtkMenuButton: disable focus-on-click
As general rule, all buttons that launch a menu should
not grab focus on click, because otherwise when the menu
is closed the focus goes back to the button instead of
the previously focused widget, which is the one the user
was interacting with.

GtkScaleButton and GtkVolumeButton set focus-on-click
to FALSE for this same reason.

Fixes #2557
2020-03-31 21:00:32 -04:00
Nelson Benítez León 3997cdf2f4 gtkfilechooserwidget: set 'New folder' button focus-on-click
As general rule, all buttons that launch a menu should
not grab focus on click, because otherwise when the menu
is closed the focus goes back to the button instead of
the previously focused widget, which is the one the user
was interacting with.

So this is also the case for the 'New Folder' button on
the filechooser.

Fixes #2557
2020-03-31 20:15:34 -04:00
John Ralls 56eeda6c7c Merge branch MR1570 into gtk-3-24. 2020-03-31 15:46:26 -07:00
Nelson Benítez León 6d98edf89f filechooser: set default widget early for 'Rename' popover
because otherwise this second[1] popover will not be
able to save the filechooser default widget (the 'save'
button) because the first popover has not yet restablish
it (as will be done on popover's unmap handler).

[1] second because 'Rename' popover is launched from inside
    the 'file properties' popover.

Fixes #2555
2020-03-31 14:32:03 -04:00
Matthias Clasen 21e0e3f863 Merge branch 'wip/jimmac/HC-redesign-gtk3' into 'gtk-3-24'
HC: derive from Adwaita

See merge request GNOME/gtk!1587
2020-03-30 17:48:22 +00:00
Emmanuele Bassi 9fdc64f7fc Merge branch 'wip/hadess/no-gauto-portal' into 'gtk-3-24'
Remove g_auto usage

See merge request GNOME/gtk!1588
2020-03-30 16:22:58 +00:00
Bastien Nocera 8dfb1d197a gtkprivate: Remove g_auto usage
Fixes: 93ab478af1
2020-03-30 17:50:50 +02:00
Bastien Nocera fa16b682ef colorpickerportal: Remove g_auto usage
Fixes: 7b1b3fa0cb
2020-03-30 17:50:09 +02:00
Jakub Steiner 98148d9d60 HC: derive from Adwaita
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1450
2020-03-30 16:49:44 +02:00
Yosef Or Boczko afe4f283ed Update Hebrew translation 2020-03-29 15:28:00 +00:00
Yosef Or Boczko 2b0155dbc4 Update Hebrew translation 2020-03-29 15:22:36 +00:00
Matthias Clasen 7624f07764 3.24.16 2020-03-27 16:51:18 -04:00
Matthias Clasen a923ee9b87 Don't forget to dist gtktexttagprivate.h 2020-03-27 16:50:15 -04:00
Matthias Clasen dca7dc8c9c 3.24.15 2020-03-27 15:01:23 -04:00
Mantas Kriaučiūnas c62da2bdaa Update Lithuanian translation 2020-03-27 18:53:21 +00:00
Matthias Clasen 5e7650729b Merge branch 'wip/hadess/portal-select-folders' into 'gtk-3-24'
filechoosernativeportal: Allowing selecting folder(s)

See merge request GNOME/gtk!1523
2020-03-27 18:34:02 +00:00
Matthias Clasen c716776b8f Merge branch 'wip/jimmac/plug-holes-gtk3' into 'gtk-3-24'
Adwaita: work around holes in unfocused windows

See merge request GNOME/gtk!1574
2020-03-26 18:59:12 +00:00
Jakub Steiner f4c705b404 Adwaita: work around holes in unfocused windows
- works around holes in rounded corners of backdrop windows

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2537
2020-03-26 19:09:57 +01:00
LecrisUT 788fef5e80 Monitor_added signal after configure
Fixed order of monitor_added signal for Quartz display.
2020-03-26 13:06:45 +09:00
Matthias Clasen 6f372a811b Merge branch 'translate-geometry' into 'gtk-3-24'
Translate geometry with offscreen windows

See merge request GNOME/gtk!1566
2020-03-26 01:44:37 +00:00
Alberto Fanjul 842599e0f9 gdk/wayland: Control translate from parent geometry
offscreen windows return NULL for its parent
2020-03-25 23:23:23 +01:00
Matthias Clasen 58eb628571 wayland: Support scales up to 400% for cursors
Suggested in https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1503
2020-03-25 11:21:50 -04:00
Bastien Nocera 35fec1c6b2 filechoosernativeportal: Allowing selecting folder(s)
Use the "directory" portal option when asked to select folders.
2020-03-23 15:41:10 +01:00
Bastien Nocera 93ab478af1 Add portal version checking helper
Add gtk_get_portal_interface_version() to check the version of a portal.
2020-03-23 15:05:40 +01:00
Bastien Nocera f70f2d7cae colorpickerportal: Don't throw warnings on missing version
If the version can't be fetched, don't throw a warning.
2020-03-23 14:59:51 +01:00
Bastien Nocera 4c71bf74f1 colorpickerportal: Simplify portal version fetching 2020-03-23 14:59:51 +01:00
Bastien Nocera 7b1b3fa0cb colorpickerportal: Use convenience function to fetch uint
Rather than open coding it.
2020-03-23 14:59:51 +01:00
Benjamin Otte 7f5fd67d3a Merge branch 'wip/albfan/protect-begin_move_drag' into 'gtk-3-24'
Define begin_move_drag for GdkOffScreenWindow

See merge request GNOME/gtk!1548
2020-03-21 10:06:35 +00:00
Alberto Fanjul 46b92412a7 Define begin_move_drag
Avoid crashes calling it on drag and drop gestures

fixes #2532
2020-03-21 10:44:08 +01:00
Matthias Clasen 72689c52a5 Merge branch 'adwaita-tnum' into 'gtk-3-24'
theme: use tabular figures where appropriate

See merge request GNOME/gtk!1493
2020-03-20 20:35:57 +00:00
Carlos Garnacho 2647dc1d98 Merge branch 'imm-context-use-after-free' into 'gtk-3-24'
Fix crash with certain IME

See merge request GNOME/gtk!1290
2020-03-20 15:05:43 +00:00
Mantas Kriaučiūnas 837febc3c3 Update Lithuanian translation 2020-03-20 09:45:38 +00:00
Matthias Clasen 9944d66165 Merge branch 'wip/chergert/gtk3-speedup-char_is_invisible' into 'gtk-3-24'
GTK3: short-circuit char visibility check when possible

See merge request GNOME/gtk!1536
2020-03-18 22:15:24 +00:00
Christian Hergert 9fc7c3b1b3 textbtree: short-circuit visibility check when possible
If we have never seen a GtkTextTag in the GtkTextTagTable with the
invisible bit set, then we do not need to go through the process of
checking the accumulated tags.

Not using invisible tags is overwhelmingly the common case.
2020-03-18 12:56:19 -07:00
Christian Hergert 2aba6f0ba4 texttag: avoid use of g_signal_emit_by_name()
This avoids looking up the signal by name and instead uses the saved
signal identifier from gtktexttagtable.c
2020-03-18 12:50:32 -07:00
Christian Hergert 4f0842c713 texttagtable: move private functions to gtktexttagtableprivate.h
This makes backporting changes from 4.x a bit easier.
2020-03-18 12:42:40 -07:00
Emmanuele Bassi e77139c6bb Merge branch 'wip/carlosg/fix-surrounding-text' into 'gtk-3-24'
imwayland: Fix typo in code

See merge request GNOME/gtk!1533
2020-03-18 16:30:16 +00:00
Carlos Garnacho 965a85a0d3 imwayland: Fix typo in code
To find the middle of the string, we should check both cursor/anchor.
This is actually a backport of commit 8fc360dac5 in master.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2522
2020-03-18 16:59:58 +01:00
Jakub Steiner 5be08a4d09 Adwaita: dark switches/check/radios
- unescape variables (gtk3 didn't raise warnings like gtk4, but it was broken)
2020-03-18 13:07:05 +01:00
Jakub Steiner 71bdf20cff Adwaita: dark switches/check/radios
- lighten up radios, switches and checkboxes

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2461
2020-03-17 11:19:50 +01:00
Emmanuele Bassi d2931309a5 Merge branch 'respect-text-len' into 'gtk-3-24'
imwayland: Honour len argument in gtk_im_context_wayland_set_surrounding

See merge request GNOME/gtk!1528
2020-03-16 16:10:00 +00:00
Robert Mader 3c28751dee imwayland: Honour len argument in gtk_im_context_wayland_set_surrounding
Clients may pass not `NULL`-terminated strings as the function takes a
`len` argument. Use that argument.
2020-03-16 16:36:30 +01:00
Matthias Clasen 88e71646de Merge branch 'tnum-gtk-3-doc' into 'gtk-3-24'
document font-feature-settings CSS property

See merge request GNOME/gtk!1483
2020-03-14 00:28:19 +00:00
Matthias Clasen 8b5c8a2d06 Merge branch 'ci-gtk3-update' into 'gtk-3-24'
Update the CI pipeline for GTK3

See merge request GNOME/gtk!1508
2020-03-13 18:44:18 +00:00
Matthias Clasen 41330b6c03 testsuite: Handle icontheme test better
Skip just the failing tests in release builds.
2020-03-13 16:31:33 +00:00
Emmanuele Bassi aac214f1b0 testsuite/gtk: Add xfail tests
Some tests are expected to fail.

Some tests are expected to fail in non-debugging builds.

The icontheme test is the latter.
2020-03-13 16:30:06 +00:00
Emmanuele Bassi b4808c187f Silence a compiler warning
GCC complains with boxed out arguments that may be unset.
2020-03-13 16:05:13 +00:00
Emmanuele Bassi db1be15699 Silence compiler warnings in release builds
Declare debug-only variables inside a G_ENABLE_DEBUG conditional block.
2020-03-13 16:03:08 +00:00
Emmanuele Bassi 1b255dd812 Handle a missing enumeration value 2020-03-13 15:59:46 +00:00
Emmanuele Bassi c08908b488 Fix build when G_ENABLE_DEBUG is undefined 2020-03-13 15:51:57 +00:00
Emmanuele Bassi 7c23119e8f Use ifdef when checking G_ENABLE_DEBUG
Don't use `if`, as we don't unconditionally define the symbol.
2020-03-13 15:51:57 +00:00
Emmanuele Bassi 7687f9a06f docs: Remove redundant gtk-doc stanza 2020-03-13 15:51:57 +00:00
Emmanuele Bassi f699a299ad ci: Build API reference separately
We don't want to spend a lot of time on it just to check the build.
2020-03-13 15:51:57 +00:00
Emmanuele Bassi b68dde91b8 ci: Add a Debian build
We want to test the build on multiple Linux distributions.
2020-03-13 15:51:57 +00:00
Emmanuele Bassi e5be27f756 ci: Add a Debian-based image
We want to test GTK3 on Debian as well.
2020-03-13 15:51:57 +00:00
Emmanuele Bassi 8685538419 ci: Backport the changes to the Docker script
Use the copy from master, which has been fixed to work with Podman.
2020-03-13 15:51:57 +00:00
Emmanuele Bassi 14dba9545e ci: Build both static and shared libraries at once
There's no need to have two separate CI jobs: Meson can build both
libraries at the same time.
2020-03-13 15:51:57 +00:00
Matthias Clasen 603c3ba533 Merge branch 'gtk-3-24' into 'gtk-3-24'
Fix for issue #2497, see https://gitlab.gnome.org/GNOME/gtk/issues/2497

See merge request GNOME/gtk!1509
2020-03-13 13:54:28 +00:00
Mantas Kriaučiūnas 5c2ab46184 Update Lithuanian translation 2020-03-13 13:19:53 +00:00
Matthias Clasen bf315637e4 Merge branch 'fix-issue-2503' into 'gtk-3-24'
Fix spelling of AppKit framework in `gdkquartz-gtk-only.h`

See merge request GNOME/gtk!1513
2020-03-11 15:34:57 +00:00
Daniel Korostil 1d5b4a80b3 Update Ukrainian translation 2020-03-10 22:05:00 +00:00
Daniel Korostil 6cf91b5bc0 Update Ukrainian translation 2020-03-10 22:02:19 +00:00
Torsten Maehne 245ea77da6 Fix spelling of AppKit framework in gdkquartz-gtk-only.h
gtk+-3.24.14 with quartz backend fails to compile on macOS when using
a case-sensitive file system. The cause for the compilation error is a
simple typo in line 26 of `gdk/quartz/gdkquartz-gtk-only.h`. The
AppKit framework is included there with `<Appkit/Appkit.h>` instead of
`<AppKit/AppKit.h>`, which is fixed with this commit.

References: https://trac.macports.org/ticket/60168
Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2503
2020-03-10 19:21:23 +01:00
Kjartan Maraas 6de41e9383 Update Norwegian Bokmål translation 2020-03-09 14:26:55 +00:00
sicklylife d413bbc5f5 Update Japanese translation 2020-03-09 12:47:59 +00:00
Eivind Naess 2c85be990d Fix for issue #2497, see https://gitlab.gnome.org/GNOME/gtk/issues/2497
The 'selection-changed' signal is emitted unconditionally, even in the case
when there is no selection to be cleared. As a result, the subscriber receives
the initial signal and if he calls gtk_file_chooser_get_uri(), no value is
currently selected.
2020-03-08 18:54:10 -07:00
Tim Sabsch d1c6766ae1 Update German translation 2020-03-07 17:35:44 +00:00
Tim Sabsch c7b91bc7ae Update German translation 2020-03-07 17:31:52 +00:00
sicklylife 494bc00687 Update Japanese translation 2020-03-03 12:10:47 +00:00
sicklylife 58c36527d0 Update Japanese translation 2020-03-03 12:04:55 +00:00
Lukas K 82b9be3297 theme: use tabular figures where appropriate
Set font-feature-settings: "tnum" on spinbuttons, progress bars and
scales

fixes #1478
2020-02-29 14:33:49 +01:00
Matthias Clasen 4c027d458b Merge branch 'wip/hadess/fix-remote-filechooser' into 'gtk-3-24'
Fix crasher/warnings when browsing remote filesystems

See merge request GNOME/gtk!1489
2020-02-28 16:17:41 +00:00
Bastien Nocera 53b0c5fd88 filechooser: Fallback if content-type unavailable
Fallback to fast-content-type if the content-type attribute isn't
available, as is the case for most remote filesystems.

Closes: #2482
2020-02-28 16:59:19 +01:00
Bastien Nocera 22b0400f5e filechooser: Fix crash when file has no content-type
This might happen for slow filesystems where a fast-content-type might
be provided instead. Don't try to manipulate that content_type if it's
NULL, otherwise we'll either throw warnings (at best) or crash (at
worse).
2020-02-28 16:56:29 +01:00
Nathan Follens 3165c3c257 Update Dutch translation 2020-02-27 11:08:52 +00:00
Danial Behzadi 78dca145f8 Update Persian translation 2020-02-26 22:59:11 +00:00
Danial Behzadi cca54a0d93 Update Persian translation 2020-02-26 22:20:17 +00:00
Lukas K e618a49d71 document font-feature-settings CSS property
introduced in 2e2b6478
2020-02-26 21:51:31 +01:00
Matthias Clasen 0c51c66bea Merge branch 'tnum-gtk-3' into 'gtk-3-24'
css: add support for font-feature-settings

See merge request GNOME/gtk!1478
2020-02-26 02:03:31 +00:00
Lukas K 2e2b647833 css: add support for font-feature-settings 2020-02-25 22:54:00 +01:00
Matthias Clasen f2d369732b Merge branch '138-gtk3-install-valgrind-suppressions' into 'gtk-3-24'
Add Valgrind suppressions files

See merge request GNOME/gtk!1468
2020-02-24 00:07:29 +00:00
Philip Chimento b47ddb09ad Add Valgrind suppressions files
This copies the suppressions files from the master branch.

See: #138
2020-02-23 15:39:12 -08:00
Changwoo Ryu 4601e0e7ec Update Korean translation 2020-02-22 10:47:35 +00:00
Matthias Clasen 429a6287e0 Merge branch 'wip/carlosg/selection-null-checks' into 'gtk-3-24'
Protect against NULL selection data from clients

See merge request GNOME/gtk!1452
2020-02-20 13:58:12 +00:00
Carlos Garnacho a097ca0906 gdk/wayland: Harden against NULL selection content
If NULL is returned, probably the client shouldn't advertise the
mimetype. Make it sure we forget entirely about the attempt to
cache this mimetype, as it'll be mistaken as pending otherwise.

Dropping this cached selection will in consequence close the fd
of all pending readers, which seems appropriate for NULL content.

https://gitlab.gnome.org/GNOME/gtk/issues/2456
2020-02-20 14:09:00 +01:00
Carlos Garnacho 6893118510 gdk/wayland: Avoid invalid memory access on cancellation
The only way to have G_IO_ERROR_CANCELLED in the write callback
goes through having the array of pending writers already cleared.
It should not access the invalid AsyncWriteData and StoredSelection
in that case.
2020-02-20 14:09:00 +01:00
Christoph Reiter 81ef7eb30b Revert "CI: Disable building man pages in MSYS2 to work around docbook.xsl breakage"
This reverts commit 09ec272d47.

This got fixed in MSYS2
2020-02-19 07:40:48 +01:00
Jakub Steiner 0ae09a2d44 Merge branch 'wip/fmuellner/circular-osd-buttons' into 'gtk-3-24'
Adwaita: Leave .circular .osd buttons alone!

See merge request GNOME/gtk!1448
2020-02-18 21:34:17 +00:00
Florian Müllner dc6ba8d688 Adwaita: Leave .circular .osd buttons alone!
.osd suggests a particular color/background/hover style, while .circular
only suggests roundness. So for buttons that use both classes, make sure
the former takes precedence with regard to background/hover.
2020-02-18 20:37:53 +01:00
Emmanuele Bassi 369fd7734b Merge branch 'infobar-content-area-type' into 'gtk-3-24'
[3.24] GtkInfoBar/GtkDialog: Add `type Gtk.XXX` annotations for headerbar/action_area/content_area getters

See merge request GNOME/gtk!1446
2020-02-18 10:57:48 +00:00
Sebastian Dröge d9fc2bffdd GtkDialog: Add type Gtk.XXX annotations for return values of action_area/headerbar getters 2020-02-18 10:51:20 +02:00
Sebastian Dröge 1f96d57a0f GtkInfoBar: Add type Gtk.Box annotation for action_area/content_area getters 2020-02-18 10:45:34 +02:00
Matthias Clasen fab213a5f9 3.24.14 2020-02-17 12:30:04 -05:00
Ignacio Casal Quinteiro 63b061684d Merge branch 'gtk-3-24-fix-runtime-assertions' into 'gtk-3-24'
Prevent Quartz/CoreGraphics runtime assertion failures. (GTK 3)

See merge request GNOME/gtk!1442
2020-02-17 15:49:42 +00:00
David Hogan a1720b97a4 Prevent Quartz/CoreGraphics runtime assertion failures.
gdk_window_impl_quartz_release_context () can be called with a NULL CGContextRef. This causes CoreGraphics assertion failures when debugging a Gtk application in Xcode, as the code was blindly passing that NULL to CGContextRestoreGState () and CGContextSetAllowsAntialiasing (). Given that the matching pair of CGContextSaveGState () and CGContextSetAllowsAntialiasing () calls are already checking for a NULL CGContextRef, it seems reasonable to wrap these calls in a NULL check.
2020-02-17 10:02:50 +11:00
Asier Sarasua Garmendia 1c4d5fbe20 Update Basque translation 2020-02-16 20:03:14 +00:00
Claude Paroz 878be85d0c Update French translation 2020-02-16 19:59:25 +00:00
Carlos Garnacho 0e5d7c6323 Merge branch 'enable' into 'gtk-3-24'
imwayland: Fix enabling and disabling of text inputs

See merge request GNOME/gtk!1354
2020-02-15 12:47:55 +00:00
Dorota Czaplejewicz a7c17ca0c5 imwayland: Do not send events while text input is inactive. 2020-02-15 13:10:34 +01:00
Dorota Czaplejewicz 601b7c8edf imwayland: Use common function to enable text input
Enabling text input needs to send the supported capabilities.
It's easiest to ensure that by using a single enable function.
2020-02-15 13:10:34 +01:00
Dorota Czaplejewicz fc437410ce imwayland: Move release handling after enable
In preparation for the commit which calls enable in the release handler.
2020-02-15 13:10:34 +01:00
Matthias Clasen 56ee5f03c7 Merge branch 'wip/carlosg/simultaneous-clipboard-access-3.24' into 'gtk-3-24'
gdk/wayland: Handle simultaneous selection requests

See merge request GNOME/gtk!1438
2020-02-14 23:32:07 +00:00
Carlos Garnacho 2ba067e3bc gdk/wayland: Handle simultaneous selection requests
Cache separately the selection contents for each given window/selection/atom
combination, and keep the requestors separate for each of those.

This allows us to incrementally request multiple mimetypes, and dispatch
the requestors as soon as the data is up. This stored selection content is
cached until the selection owner changes, at which point all pending readers
could get their transfers cancelled, and the stored content for the selection
forgotten.
2020-02-14 21:06:59 +01:00
Matthias Clasen 86ac6d447c Merge branch 'recursive-search' into 'gtk-3-24'
GtkSearchEngineSimple: Disable recursive search

See merge request GNOME/gtk!1356
2020-02-14 13:15:07 +00:00
Matthias Clasen 343e9cfad4 Merge branch '1464-tree-view-expander-arrows-no-longer-positioned-vertically-centered-correctly' into 'gtk-3-24'
Resolve "Tree view expander arrows no longer positioned (vertically centered) correctly"

See merge request GNOME/gtk!1434
2020-02-14 12:30:59 +00:00
Emmanuele Bassi 326df4840f Merge branch 'gtk-3-24' into 'gtk-3-24'
Fixed OpenGL extension detection for extensions promoted to OpenGL core. (Gtk 3.24)

See merge request GNOME/gtk!1422
2020-02-14 11:32:11 +00:00
António Fernandes 90a006b362 treeview: Prevent fuzzy centered expander arrows
We want expander arrows to be vertically centered in their row, so we
pass the cell area's height to the renderer.

However, if the cell area's height is an odd number while the
"expander-size" style property is an even number, or vice versa, the
arrow will be centered in a half pixel, and fuzzily rendered.

So, round the render height to the same parity as the expander-size.

(This is not necessary for the arrow width because it's assumed equal
to the "expander-size" style-property.)
2020-02-14 08:38:29 +00:00
António Fernandes 5d46f3c2e7 treeview: Respect expander-size style property.
An expander arrows's render width is supposed to be derived from the
"expander-size" style property.

However, we are actually rendering it for a width equal to
expander-size + 1. This results in ugly blurry rendering.

There is a comment justifying this "+ 1", which has been there for
almost 2 decades. But the justification doesn't seem to apply to
the current code, so the original motivation is likely obsolete.

Let's remove this "+ 1" to render the arrow to a width exactly equal
to the "expander-size" style property.
2020-02-14 08:38:29 +00:00
António Fernandes 0494090afa Revert "treeview: respect expander-size style property"
This reverts commit d6a29e1b8c.

It fixed blurry rendering of expander arrows.

However, it also introduced a regression in that the arrows are no
longer vertically centered if rows are taller than twice the
expander-size style property.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1464
2020-02-14 08:38:29 +00:00
David Hogan 66e2e9c02a Fixed OpenGL extension detection for extensions promoted to OpenGL core.
For a given OpenGL context, macOS in particular does not support enumeration / detection of OpenGL features that have been promoted to core OpenGL functionality. It is possible other drivers are the same. This change assumes support for GL_ARB_texture_non_power_of_two with OpenGL 2.0+, GL_ARB_texture_rectangle with OpenGL 3.1+ and GL_EXT_framebuffer_blit with OpenGL 3.0+. I failed to find definitive information on whether GL_GREMEDY_frame_terminator has been promoted to OpenGL core, or whether GL_ANGLE_framebuffer_blit or GL_EXT_unpack_subimage have been promoted to core in OpenGL ES. This change results in a significant GtkGLArea performance boost on macOS.

Closes #2428
2020-02-14 17:51:22 +11:00
Matthias Clasen 011dcf828b Merge branch 'wip/muktupavels/info-bar-reftest' into 'gtk-3-24'
fix info-bar-message-types.ui reftest

See merge request GNOME/gtk!1428
2020-02-14 00:19:43 +00:00
Alberts Muktupāvels 840ef37bfd infobar: fix initial window position
Call gtk_widget_set_allocation after chaining up to parent class
to ensure that GtkInfoBar has correct allocation. Otherwise x and y
is set to zero causing wrong window position in gtk_info_bar_realize.

This fixes info-bar-message-types.ui reftest.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1428
2020-02-14 00:50:27 +02:00
Matthias Clasen 88249f7077 Merge branch 'ci-msys2-disable-man-pages' into 'gtk-3-24'
CI: Disable building man pages in MSYS2 to work around docbook.xsl breakage

See merge request GNOME/gtk!1432
2020-02-13 20:37:11 +00:00
Christoph Reiter 09ec272d47 CI: Disable building man pages in MSYS2 to work around docbook.xsl breakage
MSYS2 issue: https://github.com/msys2/MINGW-packages/issues/6194
2020-02-13 20:35:57 +01:00
Daniel Mustieles 30367521a8 Updated Spanish translation 2020-02-13 16:34:31 +01:00
Matthias Clasen 277c943d63 Merge branch 'mcatanzaro/#2424' into 'gtk-3-24'
window: prepare for window destruction after gtk_window_close()

See merge request GNOME/gtk!1407
2020-02-11 16:59:48 +00:00
Emmanuele Bassi 418b80e6c8 Merge branch 'private-code' into 'gtk-3-24'
Use `wayland-scanner private-code` in autotools build

See merge request GNOME/gtk!1295
2020-02-11 16:35:30 +00:00
Emmanuele Bassi a70ecff82d Merge branch 'meson_warn' into 'gtk-3-24'
Revert "Force the loadable module suffix on the print backend modules."

See merge request GNOME/gtk!1345
2020-02-11 16:33:44 +00:00
Michael Catanzaro fe2370a5ba window: prepare for window destruction after gtk_window_close()
Epiphany is doing something weird after calling gtk_window_close(),
because by the time the callback executes, the window has no GdkWindow.
Frankly, I don't know what's happening there, but we should probably not
crash.

Fixes #2424
2020-02-10 22:09:10 -06:00
Emmanuele Bassi 3a17e80061 Revert "Force the loadable module suffix on the print backend modules."
This reverts commit ee448db031.

The `name_suffix` argument is already set, and by setting it twice we're
just getting a warning at configuration time from Meson.
2020-02-09 21:04:23 +00:00
Jiri Grönroos 4d7d811252 Update Finnish translation 2020-02-09 18:52:13 +00:00
Sabri Ünal 05f409fbdc Update Turkish translation 2020-02-09 13:58:41 +00:00
Sabri Ünal 8ba1a29ee4 Update Turkish translation 2020-02-09 13:57:38 +00:00
Bruce Cowan 5ac59dc3b9 Update British English translation 2020-02-08 13:56:28 +00:00
Matthias Clasen 9c8babacae Merge branch 'vista_clipboard' into 'gtk-3-24'
GDK W32: Use Vista+ clipboard API

See merge request GNOME/gtk!1143
2020-02-06 12:52:11 +00:00
Jakub Steiner 70ebd7e237 Merge branch 'Gtk_3_24_focus_rings' into 'gtk-3-24'
Outline/focus ring border-radii fixes

See merge request GNOME/gtk!1384
2020-02-05 12:18:55 +00:00
Carlo Lobrano b50ccaea12 Adwaita: always use link specific colors for link selector
link target uses `$selected_bg_color` and `$selected_fg_color` for the
definition of some selectors (e.g. selected).

While `$link_color` and `$link_visited_color` are based on
`$selected_bg_color`, this does not seem coherent.

Replacing `$selected_*g_color` in link target style with link colors
defined in `_colors.scss file`.
2020-02-05 13:14:26 +01:00
Feichtmeier cfd530db0d Outline/focus ring border-radii fixes
- change %linked_XXX class outline-radii to match the border-radii
- adapt the .dialog-action-area buttons to this
2020-02-04 12:34:20 +00:00
Jakub Steiner b0f24fd8d5 Adwaita: generate up to date CSS
- the typography SASS changes weren't generated in the CSS
2020-02-04 11:09:38 +01:00
Thomas Holder 5e8d97ef0b gdk quartz: add missing include (-Werror=implicit)
Regression of GNOME/gtk!641 (ef72fe750a)
2020-02-02 11:16:40 +01:00
John Ralls 8670b7980d Merge Thomas Holder's 'gtk-3-24-fix-gdkcursor-quartz' into gtk-3-24. 2020-02-01 15:29:41 -08:00
Thomas Holder 528f780871 gdk quartz: add missing include
Fixes startup crash with Inkscape.

Regression of GNOME/gtk!641 (ef72fe750a)
2020-02-01 23:56:56 +01:00
Matthias Clasen 2f9431965b Merge branch 'model-button-a11y-state' into 'gtk-3-24'
modelbutton: Update a11y states

See merge request GNOME/gtk!1374
2020-01-31 18:31:23 +00:00
Matthias Clasen 09b14437a8 modelbutton: Update a11y states
We took care to set the proper role on our accessible object,
but we forgot to update the state for check and radio button
roles.
2020-01-31 19:08:09 +01:00
John Ralls e2c34b9db7 Merge branch 'issue2225' into gtk-3-24 2020-01-30 10:31:57 -08:00
Matthias Clasen 9c832b388b Merge branch 'gdk-device-leak-fix-gtk3' into 'gtk-3-24'
GdkDevice leak fix

See merge request GNOME/gtk!1359
2020-01-30 09:10:50 +00:00
Stas Solovey 9ba0671b32 Update Russian translation 2020-01-29 20:48:21 +00:00
Emmanuele Bassi a574404a2e Merge branch 'wip/muktupavels/work-areas-v3-3-24' into 'gtk-3-24'
per-monitor work areas

See merge request GNOME/gtk!478
2020-01-29 11:25:19 +00:00
Alberts Muktupāvels 6609a9f061 x11: add support for _GTK_WORKAREAS_Dn
If window manager supports _GTK_WORKAREAS use per-monitor work areas.

https://mail.gnome.org/archives/wm-spec-list/2018-December/msg00000.html
https://gitlab.freedesktop.org/xdg/xdg-specs/merge_requests/22

https://gitlab.gnome.org/GNOME/gtk/merge_requests/478
2020-01-28 14:51:22 +02:00
Sebastian Keller 9ce66b9d05 gdk/x11: Properly unref removed device in XI2 device manager
When a device is added, there are two references to it by the device
manager, the initial one and the one used for the id_table. Removing a
device only removed the reference added by the id_table resulting in the
GdkDevice being leaked.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1359
2020-01-27 22:06:49 +01:00
Dušan Kazik cb1c16021e Update Slovak translation 2020-01-27 08:00:50 +00:00
Sebastian Keller 4cef9f3471 gdkseatdefault: Unref removed slave devices
Adding a slave device adds a ref, but removing it does not unref it.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1359
2020-01-27 01:48:37 +01:00
Dušan Kazik 9a65e05748 Update Slovak translation 2020-01-26 20:31:02 +00:00
Xavier Claessens 68bd429edd GtkSearchEngineSimple: Disable recursive search
It is too slow to be useful, rely on the Tracker engine to perform recursive search.

Fixes: #2392.
2020-01-26 07:47:26 -05:00
Piotr Drąg d877325a1e Add empty Kurdish Sorani translation of properties
Follow-up to 3822ac74fc

Build will break without this, see the note in LINGUAS.
2020-01-25 12:35:12 +01:00
Matthias Clasen e4509d723e Merge branch 'display-woes' into 'gtk-3-24'
Couple of fixes for GtkDisplay open/close

See merge request GNOME/gtk!1343
2020-01-24 16:35:13 +00:00
Matthias Clasen ed9825e8ca Merge branch 'fix-avahi_service_resolver_cb-crash' into 'gtk-3-24'
printing: Fix crash in avahi_service_resolver_cb

See merge request GNOME/gtk!1346
2020-01-23 16:42:35 +00:00
Olivier Fourdan b1d55f2c85 gtksettings: Remove display from cache on closing
GTK caches the settings per display in a static `GArray`, keeping a
reference to the `GdkDisplay` as the key.

However, when closing the display, the corresponding entry is not
removed from the cache in `GtkSettings`.

So when reopening again a `GdkDisplay`, if the new address matches one
of the previously closed display, the cache will return the existing
`GtkSettings` from the cache, which still holds a reference to the old
`GdkScreen` which was freed along the `GdkDisplay`.

To avoid the issue, make sure to remove the `GdkDisplay` and
corresponding `GdkSettings` when closing the `GdkDisplay`.

Also, care must be taken not to recreate the `GdkSettings` and re-add
the `GdkDisplay` to the cache once the display is closed, and make sure
callers of `gtk_settings_get_for_display()` can deal with a returned
value being `NULL` if the display is closed.

Fixes: commit 360a3c1690 - "Use a cheaper way to store settings per
display"
2020-01-23 17:34:47 +01:00
Olivier Fourdan c9601f1567 gdk/wayland: Fix gdk_window_impl_wayland_finalize() warnings
On Wayland, opening and closing a `GdkDisplay` generates a coupe of
warnings at runtime:

```
  GLib-GObject-WARNING **:
    invalid cast from 'GdkWindowImplWayland' to 'GdkWindow'
  GLib-GObject-WARNING **:
    invalid cast from 'GdkWaylandWindow' to 'GdkWindowImplWayland'
```

This is from `gdk_window_impl_wayland_finalize()` which tries to cast
the given GObject to a `GdkWindow` while it's a `GdkWindowImplWayland`.

Use the correct type casting of objects to avoid the warnings.
2020-01-23 17:34:47 +01:00
WGH 3d5f083b75 printing: Fix crash in avahi_service_resolver_cb
printer_name_compressed_strv is NULL-terminated array
of gchar*, which means N+1 memory should be allocated.

Otherwise, if the printer name has no empty components
(which is usually the case), printer_name_compressed_strv[N],
which should contain the NULL sentinel, will actually lie
just outside of allocated memory, which is UB.

In my case, it led to crashes inside g_strjoinv
when Print... dialog is opened in evince.

    #0  0x00007fad2ce1bad7 in __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:96
    #1  0x00007fad2d04d88d in g_strjoinv (separator=separator@entry=0x7fad0c9bc508 "-", str_array=str_array@entry=0x556b017f0200) at ../glib-2.60.7/glib/gstrfuncs.c:2585
    #2  0x00007fad0c9b8a89 in avahi_service_resolver_cb (source_object=<optimized out>, res=<optimized out>, user_data=0x7fad08020ee0) at /var/tmp/portage/x11-libs/gtk+-3.24.13/work/gtk+-3.24.13/modules/printbackends/cups/gtkprintbackendcups.c:3223
    #3  0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8b00 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209
    #4  0x00007fad2d1f987d in g_task_return (task=0x556b017a8b00 [GTask], type=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1278
    #5  0x00007fad2d1f9dec in g_task_return (type=G_TASK_RETURN_SUCCESS, task=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1678
    #6  0x00007fad2d1f9dec in g_task_return_pointer (task=<optimized out>, result=<optimized out>, result_destroy=<optimized out>) at ../glib-2.60.7/gio/gtask.c:1683
    #7  0x00007fad2d24b6af in g_dbus_connection_call_done (source=<optimized out>, result=0x556b017a8bc0, user_data=0x556b017a8b00) at ../glib-2.60.7/gio/gdbusconnection.c:5747
    #8  0x00007fad2d1f8ed3 in g_task_return_now (task=0x556b017a8bc0 [GTask]) at ../glib-2.60.7/gio/gtask.c:1209
    #9  0x00007fad2d1f8f09 in complete_in_idle_cb (task=0x556b017a8bc0) at ../glib-2.60.7/gio/gtask.c:1223
    #10 0x00007fad2d02d2c0 in g_main_dispatch (context=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3189
    #11 0x00007fad2d02d2c0 in g_main_context_dispatch (context=context@entry=0x556b00eee090) at ../glib-2.60.7/glib/gmain.c:3854
    #12 0x00007fad2d02d658 in g_main_context_iterate (context=context@entry=0x556b00eee090, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.60.7/glib/gmain.c:3927
    #13 0x00007fad2d02d6df in g_main_context_iteration (context=context@entry=0x556b00eee090, may_block=may_block@entry=1) at ../glib-2.60.7/glib/gmain.c:3988
    #14 0x00007fad2d22248d in g_application_run (application=0x556b0116f130 [EvApplication], argc=<optimized out>, argv=<optimized out>) at ../glib-2.60.7/gio/gapplication.c:2519
    #15 0x0000556b002e55a1 in  ()
    #16 0x00007fad2ccd6f1b in __libc_start_main (main=0x556b002e50d0, argc=2, argv=0x7ffe1057fa88, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe1057fa78) at ../csu/libc-start.c:308
    #17 0x0000556b002e567a in  ()

    (gdb) p printer_name_compressed_strv[0]
    $4 = (gchar *) 0x556d4a4be430 "Brother"
    (gdb) p printer_name_compressed_strv[1]
    $5 = (gchar *) 0x7f9dbc011090 "MFC"
    (gdb) p printer_name_compressed_strv[2]
    $6 = (gchar *) 0x556d4a51ba50 "7860DW"
    (gdb) p printer_name_compressed_strv[3]
    $7 = (gchar *) 0x401 <error: Cannot access memory at address 0x401>
2020-01-23 18:27:41 +03:00
John Ralls eabaf90076 Match returns annotation on quartz version of gtk_drag_dest_get_target_List. 2020-01-22 20:53:38 -08:00
John Ralls c3deff17a6 Check target list not null to prevent segfault. 2020-01-22 20:53:38 -08:00
John Ralls 44c033ccb8 Ensure that GtkDragDestSite is inited to 0. 2020-01-22 20:53:38 -08:00
John Ralls 81c42faa5a Handle NSException from removeItemAtIndex. 2020-01-22 20:53:38 -08:00
sicklylife 43d7747df6 Update Japanese translation 2020-01-22 17:36:38 +00:00
sicklylife 650a3996ba Update Japanese translation 2020-01-22 17:27:16 +00:00
Emmanuele Bassi e8cd4d4d33 Merge branch 'wip/muktupavels/issue-1084' into 'gtk-3-24'
Complete startup notification sequence for remote invocations

See merge request GNOME/gtk!1296
2020-01-22 15:07:27 +00:00
Matthias Clasen 159ad1161f Merge branch 'wip/jimmac/typography-classes-gtk3' into 'gtk-3-24'
Adwaita: general typography classes

See merge request GNOME/gtk!1341
2020-01-22 13:51:02 +00:00
Jakub Steiner 9b11707a52 Adwaita: general typography classes
- many moons and some iterations later, these are the suggested
      general typographic styles. Already being referenced in apps like
      Banner Viewer (for now shipping custom definitions)

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1808
2020-01-22 12:06:31 +01:00
Jwtiyar Nariman 3822ac74fc Add Kurdish Sorani translation 2020-01-19 07:52:05 +00:00
Matthias Clasen 11568b158f inspector: Avoid an array overrun
Commit 3f56af3738 added a new value to the
GdkInputSource enum, forgetting that the inspector
has an array of names to match this enum.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2385
2020-01-18 10:53:30 -05:00
Matthias Clasen cbf5768e91 Merge branch 'gtk3-fix-gesture-get-center' into 'gtk-3-24'
[GTK3] gtkgesture: Fix gtk_gesture_get_bounding_box_center() for touchpads

See merge request GNOME/gtk!1269
2020-01-17 22:24:32 +00:00
Yariv Barkan 1c050bdcf4 demo: Use pinch translation in the gestures demo
Add the pinch translation offset to the pinch gesture demo. That allows
moving the square around in addition to the already-supported rotate and
zoom.
2020-01-17 22:37:55 +02:00
Yariv Barkan e229c6fe81 gtkgesture: Fix get-center for touchpad gestures
Touchpad gestures have only a single event sequence. The current
'center' of the gesture is the starting point + accumulated deltas.
Update gtk_gesture_get_bounding_box_center() accordingly.
2020-01-17 22:37:55 +02:00
Matthias Clasen c6ce7fedd5 Merge branch 'wip/muktupavels/fix-critical-warning' into 'gtk-3-24'
menu: fix critical warning

See merge request GNOME/gtk!1182
2020-01-17 18:16:42 +00:00
Matthias Clasen 9f9fdd6caa Merge branch 'wip/muktupavels/root-surface-scale' into 'gtk-3-24'
gdkscreen-x11: update device scale also for root window

See merge request GNOME/gtk!1208
2020-01-17 18:13:50 +00:00
Timm Bäder 5986e100eb Merge branch '3-24-fix-imwayland-cursor' into 'gtk-3-24'
imwayland: Fix get_preedit_string cursor position

See merge request GNOME/gtk!1251
2020-01-17 06:46:56 +00:00
Jakub Steiner 5d38dd5618 Adwaita: update checkbox & radio
- minor update to checkboxes and radios,
  approved for gtk3 as well.

See https://gitlab.gnome.org/GNOME/gtk/issues/2291
2020-01-15 22:18:38 +01:00
Matthias Clasen 6d3138fe6b Merge branch 'fix-2378' into 'gtk-3-24'
fontchooser: Fix size label not being hidden

See merge request GNOME/gtk!1317
2020-01-14 22:42:33 +00:00
Alex Samorukov e02148491f Use bundle id instead of package name for the macOS preview as filename is now changed 2020-01-14 22:12:53 +00:00
James Westman b5ea2c78d6 fontchooser: Fix size label not being hidden
Even when the level property of a font chooser did not include
GTK_FONT_CHOOSER_LEVEL_SIZE, the "Size" label was still displayed.

Fixes #2378.
2020-01-14 16:01:16 -06:00
Ricardo Silva Veloso db7c2afe6b Update Brazilian Portuguese translation 2020-01-14 20:31:35 +00:00
Matthias Clasen 0bffcd8882 Merge branch 'adwaita-cross-fade-fix-gtk3' into 'gtk-3-24'
Adwaita: Fix syntax error in cross-fade() (GTK3)

See merge request GNOME/gtk!1307
2020-01-14 05:32:45 +00:00
Matthias Clasen 8ed65a96b9 Merge branch 'image-surfce-cache-leak' into 'gtk-3-24'
GtkCssImageSurface: Plug cache surface leak

See merge request GNOME/gtk!1309
2020-01-14 05:32:08 +00:00
Matthias Clasen cf31119bf4 gtk-demo: Use a default action in the infobars demo
This makes the question infobar activatable by clicking
anywhere in it.
2020-01-14 00:29:53 -05:00
Matthias Clasen 0c6ea4c7b2 Adwaita: Add hover for clickable infobars 2020-01-14 00:29:53 -05:00
Matthias Clasen b55ef8d89a infobar: Activate default action on clicks
When we have a default action set on the infobar, activate it
for clicks anywhere in the infobar.  Also add an .action style
class in this case, so we can add a hover highlight to the infobar
just for this case.
2020-01-14 00:29:53 -05:00
Sebastian Keller 7e2bebb4d5 GtkCssImageSurface: Plug cache surface leak
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2373
2020-01-13 23:24:47 +01:00
nana-4 404f4c6627 Adwaita: Fix syntax error in cross-fade()
cross-fade() requires two images.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2371
2020-01-14 06:21:17 +09:00
Alex Samorukov 4a1dc1abfa Merge branch 'gtk-3-24-issue-2102' into 'gtk-3-24'
gdk_quartz_keymap_translate_keyboard_state fills consumed_modifiers incorrectly (closes #2102)

See merge request GNOME/gtk!1225
2020-01-10 21:07:46 +00:00
Mario Sanchez Prada c17c18e440 application: Complete startup notification sequence for remote invocations
When a remote instance of a GTK application implementing the Startup
Notification protocol gets spawned it will pass the startup sequence
ID as "platform data" to the main instance. Thus, we need to make sure
that the startup sequence gets completed in that case, since the remote
instance won't do it by itself, since it won't map any top level window.

Checking for this "platform data" in the implementation of the after_emit()
virtual method in the primary instance should be a good place to do so, since
the existence of such data proves that a remote instance has been spawned.

https://gitlab.gnome.org/GNOME/gtk/issues/1084
2020-01-10 13:32:37 +02:00
Michael Forney fb98242e18 Use wayland-scanner private-code in autotools build
The sed -i flag is non-standard, and may not be available in all
implementations.

The meson build already requires wayland >= 1.14.91 and uses
private-code, so just do that in the autotools build as well.
2020-01-09 19:15:46 -08:00
Michael Forney 156d6fffbe Update wayland requirement to 1.14.91 for use of private-code
In a4fe15d9f0, the wayland-scanner command was changed to use
`private-code`, which was first introduced in wayland-1.14.91. This
was synced from master commit a2a99d27c9, which *did* include a
corresponding wayland version requirement bump, but it appears that
this was lost in the sync.
2020-01-09 19:04:44 -08:00
Umarzuki Bin Mochlis Moktar d0c351468b Update Malay translation 2020-01-08 14:53:41 +00:00
Alex Samorukov 55346fbeb9 Merge branch 'gtk-3-24-fix-set_functions' into 'gtk-3-24'
quartz: impl_class->set_functions listed twice in the object

See merge request GNOME/gtk!1282
2020-01-08 14:17:36 +00:00
Alex Samorukov 76e95a702f impl_class->set_functions listed twice in the object 2020-01-08 14:17:36 +00:00
Alex Samorukov a4bb6cea63 Merge branch 'gtk-3-24-fixeventloop' into 'gtk-3-24'
Move `[NSApplication sharedApplication]` after event loop init to avoid window focus issues (closes #2342).

See merge request GNOME/gtk!1285
2020-01-08 14:13:36 +00:00
Alex Samorukov 6fdef1055b move [NSApplication sharedApplication] after _gdk_quartz_events_init() to avoid initialization issues 2020-01-08 14:13:36 +00:00
Alex Samorukov a83066bdc5 Merge branch 'samm/fix-fs/gtk-3-24' into 'gtk-3-24'
Fix was_fullscreen flag (again!)

See merge request GNOME/gtk!1287
2020-01-08 13:56:10 +00:00
Alex Samorukov 2406badb92 Fix was_fullscreen flag (again!) 2020-01-08 13:56:10 +00:00
Alexandr Miloslavskiy 822705fe3e gkimmulticontext: Fix crash due to leaked signal handler
The problem is caused by gtk_im_multicontext_set_slave(), which forgets
to disconnect these signal handlers:
* gtk_im_multicontext_retrieve_surrounding_cb
* gtk_im_multicontext_delete_surrounding_cb

If slave GtkImContext emits signal after GtkIMMulticontext context is
destroyed, this leads to reading freed memory, sometimes causing a crash.

Fixes: #2365
2020-01-06 20:39:34 +01:00
Ondrej Holy b9e1ef1558 placesview: Always open default location after mounting
The default location (obtained over g_mount_get_default_location) is
opened after mounting volume, or when opening mounts from sidebar, but
not after mounting over "Connect to Server". Let's unify the behavior
and always open the default location.

https://gitlab.gnome.org/GNOME/nautilus/issues/1319


(cherry picked from commit 267ea7552b)
2020-01-06 13:22:31 +00:00
Jordi Mas fcc72575a2 Update Catalan translation 2020-01-04 07:23:34 +01:00
Matthias Clasen 6f374e787b Merge branch 'gtk-3-24-fix-fullscreen-state' into 'gtk-3-24'
Fix typo which preventing fullscreen state from being updated correctly

See merge request GNOME/gtk!1277
2020-01-03 17:54:12 +00:00
Alex Samorukov 5cdca80c0c Fix typo which preventing fullscreen state from being updated correctly 2020-01-03 17:54:12 +00:00
Alberts Muktupāvels 489fb1783b gdkscreen-x11: update device scale also for root window
Window scale can change at runtime. If cairo_surface is already
created for root window gdk_pixbuf_get_from_window will return
wrong image.

_gdk_x11_screen_set_window_scale already updates window_scale for
root window, update also cairo_surface device scale.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1208
2020-01-03 18:50:14 +02:00
Umarzuki Bin Mochlis Moktar a1a99bef83 Update Malay translation 2020-01-03 13:41:04 +00:00
Matthias Clasen 6116c0a0b4 Merge branch 'cherry-pick-6769db16' into 'gtk-3-24'
icontheme: Don't try to scale pixbufs to 0px

See merge request GNOME/gtk!1275
2020-01-01 19:24:21 +00:00
Benjamin Otte edcddf6561 icontheme: Don't try to scale pixbufs to 0px
Always insist on at least 1px, even if the thumbnail we're turning into
an icon was 256 * 3 and should be scaled to 32 * 3/8.

(cherry picked from commit 6769db160d)
2020-01-01 18:17:14 +01:00
Matthias Clasen d9a9ede7a2 Merge branch 'carlosgc/no-emoji-hint' into 'gtk-3-24'
emojichooser: never show emoji chooser when input hint no-emoji is present

See merge request GNOME/gtk!1272
2019-12-30 15:18:12 +00:00
Carlos Garcia Campos c6e5030c61 emojichooser: never show emoji chooser when input hint no-emoji is present
It's currently used only to not include the insert emoji option in the
context menu, but it's still possible to show the emoji chooser in both
GtkEntry and GtkTextView using the key bindings.
See also https://bugs.webkit.org/show_bug.cgi?id=205609.
2019-12-30 10:56:06 +01:00
Jordi Mas 1bc188b1f4 Fixes to Catalan translation 2019-12-27 13:54:02 +01:00
Fran Dieguez 402445920b Update Galician translation 2019-12-25 03:24:27 +00:00
Fran Dieguez 3eec04802c Update Galician translation 2019-12-25 01:56:10 +00:00
Fran Dieguez 276aa563ba Update Galician translation 2019-12-25 01:31:55 +00:00
Matthias Clasen 0d6cff45c3 accelgroup: Fix a buffer overrun
gtk_accelerator_parse_with_keycode can
overrun its buffer for certain inputs.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2325
2019-12-23 23:19:57 -05:00
Emmanuele Bassi eeb896d648 Merge branch 'doc-scale-button-css' into 'gtk-3-24'
Document the CSS class used for the ScaleButton popover

See merge request GNOME/gtk!1246
2019-12-22 19:31:40 +00:00
Matthias Clasen f37673927c Merge branch 'gtk3-fix-gtkgesturerotate-leak' into 'gtk-3-24'
[gtk3] gtkgesturerotate: Fix a memory leak

See merge request GNOME/gtk!1262
2019-12-19 22:54:46 +00:00
Yariv Barkan dc896f0910 gtkgesturerotate: Fix a memory leak
On touchpads gtk_gesture_get_sequences() was called without a
corresponding g_list_free(). The same was true for touchscreens
if due to some reason only a single sequence was found.
2019-12-19 20:53:45 +02:00
Efstathios Iosifidis e5b05d2478 Update Greek translation 2019-12-17 22:40:37 +00:00
Emmanuele Bassi 37dd37178f Merge branch 'ci-update-gtk3' into 'gtk-3-24'
Update CI image

See merge request GNOME/gtk!1255
2019-12-17 18:00:58 +00:00
Emmanuele Bassi a4e4b136c9 Update the list of tests that may fail
The update of the Docker image we use on our CI introduced changes in
the underlying platform, and that caused some reftests to fail.
2019-12-17 17:39:43 +00:00
Emmanuele Bassi 44b2f6792b ci: Update the Docker image 2019-12-16 20:07:39 +00:00
Emmanuele Bassi 40264c7ab3 ci: Add libXtst-devel
Needed for at-spi2-core.
2019-12-16 20:07:39 +00:00
Emmanuele Bassi 62d68ce88c ci: Update to Fedora 31
Fedora 29 is EOL.
2019-12-16 20:07:39 +00:00
xdavidwu 5ad1316b1e imwayland: Fix get_preedit_string cursor position
GtkIMContext get_preedit_string should return cursor position counted
in characters, but cursor_begin here is counted in bytes. This add the
missing conversion.
2019-12-15 19:19:54 +08:00
Marek Kasik 725892b653 printing: Fix getting info for standalone IPP printers
Create printer name from name of the advertised service
for standalone IPP printers as opposed to CUPS printers
advertised via Avahi which get name from their
resource path.
This is similar to what cups-filters does.

Pass GtkPrinter class to request for printer info
so that it does not need to be searched for
(such search could fail for standalone IPP printers).

https://gitlab.gnome.org/GNOME/gtk/issues/1509
2019-12-13 18:24:55 +01:00
Marek Kasik fb2fa8348d printing: Don't show Rejecting Jobs when we don't know
Set reasonable default values for printers discovered
by Avahi which do not have 'printer-type' attribute.
This is the case for network printers which were not
published by CUPS.

Related to the issue #1509.
2019-12-13 18:24:55 +01:00
Thomas Holder af6487d70c gdk: quartz: fix #2102 consumed_modifiers 2019-12-01 15:14:20 +01:00
Chun-wei Fan 2aa62b31b4 gdkwindow-win32.c: Fix GLES glitches during un-fullscreen
We also need to force redraw of the whole window when we are using
EGL/ANGLE during un-fullscreen, so that we do not get glitches in the
resulting window.
2019-11-22 12:00:22 +08:00
Alberts Muktupāvels e34037b015 menu: fix critical warning
Unset gdk-attached-grab-window from correct window.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1899
2019-11-14 19:00:50 +02:00
Руслан Ижбулатов e860ac5cf6 GDK W32: Use Vista+ clipboard API
Use RemoveClipboardFormatListener() and AddClipboardFormatListener().
These APIs remove the need for us to maintain the integrity of the
clipboard chain, which turned out to be problematic for some reason
that is yet to be identified.

Fixes #2215
Fixes #442
2019-10-21 19:10:48 +00:00
Руслан Ижбулатов 66bd6d88de W32: Ensure paper size/orientation is preserved
Use existing create_page_setup() function to make a GtkPageSetup
object out of the GtkPrintSettings (which we shuttled out of W32
DEVMODE) and apply it to GtkPrintOperation is the default page
setup.

Applications (such as gedit) retrieve page setup from GtkPrintOperation
by calling gtk_print_operation_get_default_page_setup (). Therefore,
we have to set it, otherwise they will get the same page setup that
we had before the dialog was shown, and will later feed that page
setup to us again, which will cause paper size and orientation to
be always reset back to whatever the hardcoded default values were.
2019-04-01 07:28:08 +00:00
537 changed files with 146680 additions and 101943 deletions
+43 -15
View File
@@ -1,29 +1,33 @@
image: registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2
stages:
- build
- docs
cache:
paths:
- _ccache/
fedora-autotools:
image: registry.gitlab.gnome.org/gnome/gtk/fedora-gtk3:v1
stage: build
script:
- bash -x ./.gitlab-ci/test-docker-autotools.sh
- bash -x ./.gitlab-ci/test-docker-autotools.sh
fedora-distcheck:
image: registry.gitlab.gnome.org/gnome/gtk/fedora-gtk3:v1
variables:
DO_DISTCHECK: "yes"
when: manual
stage: build
script:
- bash -x ./.gitlab-ci/test-docker-autotools.sh
- bash -x ./.gitlab-ci/test-docker-autotools.sh
fedora-meson: &fedora-meson-defaults
fedora-meson:
image: registry.gitlab.gnome.org/gnome/gtk/fedora-gtk3:v1
stage: build
variables:
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
script:
- bash -x ./.gitlab-ci/test-docker-meson.sh
- bash -x ./.gitlab-ci/test-docker-meson.sh
artifacts:
when: always
name: "gtk3-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
@@ -31,35 +35,59 @@ fedora-meson: &fedora-meson-defaults
- "_build/meson-logs"
- "_build/testsuite/reftests/output"
fedora-meson-staticlibs:
debian-meson:
image: registry.gitlab.gnome.org/gnome/gtk/debian-gtk3:v1
stage: build
variables:
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
<<: *fedora-meson-defaults
script:
- bash -x ./.gitlab-ci/test-docker-meson.sh
artifacts:
when: always
name: "gtk3-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
paths:
- "_build/meson-logs"
- "_build/testsuite/reftests/output"
msys2-mingw32-meson:
reference:
image: registry.gitlab.gnome.org/gnome/gtk/fedora-gtk3:v1
stage: docs
variables:
MSYSTEM: "MINGW32"
EXTRA_MESON_FLAGS: "--buildtype=release -Dgtk_doc=true -Dman=true"
script:
- bash -x ./.gitlab-ci/test-docker-meson.sh
- ninja -C _build gdk3-doc gtk3-doc
- tar -c -J -f gdk3-docs.tar.xz _build/docs/reference/gdk
- tar -c -J -f gtk3-docs.tar.xz _build/docs/reference/gtk
artifacts:
paths:
- gdk3-docs.tar.xz
- gtk3-docs.tar.xz
msys2-mingw64-meson:
variables:
MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes"
stage: build
tags:
- win32
- win32-ps
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-meson.sh"
artifacts:
when: always
name: "gtk3-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%"
name: "gtk3-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
paths:
- "_build/meson-logs"
msys2-mingw32-autotools:
msys2-mingw64-autotools:
when: manual
variables:
MSYSTEM: "MINGW32"
MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes"
stage: build
tags:
- win32
- win32-ps
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-autotools.sh"
+71
View File
@@ -0,0 +1,71 @@
FROM debian:buster
RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \
adwaita-icon-theme \
ccache \
dconf-gsettings-backend \
g++ \
gcc \
gettext \
git \
gobject-introspection \
gvfs \
hicolor-icon-theme \
itstool \
libatk-bridge2.0-dev \
libatk1.0-dev \
libc6-dev \
libcairo2-dev \
libcairo-gobject2 \
libcolord-dev \
libcups2-dev \
libegl1-mesa-dev \
libepoxy-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgdk-pixbuf2.0-dev \
libgirepository1.0-dev \
libglib2.0-dev \
libharfbuzz-dev \
libjson-glib-dev \
libpango1.0-dev \
librest-dev \
librsvg2-common \
libsoup2.4-dev \
libwayland-dev \
libx11-dev \
libxcomposite-dev \
libxcursor-dev \
libxdamage-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxinerama-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxml2-dev \
libxrandr-dev \
locales \
ninja-build \
pkg-config \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
shared-mime-info \
wayland-protocols \
xauth \
xvfb \
&& rm -rf /usr/share/doc/* /usr/share/man/*
# Locale for our build
RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user
WORKDIR /home/user
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
@@ -1,4 +1,4 @@
FROM fedora:29
FROM fedora:31
RUN dnf -y install \
adwaita-icon-theme \
@@ -41,6 +41,7 @@ RUN dnf -y install \
libxkbcommon-devel \
libXrandr-devel \
libXrender-devel \
libXtst-devel \
make \
mesa-libEGL-devel \
mesa-libwayland-egl-devel \
+130 -14
View File
@@ -1,19 +1,135 @@
#!/bin/bash
#
# This script builds an image from the Dockerfile, starts a container with
# the parent directory mounted as working directory and start a bash session
# there so you can test things.
# Once you are happy you can push it to the docker hub:
# sudo docker push "${TAG}"
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
local rematch='^[^=]*=(.*)$'
if [[ $2 =~ $rematch ]]; then
read "$1" <<< "${BASH_REMATCH[1]}"
else
read "$1" <<< "$3"
# There is no way to shift our callers args, so
# return 1 to indicate they should do it instead.
return 1
fi
}
set -e
TAG="registry.gitlab.gnome.org/gnome/gtk/gtk-3-24:v2"
build=0
run=0
push=0
list=0
print_help=0
no_login=0
# HOST_USER_ID gets used to create a user with the same ID so that files
# created in the mounted volume have the same owner
sudo docker build \
--build-arg HOST_USER_ID="$UID" --tag "${TAG}" --file "Dockerfile" .
sudo docker run --security-opt label=disable \
--rm --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash
while (($# > 0)); do
case "${1%%=*}" in
build) build=1;;
run) run=1;;
push) push=1;;
list) list=1;;
help) print_help=1;;
--base|-b) read_arg base "$@" || shift;;
--base-version) read_arg base_version "$@" || shift;;
--no-login) no_login=1;;
*) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;;
esac
shift
done
if [ $print_help == 1 ]; then
echo "$0 - Build and run Docker images"
echo ""
echo "Usage: $0 <command> [options] [basename]"
echo ""
echo "Available commands"
echo ""
echo " build --base=<BASENAME> - Build Docker image <BASENAME>.Dockerfile"
echo " run --base=<BASENAME> - Run Docker image <BASENAME>"
echo " push --base=<BASENAME> - Push Docker image <BASENAME> to the registry"
echo " list - List available images"
echo " help - This help message"
echo ""
exit 0
fi
cd "$(dirname "$0")"
if [ $list == 1 ]; then
echo "Available Docker images:"
for f in *.Dockerfile; do
filename=$( basename -- "$f" )
basename="${filename%.*}"
echo -e " \e[1;39m$basename\e[0m"
done
exit 0
fi
# All commands after this require --base to be set
if [ -z $base ]; then
echo "Usage: $0 <command>"
exit 1
fi
if [ ! -f "$base.Dockerfile" ]; then
echo -e "\e[1;31mERROR\e[0m: Dockerfile for '$base' not found"
exit 1
fi
if [ -z $base_version ]; then
base_version="latest"
else
base_version="v$base_version"
fi
if [ ! -x "$(command -v docker)" ] || [ docker --help |& grep -q podman ]; then
# Docker is actually implemented by podman, and its OCI output
# is incompatible with some of the dockerd instances on GitLab
# CI runners.
echo "Using: Podman"
format="--format docker"
CMD="podman"
else
echo "Using: Docker"
format=""
CMD="sudo socker"
fi
REGISTRY="registry.gitlab.gnome.org"
TAG="${REGISTRY}/gnome/gtk/${base}:${base_version}"
if [ $build == 1 ]; then
echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}"
${CMD} build \
${format} \
--build-arg HOST_USER_ID="$UID" \
--tag "${TAG}" \
--file "${base}.Dockerfile" .
exit $?
fi
if [ $push == 1 ]; then
echo -e "\e[1;32mPUSHING\e[0m: ${base} as ${TAG}"
if [ $no_login == 0 ]; then
${CMD} login ${REGISTRY}
fi
${CMD} push ${TAG}
exit $?
fi
if [ $run == 1 ]; then
echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}"
${CMD} run \
--rm \
--volume "$(pwd)/..:/home/user/app" \
--workdir "/home/user/app" \
--tty \
--interactive "${TAG}" \
bash
exit $?
fi
+17 -5
View File
@@ -5,19 +5,31 @@ set -e
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
export N_PROCS=$(($(nproc) - 1))
EXTRA_CONFIGURE_OPT=""
# Only enable documentation when distchecking, since it's required
if [ -n "${DO_DISTCHECK-}" ]; then
EXTRA_CONFIGURE_OPTS="${EXTRA_CONFIGURE_OPTS} --enable-gtk-doc"
fi
NOCONFIGURE=1 ./autogen.sh
mkdir _build
cd _build
../autogen.sh \
../configure \
--enable-cloudproviders \
--enable-broadway-backend \
--enable-wayland-backend \
--enable-x11-backend \
--enable-xinerama \
--enable-gtk-doc
make -j8
${EXTRA_CONFIGURE_OPTS}
make -j${N_PROCS}
if [ -n "${DO_DISTCHECK-}" ]; then
make -j8 check SKIP_GDKTARGET="echo Not actually running tests for now"
make -j8 distcheck SKIP_GDKTARGET="echo Not actually running tests for now"
make -j${N_PROCS} check SKIP_GDKTARGET="echo Not actually running tests for now"
make -j${N_PROCS} distcheck SKIP_GDKTARGET="echo Not actually running tests for now"
fi
+2 -4
View File
@@ -10,10 +10,10 @@ export PATH="${HOME}/.local/bin:${PATH}"
python3 -m pip install --user meson==0.49.2
meson \
-Dgtk_doc=true \
-Dman=true \
-Dinstalled_tests=true \
-Dbroadway_backend=true \
-Dx11_backend=true \
-Dwayland_backend=true \
-Dxinerama=yes \
-Dprint_backends="file,lpr,test,cloudprint,cups" \
${EXTRA_MESON_FLAGS:-} \
@@ -28,5 +28,3 @@ xvfb-run -a -s "-screen 0 1024x768x24" \
--print-errorlogs \
--suite=gtk+-3.0 \
--no-suite=gtk+-3.0:a11y
ninja gail-libgail-util3-doc gdk3-doc gtk3-doc
+3
View File
@@ -30,6 +30,9 @@ pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-ninja \
mingw-w64-$MSYS2_ARCH-gtk-doc
# https://github.com/msys2/MINGW-packages/pull/6465
pacman --noconfirm -S --needed mingw-w64-$MSYS2_ARCH-brotli
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
+9 -2
View File
@@ -2,7 +2,7 @@
include $(top_srcdir)/Makefile.decl
SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros win32
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@@ -16,6 +16,7 @@ EXTRA_DIST += \
NEWS.pre-1-0 \
README.commits \
README.win32 \
check-version.py \
config.h.win32 \
makefile.msc \
gtk-zip.sh.in \
@@ -28,7 +29,8 @@ EXTRA_DIST += \
po/meson.build \
po-properties/meson.build \
build-aux/meson/post-install.py \
config.h.meson
config.h.meson \
gtk.supp
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
@@ -40,6 +42,10 @@ MAINTAINERCLEANFILES = \
$(srcdir)/gtk-doc.make \
$(srcdir)/ChangeLog
if OS_UNIX
valgrinddir = $(datadir)/gtk-3.0/valgrind
valgrind_DATA = gtk.supp
endif
## Copy .pc files to target-specific names
gtk+-x11-3.0.pc gtk+-win32-3.0.pc gtk+-quartz-3.0.pc gtk+-broadway-3.0.pc gtk+-wayland-3.0.pc: gtk+-3.0.pc
@@ -79,6 +85,7 @@ DISTCLEANFILES = \
dist-hook:
mkdir $(distdir)/subprojects
cp -p $(srcdir)/subprojects/*.wrap $(distdir)/subprojects
$(top_srcdir)/check-version.py $(top_srcdir)/configure.ac $(top_srcdir)/meson.build
distclean-local:
if test "$(srcdir)" = "."; then :; else \
+439
View File
@@ -1,3 +1,442 @@
Overview of Changes in GTK+ 3.24.26
===================================
* Input:
- Fix a few oversights in Compose file parsing
- Fine-tune Compose preedit display
* Theme:
- Fine-tune scrollbar size and transitions
- Reinstate invisible borders for tiled windows
* Wayland:
- Fix a problem with font settings not being found
* Translation updates
French
Hungarian
Turkish
Overview of Changes in GTK+ 3.24.25
===================================
* Settings:
- Make cursor aspect ratio setting work
* Broadway:
- Fix touchscreen event handling
- Support Android / Chrome on-screen keyboard
* Windows:
- Fix issues with Intel graphics drivers
- Avoid UAC for gtk-update-icon-cache
* Wayland:
- Avoid crashes with tablet input
- Add api to support clients with subsurfaces better
* Inspector:
- Make the inspector available in non-debug builds
* Theme:
- Make scrollbars larger
- Disable shadows on maximized, fullscreen and tiled windows
* Printing:
- Support Avahi-discovered printers better
* Input:
- Show preedit for compose sequences
- Support long compose sequences
- Support compose sequences producing multiple characters
* Translation updates
Belarusian
British English
Catalan
Friulian
Galician
Japanese
Persian
Serbian
Overview of Changes in GTK+ 3.24.24
===================================
* GtkColorChooser:
- Update the default color palette
* GtkFontChooser:
- Fix family-only mode to return regular style
* GtkTreeView:
- Don't set focus-on-click for header buttons
* Accessibility:
- Implement scrollSubstringTo
- Add a11y support to GtkPlug/GtkSocket
* Printing:
- Allow the lpr backend to print pdf and ps files
* Theme:
- Update gesture graphics
- Update HighContrast css
* Wayland:
- Support the primary-selection-unstable-v1 protocol
* X11:
- Fix a crash with parent-relative backgrounds
* Broadway:
- Set modifier state of scroll events
* Build:
- Fix pc file generation on NixOS
* OS X:
- Restore command-key bindings
* Windows:
- Fix meson build with epoxy subproject
* Translation updates:
Basque
Brazilian Portuguese
British English
Catalan
Croatian
Czech
French
Galician
German
Greek
Hebrew
Hungarian
Indonesian
Italian
Kazakh
Latvian
Lithuanian
Persian
Polish
Portuguese
Slovak
Slovenian
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in GTK+ 3.24.23
===================================
* Adwaita:
- Support error states for labels and entries
* Printing:
- Use the correct names for remote printers
* File choser:
- Default to tracker2 for search to prevent
symbol clashes in tracker-using applications
* Wayland:
- Support newer schemas for settings
- Fix DND hotspot handling
- Disconnect on display close
* X11:
- Fix a possible crash with disabled devices
* Translation updates:
Basque
Chinese (China)
Croatian
Dutch
Finnish
Friulian
Galician
Hungarian
Japanese
Korean
Portuguese
Serbian
Overview of Changes in GTK+ 3.24.22
===================================
* GtkTextView:
- Fix some corner cases of pixelcache invalidation
- Make select-all work on touch
* Fix print portal support
* Adwaita:
- Tweak title style class
- Add a public color for text view background
* Windows:
- Limit the size of the corner mask cache
- Use native API for keycode conversion
- Use GLES on arm64
* Wayland: Add a way to change the application id
* Quartz: Add axes to master devices
* Add --enable-tracker3 option to configure
* Translation updates:
Catalan
German
Indonesian
Italian
Kazakh
Spanish
Turkish
Overview of Changes in GTK+ 3.24.21
===================================
* Wayland:
- Prevent crashes with offscreen windows
- Handle disorderly tablet/pad disconnects
* GtkFileChooser:
- Translate the type column
- Add a tracker3 search engine
- Rate-limit trash monitoring
- Make get_filter work for native chooser
* GtkGLArea:
- Fix a redraw problem
* GtkScrolledWindow:
- Fix kinetic scrolling
* Add a gtk-cursor-aspect-ratio setting
* GDK:
- Improve frame clock smoothness
- Fix frame clock monotonicity
* OS X:
- Support Pen / Eraser input
- Support openfiles in GtkApplication
* Adwaita:
- Improve notebook tab legibility
* Translation updates:
Basque
Brazilian Portuguese
Catalan
Chinese (Taiwan)
German
Indonesian
Italian
Japanese
Kazakh
Lithuanian
Polish
Romanian
Slovak
Slovenian
Swedish
Ukrainian
Overview of Changes in GTK+ 3.24.20
===================================
* GtkFileChooser:
- Prevent selection changes after overwrite confirmation
- Don't grab focus to the sidebar on click
- Avoid a use-after-free in GtkFileSystemModel
* GtkEmojiChooser:
- Remove blacklist
* GtkAboutDialog:
- Add more licenses
* Adwaita:
- Lower the contrast of checkboxes
* HighContrast:
- Export the same public colors as Adwaita
* OS X:
- Don't filter Escape in input methods
* Windows:
- Infer font settings from system settings
* Translation updates
Brazilian Portuguese
Chinese
Croatian
French
Japanese
Lithuanian
Polish
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in GTK+ 3.24.18
===================================
* Wayland:
- Fix more sizing regressions in Epiphany and LibreOffice
menus, and popups in general
* Build:
- Make resource build reproducible
* Translation updates
Basque
Latvian
Overview of Changes in GTK+ 3.24.17
===================================
* GtkFileChooser: Fix some keynav issues
* GtkMenuButton: disable focus-on-click
* Derive the HighContrast and HighContrastInverse themes from Adwaita
* Wayland:
- Fix firefox sizing problems
- Prevent Alt lingering after Alt-Tab
- Load compose sequences from ~/.Compose
- Fix a crash in the Wayland input method
* Translation updates
Finnish
Hebrew
Overview of Changes in GTK+ 3.24.16
===================================
* Fix the build
Overview of Changes in GTK+ 3.24.15
===================================
* filechooser:
- Fix a crash
- Support selecting directories with a new enough
file chooser portal
* textview:
- Speed up tag handling
* wayland:
- Fix problems with clipboard handling
- Fix a crash in the Wayland input method
- Support cursor scale of 400%
- Fix a crash in glade
* css: Support font-feature-settings
* Adwaita:
- Use tabular figures where appropriate
- Color tweaks for dark mode
- Improve rendering of rounded corners
* Translation updates
Dutch
German
Japanese
Korean
Lithuanian
Norwegian Bokmål
Persian
Ukrainian
Overview of Changes in GTK+ 3.24.14
===================================
* Fix the opaque region for windows on X11
* theme:
- Fix flat buttons in backdrop
- Make popovers look more similar to menus
- Tweak checkbox & radiobutton appearance
- Add general typography classes (heading, title-1, etc)
* language bindings:
- Fix annotations for gtk_tree_model_sort_new_with_model
* switch: Fix touch support
* infobar: Make clickable for default action
* emojichooser:
- respect a no-emoji input hint
* fontchooser:
- Fix an oversight with hiding the size label
* filechooser:
- Disable recursive search without a system indexer
* modelbutton:
- Fix a11y support to reflect button state
* input:
- Fix touchpad gesture center calculation
* x11:
- Fix root window scaling
- Support _GTK_WORKAREAS_Dn property
* wayland:
- Support a terminal purpose in input methods
- Fix preedit cursor positioning
- Fix enabling/disabling of text inputs
- Support simultaneous selection requests
- Require Wayland 1.14.91
* OS X:
- Fix fullscreen state
- Fix an Inkscape crash at startup
- Fix OpenGL extension detection
* Printing:
- Fix a crash with Avahi
* Translation updates:
Basque
British English
Catalan
Finnish
French
Galician
Japanese
Kurdish Sorani
Malay
Russian
Slovak
Spanish
Turkish
Overview of Changes in GTK+ 3.24.13
===================================
+30 -15
View File
@@ -10,15 +10,13 @@ First you obviously need developer packages for the compile-time
dependencies: GDK-Pixbuf, Pango, atk, glib, gettext-runtime, libiconv at least.
See http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .
For people compiling GTK+ with Visual C++ 2005 or later, it is
recommended that the same compiler is used for at least GDK-Pixbuf,
Pango, atk and glib so that crashes and errors caused by different CRTs
can be avoided. The VS 2008 project files and/or VS Makefiles are
either already available or will be available in the next stable release.
Unfortunately compiling with Microsoft's compilers versions 2003 or earlier
is not supported as compiling the latest stable GLib (which *is* required for
building this GTK+ release) requires features from newer compilers
and/or Platform SDKs
For people compiling GTK+ with Visual C++ or later, it is recommended that
the same compiler is used for at least GDK-Pixbuf, Pango, atk and glib
so that crashes and errors caused by different CRTs can be avoided. Currently
building with Visual Studio 2008 or later is supported, either via Visual Studio
project files or via the Meson build system, as described in the below sections.
Interchanging between Visual Studio 2015, 2017 and 2019 builds should be fine
as they use the same CRT (UCRT) DLLs.
After installing the dependencies, there are two ways to build GTK+
for win32.
@@ -152,16 +150,12 @@ would require such for ABI stability).
2) Microsoft's tools
--------------------
Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in gdk and gtk. Be prepared to manually edit various
makefile.msc files, and the makefile snippets in build/win32.
There are also VS 2008~2017 solution and project files to build GTK+, which
There are VS 2008~2019 solution and project files to build GTK+, which
are maintained by Chun-wei Fan. They should build GTK+ out of the box,
provided that the afore-mentioned dependencies are installed. They will
build GDK with the Win32 backend, GTK+ itself (with GAIL/a11y built in),
the GAIL-Util library and the gtk-demo program. Please also refer to the
README file(s) that reside in build/win32 on how to enable additional features
README file(s) that reside in win32 on how to enable additional features
that are not enabled by default, such as EGL support via libANGLE, which
emulate the GL/EGL calls using Direct3D 9/11.
@@ -181,6 +175,27 @@ instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
If desiring to build binaries for ARM64 (aarch64), one needs to use the
Visual Studio 2017 or 2019 solution files, or use Meson with a
cross-compilation file, with a Windows 10 SDK that supports ARM64
builds. At this point, building the introspection files is not supported
for ARM64 builds, and you will need a Python interpreter and
glib-compile-resources binaries that run on the build machine. For Visual Studio
2017 ARM64 builds, do also check the Directory.Build.props file in $(srcroot)/win32/vs15
indicates a Windows 10 SDK version that supports ARM64 builds exists on the build machine.
For building ARM64 binaries with the Visual Studio projects, prior to the build,
you may need to update gtk3-gen-srcs.props to pass in the variables GLIB_MKENUMS,
GLIB_GENMARSHAL, GDBUS_CODEGEN and/or GLIB_COMPILE_RESOURCES in the nmake command line
indicated by <GenerateRequiredSourcesBase> so that they point to the glib-mkenums,
glib-genmarshal, gdbus-codegen and glib-compile-resources that will run on the build
machine. You may also need to update gtk3-version-paths.props to update PythonDir to
the installation of the Python interpreter that will run on the build machine. To carry
out the actual build using the solution files, use the "Configuration Manager" to add the
ARM64 build configs by copying the settings from the x64 configs, and then build the solution.
The build instructions for such builds otherwise follow the standard Win32 (x86) and
x64 builds, but you need to ensure that you have ARM64 builds of the various dependencies.
3) Using Meson (for Visual Studio and MinGW builds)
---
+14 -2
View File
@@ -27,7 +27,13 @@ if 'DESTDIR' not in os.environ:
shutil.copyfile(installed_lib, installed_lib_dst)
print('Compiling GSettings schemas...')
subprocess.call(['glib-compile-schemas',
glib_compile_schemas = subprocess.check_output(['pkg-config',
'--variable=glib_compile_schemas',
'gio-2.0']).strip()
if not os.path.exists(glib_compile_schemas):
# pkg-config variables only available since GLib 2.62.0.
glib_compile_schemas = 'glib-compile-schemas'
subprocess.call([glib_compile_schemas,
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
print('Updating icon cache...')
@@ -43,4 +49,10 @@ if 'DESTDIR' not in os.environ:
# Untested!
print('Updating module cache for print backends...')
os.makedirs(gtk_printmodule_dir, exist_ok=True)
subprocess.call(['gio-querymodules', gtk_printmodule_dir])
gio_querymodules = subprocess.check_output(['pkg-config',
'--variable=gio_querymodules',
'gio-2.0']).strip()
if not os.path.exists(gio_querymodules):
# pkg-config variables only available since GLib 2.62.0.
gio_querymodules = 'gio-querymodules'
subprocess.call([gio_querymodules, gtk_printmodule_dir])
-53
View File
@@ -1,53 +0,0 @@
# Centralized autotools file
# Create the Visual Studio 2012/2013/2015 project files
# from the Visual Studio 2010 project files
# This autotools file, from GLib, can be used in other projects
# that have Visual Studio build support, and is copied into
# $(srcroot)/build/.
# Author: Fan, Chun-wei
# November 05, 2012
# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on)
# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017)
# MSVC_TOOLSET: Use if target MSVC toolsett is not in the form v $(MSVC_VER)0, meaning v$(MSVC_TOOLSET)
if MSVC_BASE_NO_TOOLSET_SET
MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0
endif
if MSVC_NO_TOOLSET_SET
MSVC_TOOLSET = $(MSVC_VER)0
endif
%.sln: $(top_builddir)/build/win32/vs10/Makefile
sed 's/11\.00/$(MSVC_FORMAT_VER)\.00/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
sed 's/2010/$(MSVC_VER_LONG)/g' < $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@
rm $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
%.txt: $(top_builddir)/build/win32/vs10/Makefile
sed 's/vs10/vs$(MSVC_VER)/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
sed 's/VS10/VS$(MSVC_VER)/g' < $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@
rm $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
%.vcxproj: $(top_builddir)/build/win32/vs10/Makefile
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
sed 's/v100/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
else \
sed 's/v100/v$(MSVC_TOOLSET)/g' < $(top_builddir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
fi
%.props: $(top_builddir)/build/win32/vs10/Makefile
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
sed 's/<VSVer>10<\/VSVer>/<VSVer>$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
else \
sed 's/<VSVer>10<\/VSVer>/<VSVer>$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
fi
%.vcxproj.filters: $(top_builddir)/build/win32/vs10/Makefile
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
cp $(top_srcdir)/build/win32/vs10/$@ $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
else \
cp $(top_builddir)/build/win32/vs10/$@ $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
fi
-5
View File
@@ -1,5 +0,0 @@
include $(top_srcdir)/Makefile.decl
SUBDIRS = win32
-include $(top_srcdir)/git.mk
-222
View File
@@ -1,222 +0,0 @@
# NMake Makefile portion for code generation and
# intermediate build directory creation
# Items in here should not need to be edited unless
# one is maintaining the NMake build files.
!include config-msvc.mak
!include create-lists-msvc.mak
# Copy the pre-defined gdkconfig.h.[win32|win32_broadway]
!if "$(CFG)" == "release" || "$(CFG)" == "Release"
GDK_OLD_CFG = debug
!else
GDK_OLD_CFG = release
!endif
!ifdef BROADWAY
GDK_CONFIG = broadway
GDK_DEL_CONFIG = win32
GDK_CONFIG_TEMPLATE = ..\..\gdk\gdkconfig.h.win32_broadway
!else
GDK_CONFIG = win32
GDK_DEL_CONFIG = broadway
GDK_CONFIG_TEMPLATE = ..\..\gdk\gdkconfig.h.win32
!endif
GDK_MARSHALERS_FLAGS = --prefix=_gdk_marshal --valist-marshallers
GDK_RESOURCES_ARGS = ..\..\gdk\gdk.gresource.xml --target=$@ --sourcedir=..\..\gdk --c-name _gdk --manual-register
GTK_MARSHALERS_FLAGS = --prefix=_gtk_marshal --valist-marshallers
GTK_RESOURCES_ARGS = ..\..\gtk\gtk.gresource.xml --target=$@ --sourcedir=..\..\gtk --c-name _gtk --manual-register
all: \
..\..\config.h \
..\..\gdk\gdkconfig.h \
..\..\gdk\gdkversionmacros.h \
..\..\gdk\gdkmarshalers.h \
..\..\gdk\gdkmarshalers.c \
..\..\gdk\gdkresources.h \
..\..\gdk\gdkresources.c \
..\..\gtk\gtk-win32.rc \
..\..\gtk\libgtk3.manifest \
..\..\gtk\gtkdbusgenerated.h \
..\..\gtk\gtkdbusgenerated.c \
..\..\gtk\gtktypefuncs.inc \
..\..\gtk\gtk.gresource.xml \
..\..\gtk\gtkmarshalers.h \
..\..\gtk\gtkmarshalers.c \
..\..\gtk\gtkresources.h \
..\..\gtk\gtkresources.c \
..\..\demos\gtk-demo\demos.h \
..\..\demos\gtk-demo\demo_resources.c \
..\..\demos\icon-browser\resources.c
# Copy the pre-defined config.h.win32 and demos.h.win32
..\..\config.h: ..\..\config.h.win32
..\..\demos\gtk-demo\demos.h: ..\..\demos\gtk-demo\demos.h.win32
..\..\gtk\gtk-win32.rc: ..\..\gtk\gtk-win32.rc.body
..\..\gdk-$(CFG)-$(GDK_CONFIG)-build: $(GDK_CONFIG_TEMPLATE)
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build
@if exist ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build
@copy $** $@
..\..\gdk\gdkconfig.h: ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build
..\..\config.h \
..\..\gdk\gdkconfig.h \
..\..\gtk\gtk-win32.rc \
..\..\demos\gtk-demo\demos.h:
@echo Copying $@...
@copy $** $@
..\..\gdk\gdkversionmacros.h: ..\..\gdk\gdkversionmacros.h.in
@echo Generating $@...
@$(PYTHON) gen-gdkversionmacros-h.py --version=$(GTK_VERSION)
..\..\gdk\gdkmarshalers.h: ..\..\gdk\gdkmarshalers.list
@echo Generating $@...
@$(PYTHON) $(GLIB_GENMARSHAL) $(GDK_MARSHALERS_FLAGS) --header $** > $@.tmp
@move $@.tmp $@
..\..\gdk\gdkmarshalers.c: ..\..\gdk\gdkmarshalers.list
@echo Generating $@...
@$(PYTHON) $(GLIB_GENMARSHAL) $(GDK_MARSHALERS_FLAGS) --body $** > $@.tmp
@move $@.tmp $@
..\..\gdk\gdk.gresource.xml: $(GDK_RESOURCES)
@echo Generating $@...
@echo ^<?xml version='1.0' encoding='UTF-8'?^> >$@
@echo ^<gresources^> >> $@
@echo ^<gresource prefix='/org/gtk/libgdk'^> >> $@
@for %%f in (..\..\gdk\resources\glsl\*.glsl) do @echo ^<file alias='glsl/%%~nxf'^>resources/glsl/%%~nxf^</file^> >> $@
@echo ^</gresource^> >> $@
@echo ^</gresources^> >> $@
..\..\gdk\gdkresources.h: ..\..\gdk\gdk.gresource.xml
@echo Generating $@...
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
@$(GLIB_COMPILE_RESOURCES) $(GDK_RESOURCES_ARGS) --generate-header
..\..\gdk\gdkresources.c: ..\..\gdk\gdk.gresource.xml $(GDK_RESOURCES)
@echo Generating $@...
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
@$(GLIB_COMPILE_RESOURCES) $(GDK_RESOURCES_ARGS) --generate-source
..\..\gtk\libgtk3.manifest: ..\..\gtk\libgtk3.manifest.in
@echo Generating $@...
@$(PYTHON) replace.py \
--action=replace-var \
--input=$** --output=$@ \
--var=EXE_MANIFEST_ARCHITECTURE \
--outstring=*
..\..\gtk\gtkdbusgenerated.h ..\..\gtk\gtkdbusgenerated.c: ..\..\gtk\gtkdbusinterfaces.xml
@echo Generating GTK DBus sources...
@$(PYTHON) $(PREFIX)\bin\gdbus-codegen \
--interface-prefix org.Gtk. --c-namespace _Gtk \
--generate-c-code gtkdbusgenerated $** \
--output-directory $(@D)
..\..\gtk\gtktypefuncs.inc: ..\..\gtk\gentypefuncs.py
@echo Generating $@...
@echo #undef GTK_COMPILATION > $(@R).preproc.c
@echo #include "gtkx.h" >> $(@R).preproc.c
@cl /EP $(GTK_PREPROCESSOR_FLAGS) $(@R).preproc.c > $(@R).combined.c
@$(PYTHON) $** $@ $(@R).combined.c
@del $(@R).preproc.c $(@R).combined.c
..\..\gtk\gtk.gresource.xml: $(GTK_RESOURCES)
@echo Generating $@...
@echo ^<?xml version='1.0' encoding='UTF-8'?^>> $@
@echo ^<gresources^>>> $@
@echo ^<gresource prefix='/org/gtk/libgtk'^>>> $@
@echo ^<file^>theme/Adwaita/gtk.css^</file^>>> $@
@echo ^<file^>theme/Adwaita/gtk-dark.css^</file^>>> $@
@echo ^<file^>theme/Adwaita/gtk-contained.css^</file^>>> $@
@echo ^<file^>theme/Adwaita/gtk-contained-dark.css^</file^>>> $@
@for %%f in (..\..\gtk\theme\Adwaita\assets\*.png) do @echo ^<file preprocess='to-pixdata'^>theme/Adwaita/assets/%%~nxf^</file^>>> $@
@for %%f in (..\..\gtk\theme\Adwaita\assets\*.svg) do @echo ^<file^>theme/Adwaita/assets/%%~nxf^</file^>>> $@
@echo ^<file^>theme/HighContrast/gtk.css^</file^>>> $@
@echo ^<file alias='theme/HighContrastInverse/gtk.css'^>theme/HighContrast/gtk-inverse.css^</file^>>> $@
@echo ^<file^>theme/HighContrast/gtk-contained.css^</file^>>> $@
@echo ^<file^>theme/HighContrast/gtk-contained-inverse.css^</file^>>> $@
@for %%f in (..\..\gtk\theme\HighContrast\assets\*.png) do @echo ^<file preprocess='to-pixdata'^>theme/HighContrast/assets/%%~nxf^</file^>>> $@
@for %%f in (..\..\gtk\theme\HighContrast\assets\*.svg) do @echo ^<file^>theme/HighContrast/assets/%%~nxf^</file^>>> $@
@echo ^<file^>theme/win32/gtk-win32-base.css^</file^>>> $@
@echo ^<file^>theme/win32/gtk.css^</file^>>> $@
@for %%f in (..\..\gtk\cursor\*.png) do @echo ^<file^>cursor/%%~nxf^</file^>>> $@
@for %%f in (..\..\gtk\gesture\*.symbolic.png) do @echo ^<file alias='icons/64x64/actions/%%~nxf'^>gesture/%%~nxf^</file^>>> $@
@for %%f in (..\..\gtk\ui\*.ui) do @echo ^<file preprocess='xml-stripblanks'^>ui/%%~nxf^</file^>>> $@
@for %%s in (16 22 24 32 48) do @(for %%c in (actions status categories) do @(for %%f in (..\..\gtk\icons\%%sx%%s\%%c\*.png) do @echo ^<file^>icons/%%sx%%s/%%c/%%~nxf^</file^>>> $@))
@for %%s in (scalable) do @(for %%c in (status) do @(for %%f in (..\..\gtk\icons\%%s\%%c\*.svg) do @echo ^<file^>icons/%%s/%%c/%%~nxf^</file^>>> $@))
@for %%f in (..\..\gtk\inspector\*.ui) do @echo ^<file compressed='true' preprocess='xml-stripblanks'^>inspector/%%~nxf^</file^>>> $@
@echo ^<file^>inspector/logo.png^</file^>>> $@
@echo ^<file^>emoji/emoji.data^</file^>>> $@
@echo ^</gresource^>>> $@
@echo ^</gresources^>>> $@
..\..\gtk\gtkresources.h: ..\..\gtk\gtk.gresource.xml
@echo Generating $@...
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
@$(GLIB_COMPILE_RESOURCES) $(GTK_RESOURCES_ARGS) --generate-header
..\..\gtk\gtkresources.c: ..\..\gtk\gtk.gresource.xml $(GTK_RESOURCES)
@echo Generating $@...
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
@$(GLIB_COMPILE_RESOURCES) $(GTK_RESOURCES_ARGS) --generate-source
..\..\gtk\gtkmarshalers.h: ..\..\gtk\gtkmarshalers.list
@echo Generating $@...
@$(PYTHON) $(GLIB_GENMARSHAL) $(GTK_MARSHALERS_FLAGS) --header $** > $@.tmp
@move $@.tmp $@
..\..\gtk\gtkmarshalers.c: ..\..\gtk\gtkmarshalers.list
@echo Generating $@...
@echo #undef G_ENABLE_DEBUG> $@.tmp
@$(PYTHON) $(GLIB_GENMARSHAL) $(GTK_MARSHALERS_FLAGS) --body $** >> $@.tmp
@move $@.tmp $@
..\..\demos\gtk-demo\demo_resources.c: ..\..\demos\gtk-demo\demo.gresource.xml $(GTK_DEMO_RESOURCES)
@echo Generating $@...
@$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(@D) --generate-source $(@D)\demo.gresource.xml
..\..\demos\icon-browser\resources.c: ..\..\demos\icon-browser\iconbrowser.gresource.xml $(ICON_BROWSER_RESOURCES)
@echo Generating $@...
@$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(@D) --generate-source $(@D)\iconbrowser.gresource.xml
# Remove the generated files
clean:
@-del /f /q ..\..\demos\icon-browser\resources.c
@-del /f /q ..\..\demos\gtk-demo\demo_resources.c
@-del /f /q ..\..\demos\gtk-demo\demos.h
@-del /f /q ..\..\gtk\gtkresources.c
@-del /f /q ..\..\gtk\gtkresources.h
@-del /f /q ..\..\gtk\gtkmarshalers.c
@-del /f /q ..\..\gtk\gtkmarshalers.h
@-del /f /q ..\..\gtk\gtk.gresource.xml
@-del /f /q ..\..\gtk\gtktypefuncs.inc
@-del /f /q ..\..\gtk\gtkdbusgenerated.c
@-del /f /q ..\..\gtk\gtkdbusgenerated.h
@-del /f /q ..\..\gtk\libgtk3.manifest
@-del /f /q ..\..\gtk\gtk-win32.rc
@-del /f /q ..\..\gdk\gdkresources.c
@-del /f /q ..\..\gdk\gdkresources.h
@-del /f /q ..\..\gdk\gdk.gresource.xml
@-del /f /q ..\..\gdk\gdkmarshalers.c
@-del /f /q ..\..\gdk\gdkmarshalers.h
@-del /f /q ..\..\gdk\gdkversionmacros.h
@-del /f /q ..\..\gdk\gdkconfig.h
@if exist ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build del ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build
@if exist ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build
@-del /f /q ..\..\config.h
-41
View File
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\gtk\gtk-win32.rc"><Filter>Resource Files</Filter></ResourceCompile>
</ItemGroup>
<ItemGroup>
#include "gtk-3.vs10.sourcefiles.filters"
<ClCompile Include="..\..\..\modules\input\gtkimcontextime.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\gtkimcontextmultipress.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\gtkimcontextthai.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imam-et.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imcedilla.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imcyrillic-translit.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imime.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\iminuktitut.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imipa.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\immultipress.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imthai.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imti-er.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imti-et.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\imviqr.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\input\thai-charprop.c"><Filter>Source Files</Filter></ClCompile>
</ItemGroup>
<ItemGroup>
<Manifest Include="..\..\..\gtk\libgtk3.manifest"><Filter>Resource Files</Filter></Manifest>
</ItemGroup>
</Project>
+200
View File
@@ -0,0 +1,200 @@
#!/usr/bin/env python3
import re
import sys
try:
configure_ac = sys.argv[1]
except Exception:
configure_ac = 'configure.ac'
try:
meson_build = sys.argv[2]
except Exception:
meson_build = 'meson.build'
CONFIGURE_MAJOR_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_major_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_MINOR_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_minor_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_MICRO_VERSION_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_micro_version\]
\s*
,
\s*
\[
(?P<version>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
CONFIGURE_INTERFACE_AGE_RE = re.compile(
r'''
^
\s*
m4_define\(
\s*
\[gtk_interface_age\]
\s*
,
\s*
\[
(?P<age>[0-9]+)
\]
\s*
\)
$
''',
re.UNICODE | re.VERBOSE
)
MESON_VERSION_RE = re.compile(
r'''
^
\s*
version
\s*
:{1}
\s*
\'{1}
(?P<major>[0-9]+)
\.{1}
(?P<minor>[0-9]+)
\.{1}
(?P<micro>[0-9]+)
\'{1}
\s*
,?
$
''',
re.UNICODE | re.VERBOSE
)
MESON_INTERFACE_AGE_RE = re.compile(
r'''
^\s*gtk_interface_age\s*={1}\s*(?P<age>[0-9]+)\s*$
''',
re.UNICODE | re.VERBOSE
)
version = {}
with open(configure_ac, 'r') as f:
line = f.readline()
while line:
res = CONFIGURE_MAJOR_VERSION_RE.match(line)
if res:
if 'major' in version:
print(f'Redefinition of major version; version is already set to {version["major"]}')
sys.exit(1)
version['major'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_MINOR_VERSION_RE.match(line)
if res:
if 'minor' in version:
print(f'Redefinition of minor version; version is already set to {version["minor"]}')
sys.exit(1)
version['minor'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_MICRO_VERSION_RE.match(line)
if res:
if 'micro' in version:
print(f'Redefinition of micro version; version is already set to {version["micro"]}')
sys.exit(1)
version['micro'] = res.group('version')
line = f.readline()
continue
res = CONFIGURE_INTERFACE_AGE_RE.match(line)
if res:
if 'age' in version:
print(f'Redefinition of interface age; age is already set to {version["age"]}')
sys.exit(1)
version['age'] = res.group('age')
line = f.readline()
continue
if ('major', 'minor', 'micro', 'age') in version:
break
line = f.readline()
print(f'GTK version defined in {configure_ac}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
configure_version = version
version = {}
with open(meson_build, 'r') as f:
line = f.readline()
inside_project = False
while line:
if line.startswith('project('):
inside_project = True
if inside_project:
res = MESON_VERSION_RE.match(line)
if res:
version['major'] = res.group('major')
version['minor'] = res.group('minor')
version['micro'] = res.group('micro')
if inside_project and line.endswith(')'):
inside_project = False
res = MESON_INTERFACE_AGE_RE.match(line)
if res:
version['age'] = res.group('age')
if ('major', 'minor', 'micro', 'age') in version:
break
line = f.readline()
print(f'GTK version defined in {meson_build}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
meson_version = version
if configure_version != meson_version:
print('Version mismatch between Autotools and Meson builds')
sys.exit(1)
sys.exit(0)
+6
View File
@@ -44,6 +44,9 @@
/* Define to 1 if you have the `flockfile' function. */
#mesondefine HAVE_FLOCKFILE
/* Define to 1 if you have the `fmin' function. */
#mesondefine HAVE_FMIN
/* Define to 1 if you have the <ftw.h> header file. */
#mesondefine HAVE_FTW_H
@@ -281,3 +284,6 @@
#mesondefine GTK_LOCALEDIR
#mesondefine ISO_CODES_PREFIX
/* Define if tracker3 is available */
#mesondefine HAVE_TRACKER3
+5
View File
@@ -52,6 +52,11 @@
/* Define to 1 if you have the `flockfile' function. */
#undef HAVE_FLOCKFILE
/* Define to 1 if you have the `fmin' function. */
#if !defined (_MSC_VER) || (_MSC_VER >= 1800)
# define HAVE_FMIN 1
#endif
/* Define to 1 if you have the <ftw.h> header file. */
/* #undef HAVE_FTW_H */
+41 -18
View File
@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [24])
m4_define([gtk_micro_version], [13])
m4_define([gtk_interface_age], [9])
m4_define([gtk_micro_version], [26])
m4_define([gtk_interface_age], [22])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -56,12 +56,12 @@ GLIB_VERSION_CFLAGS="-DGLIB_MIN_REQUIRED_VERSION=glib_min_required_version -DGLI
m4_define([pango_required_version], [1.41.0])
m4_define([fribidi_required_version], [0.19.7])
m4_define([atk_required_version], [2.15.1])
m4_define([atk_required_version], [2.32.0])
m4_define([cairo_required_version], [1.14.0])
m4_define([gdk_pixbuf_required_version], [2.30.0])
m4_define([introspection_required_version], [1.39.0])
m4_define([wayland_required_version], [1.9.91])
m4_define([wayland_protocols_required_version], [1.14])
m4_define([wayland_required_version], [1.14.91])
m4_define([wayland_protocols_required_version], [1.17])
m4_define([epoxy_required_version], [1.4])
m4_define([cloudproviders_required_version], [0.2.5])
m4_define([sysprof_required_version], [3.33.2])
@@ -843,7 +843,7 @@ AC_TYPE_UID_T
# Check for round(), rint(), isnan() and isinf()
# Check for log2(), exp2(), nearbyint() and trunc()
AC_CHECK_LIB(m,round,,)
AC_CHECK_FUNCS(round rint nearbyint sincos exp2 log2 trunc)
AC_CHECK_FUNCS(round rint nearbyint sincos exp2 log2 trunc fmin)
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
AC_MSG_CHECKING(whether to build dynamic modules)
@@ -1552,6 +1552,30 @@ else
fi
fi
# Checks to see if we should compile with tracker3 search engine
#
AC_ARG_ENABLE(tracker3,
[AS_HELP_STRING([--enable-tracker3],
[enable tracker3 search engine])],
[enable_tracker3=yes],
[enable_tracker3=no])
if test "x$enable_tracker3" = "xyes"; then
PKG_CHECK_MODULES(TRACKER3, [tracker-sparql-3.0], have_tracker3=yes, have_tracker3=no)
GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $TRACKER3_CFLAGS"
GTK_DEP_LIBS="$GTK_DEP_LIBS $TRACKER3_LIBS"
if test "x$have_tracker3" = "xyes"; then
AC_DEFINE([HAVE_TRACKER3], [], [Define if tracker3 is available])
else
AC_MSG_ERROR([
*** tracker3 not found.
])
fi
fi
AM_CONDITIONAL(HAVE_TRACKER3, test "x$have_tracker3" = "xyes")
# Checks to see if we should compile with cloudprint backend for GTK+
#
@@ -1940,18 +1964,17 @@ docs/reference/gtk/getting_started.xml
docs/reference/libgail-util/Makefile
docs/reference/libgail-util/version.xml
docs/tools/Makefile
build/Makefile
build/win32/Makefile
build/win32/config-msvc.mak
build/win32/vs9/Makefile
build/win32/vs9/gtk3-version-paths.vsprops
build/win32/vs10/Makefile
build/win32/vs10/gtk3-version-paths.props
build/win32/vs11/Makefile
build/win32/vs12/Makefile
build/win32/vs14/Makefile
build/win32/vs15/Makefile
build/win32/vs16/Makefile
win32/Makefile
win32/config-msvc.mak
win32/vs9/Makefile
win32/vs9/gtk3-version-paths.vsprops
win32/vs10/Makefile
win32/vs10/gtk3-version-paths.props
win32/vs11/Makefile
win32/vs12/Makefile
win32/vs14/Makefile
win32/vs15/Makefile
win32/vs16/Makefile
gdk/Makefile
gdk/broadway/Makefile
gdk/x11/Makefile
+4 -3
View File
@@ -116,6 +116,7 @@ EXTRA_DIST += \
data/symbolic-source.svg \
demo.gresource.xml \
$(resource_files) \
makefile.msc.in \
org.gtk.Demo.gschema.xml \
demos.h.win32 \
meson.build \
@@ -195,11 +196,11 @@ gtk3_demo_EXCLUDES = font_features.c|pagesetup.c
gtk3_demo_application_FILES = $(gtk3_demo_application_SOURCES)
gtk3_demo_application_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
include $(top_srcdir)/win32/Makefile.msvcproj
dist-hook: \
$(top_builddir)/build/win32/vs9/gtk3-demo.vcproj \
$(top_builddir)/build/win32/vs9/gtk3-demo-application.vcproj
$(top_builddir)/win32/vs9/gtk3-demo.vcproj \
$(top_builddir)/win32/vs9/gtk3-demo-application.vcproj
DISTCLEANFILES = demos.h demos.h.win32
+4 -3
View File
@@ -96,11 +96,12 @@ drawing_area_draw (GtkWidget *widget,
cairo_pattern_t *pat;
cairo_matrix_t matrix;
gdouble angle, scale;
gdouble x_center, y_center;
gtk_gesture_get_bounding_box_center (GTK_GESTURE (zoom), &x_center, &y_center);
cairo_get_matrix (cr, &matrix);
cairo_matrix_translate (&matrix,
allocation.width / 2,
allocation.height / 2);
cairo_matrix_translate (&matrix, x_center, y_center);
cairo_save (cr);
+1
View File
@@ -97,6 +97,7 @@ do_infobar (GtkWidget *do_widget)
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0);
gtk_info_bar_set_default_response (GTK_INFO_BAR (bar), GTK_RESPONSE_OK);
button = gtk_toggle_button_new_with_label ("Question");
g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL);
+2 -2
View File
@@ -43,8 +43,8 @@ MSVCPROJS = gtk3-icon-browser
gtk3_icon_browser_FILES = $(gtk3_icon_browser_SOURCES)
gtk3_icon_browser_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
include $(top_srcdir)/win32/Makefile.msvcproj
dist-hook: $(top_builddir)/build/win32/vs9/gtk3-icon-browser.vcproj
dist-hook: $(top_builddir)/win32/vs9/gtk3-icon-browser.vcproj
-include $(top_srcdir)/git.mk
+70
View File
@@ -1655,6 +1655,66 @@ adjustment3_value_changed (GtkAdjustment *adj, GtkProgressBar *pbar)
gtk_progress_bar_set_fraction (pbar, fraction);
}
static void
validate_more_details (GtkEntry *entry,
GParamSpec *pspec,
GtkEntry *details)
{
if (strlen (gtk_entry_get_text (entry)) > 0 &&
strlen (gtk_entry_get_text (details)) == 0)
{
gtk_widget_set_tooltip_text (GTK_WIDGET (entry), "Must have details first");
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (entry)), "error");
}
else
{
gtk_widget_set_tooltip_text (GTK_WIDGET (entry), "");
gtk_style_context_remove_class (gtk_widget_get_style_context (GTK_WIDGET (entry)), "error");
}
}
static gboolean
mode_switch_state_set (GtkSwitch *sw, gboolean state)
{
GtkWidget *dialog = gtk_widget_get_ancestor (GTK_WIDGET (sw), GTK_TYPE_DIALOG);
GtkWidget *scale = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "level_scale"));
GtkWidget *label = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "error_label"));
if (!state ||
(gtk_range_get_value (GTK_RANGE (scale)) > 50))
{
gtk_widget_hide (label);
gtk_switch_set_state (sw, state);
}
else
{
gtk_widget_show (label);
}
return TRUE;
}
static void
level_scale_value_changed (GtkRange *range)
{
GtkWidget *dialog = gtk_widget_get_ancestor (GTK_WIDGET (range), GTK_TYPE_DIALOG);
GtkWidget *sw = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "mode_switch"));
GtkWidget *label = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "error_label"));
if (gtk_switch_get_active (GTK_SWITCH (sw)) &&
!gtk_switch_get_state (GTK_SWITCH (sw)) &&
(gtk_range_get_value (range) > 50))
{
gtk_widget_hide (label);
gtk_switch_set_state (GTK_SWITCH (sw), TRUE);
}
else if (gtk_switch_get_state (GTK_SWITCH (sw)) &&
(gtk_range_get_value (range) <= 50))
{
gtk_switch_set_state (GTK_SWITCH (sw), FALSE);
}
}
static void
activate (GApplication *app)
{
@@ -1722,6 +1782,9 @@ activate (GApplication *app)
gtk_builder_add_callback_symbol (builder, "reset_icon_size", (GCallback)reset_icon_size);
gtk_builder_add_callback_symbol (builder, "scale_format_value", (GCallback)scale_format_value);
gtk_builder_add_callback_symbol (builder, "scale_format_value_blank", (GCallback)scale_format_value_blank);
gtk_builder_add_callback_symbol (builder, "validate_more_details", (GCallback)validate_more_details);
gtk_builder_add_callback_symbol (builder, "mode_switch_state_set", (GCallback)mode_switch_state_set);
gtk_builder_add_callback_symbol (builder, "level_scale_value_changed", (GCallback)level_scale_value_changed);
gtk_builder_connect_signals (builder, NULL);
@@ -1820,6 +1883,13 @@ activate (GApplication *app)
widget = (GtkWidget *)gtk_builder_get_object (builder, "circular_button");
g_signal_connect (widget, "clicked", G_CALLBACK (show_dialog), dialog);
widget = (GtkWidget *)gtk_builder_get_object (builder, "level_scale");
g_object_set_data (G_OBJECT (dialog), "level_scale", widget);
widget = (GtkWidget *)gtk_builder_get_object (builder, "mode_switch");
g_object_set_data (G_OBJECT (dialog), "mode_switch", widget);
widget = (GtkWidget *)gtk_builder_get_object (builder, "error_label");
g_object_set_data (G_OBJECT (dialog), "error_label", widget);
dialog = (GtkWidget *)gtk_builder_get_object (builder, "selection_dialog");
g_object_set_data (G_OBJECT (window), "selection_dialog", dialog);
widget = (GtkWidget *)gtk_builder_get_object (builder, "text3");
+21
View File
@@ -3989,6 +3989,7 @@ bad things might happen.</property>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
<property name="width">2</property>
</packing>
</child>
<child>
@@ -4012,10 +4013,12 @@ bad things might happen.</property>
<object class="GtkEntry" id="more_details_entry">
<property name="visible">1</property>
<property name="valign">baseline</property>
<signal name="notify::text" handler="validate_more_details" object="details_entry" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
<property name="width">2</property>
</packing>
</child>
<child>
@@ -4041,10 +4044,12 @@ bad things might happen.</property>
<property name="valign">baseline</property>
<property name="draw-value">0</property>
<property name="adjustment">adjustment1</property>
<signal name="value-changed" handler="level_scale_value_changed"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
<property name="width">2</property>
</packing>
</child>
<child>
@@ -4069,12 +4074,28 @@ bad things might happen.</property>
<property name="visible">1</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<signal name="state-set" handler="mode_switch_state_set"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="error_label">
<property name="visible">0</property>
<property name="halign">start</property>
<property name="valign">baseline</property>
<property name="label">Level too low</property>
<style>
<class name="error"/>
</style>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">3</property>
</packing>
</child>
</object>
</child>
</object>
+1
View File
@@ -8,6 +8,7 @@ EXTRA_DIST += \
developers.txt \
dnd_internals.txt \
focus_tracking.txt \
iconcache.txt \
RELEASE-HOWTO \
sizing-test.txt \
styles.txt \
+2
View File
@@ -1279,6 +1279,8 @@ GdkWaylandWindowExported
gdk_wayland_window_export_handle
gdk_wayland_window_unexport_handle
gdk_wayland_window_set_transient_for_exported
gdk_wayland_window_add_frame_callback_surface
gdk_wayland_window_remove_frame_callback_surface
<SUBSECTION Standard>
GDK_TYPE_WAYLAND_DEVICE
+1
View File
@@ -385,6 +385,7 @@ HTML_IMAGES = \
$(srcdir)/images/pagesetupdialog.png \
$(srcdir)/images/placessidebar.png \
$(srcdir)/images/popup-anchors.png \
$(srcdir)/images/popup-at.svg \
$(srcdir)/images/popup-flip.png \
$(srcdir)/images/popup-slide.png \
$(srcdir)/images/printdialog.png \
+9
View File
@@ -229,6 +229,15 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
<entry></entry>
<entry></entry>
</row>
<row>
<entry><phrase role="nowrap">font-feature-settings</phrase></entry>
<entry><code>〈feature-tag-value〉&num; </code></entry>
<entry>""</entry>
<entry></entry>
<entry>></entry>
<entry><ulink url="https://www.w3.org/TR/css3-fonts/#font-feature-settings-prop">CSS3</ulink></entry>
<entry></entry>
</row>
</tbody>
</tgroup>
<tgroup cols="5">
+5 -5
View File
@@ -36,7 +36,7 @@ How do I get started with GTK+?
<answer><para>
The GTK+ <ulink url="https://www.gtk.org">website</ulink> offers some
<ulink url="https://www.gtk.org/documentation.php">tutorials</ulink> and other
<ulink url="https://www.gtk.org/docs/">tutorials</ulink> and other
documentation (most of it about GTK+ 2.x, but mostly still applicable).
More documentation ranging from whitepapers to online books can be found at
the <ulink url="https://developer.gnome.org">GNOME developer's site</ulink>.
@@ -77,7 +77,7 @@ specific widgets and functions.
<para>
If you have a question not covered in the manual, feel free to
ask on the mailing lists and please <ulink
url="https://bugzilla.gnome.org">file a bug report</ulink> against the
url="https://gitlab.gnome.org/GNOME/gtk/issues/new">file a bug report</ulink> against the
documentation.
</para>
@@ -105,8 +105,8 @@ state (explained in its documentation).
For strings returned from functions, they will be declared "const"
if they should not be freed. Non-const strings should be
freed with g_free(). Arrays follow the same rule. If you find an
undocumented exception to the rules, please report a bug to <ulink
url="https://bugzilla.gnome.org">https://bugzilla.gnome.org</ulink>.
undocumented exception to the rules, please report a bug on <ulink
url="https://gitlab.gnome.org/GNOME/gtk/issues/new">GitLab</ulink>.
</para>
</answer>
@@ -415,7 +415,7 @@ How do I use GTK+ with other non-C languages?
<answer>
<para>
See the <ulink url="https://www.gtk.org/language-bindings.php">list of language
See the <ulink url="https://www.gtk.org/docs/language-bindings/">list of language
bindings</ulink> on <ulink
url="https://www.gtk.org">https://www.gtk.org</ulink>.
</para>
+3 -3
View File
@@ -134,9 +134,9 @@ additional environment variables.
<title><envar>GTK_DEBUG</envar></title>
<para>
Unless GTK+ has been configured with <option>--enable-debug=no</option>,
this variable can be set to a list of debug options, which cause GTK+
to print out different types of debugging information.
This variable can be set to a list of debug options, which cause GTK to
print out different types of debugging information. Some of these options
are only available when GTK has been configured with <option>--enable-debug=yes</option>.
<variablelist>
<varlistentry>
<term>actions</term>
+1
View File
@@ -18,6 +18,7 @@ exampleapp_SOURCES = \
exampleappwin.c exampleappwin.h
EXTRA_DIST = \
exampleapp.desktop \
meson.build
-include $(top_srcdir)/git.mk
+12 -12
View File
@@ -471,7 +471,7 @@ stamp-gc-h: $(top_builddir)/config.status
# Resources
#
glsl_sources := $(wildcard $(srcdir)/resources/glsl/*.glsl)
glsl_sources := $(sort $(wildcard $(srcdir)/resources/glsl/*.glsl))
gdk.gresource.xml: Makefile.am
$(AM_V_GEN) echo "<?xml version='1.0' encoding='UTF-8'?>" > $@; \
@@ -491,10 +491,10 @@ resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --gener
gdkresources.h: gdk.gresource.xml
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \
--sourcedir=$(srcdir) --c-name _gdk --generate-header --manual-register
--sourcedir=$(srcdir) --c-name _gdk --generate-header --manual-register --internal
gdkresources.c: gdk.gresource.xml $(resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \
--sourcedir=$(srcdir) --c-name _gdk --generate-source --manual-register
--sourcedir=$(srcdir) --c-name _gdk --generate-source --manual-register --internal
# ------------------- MSVC Build Items ----------------
MSVCPROJS = gdk-3
@@ -510,7 +510,7 @@ gdk_3_HEADERS_INST = \
gdk_3_HEADERS_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
include $(top_srcdir)/win32/Makefile.msvcproj
if HAVE_INTROSPECTION
# Introspection Items for MSVC
@@ -518,13 +518,13 @@ MSVC_INTROSPECT_GIRS = Gdk-3.0.gir GdkWin32-3.0.gir
BASE_MSVC_GIR_CFLAGS = \
$(GDK_CFLAGS_DEFINES) \
-I../.. -I../../gdk -I.../../gdk/win32
-I.. -I../gdk -I../gdk/win32
INTROSPECTION_INTERMEDIATE_ITEMS = \
$(top_builddir)/build/win32/Gdk-3.0.gir.msvc.introspect \
$(top_builddir)/build/win32/Gdk_3_0_gir_list \
$(top_builddir)/build/win32/GdkWin32-3.0.gir.msvc.introspect \
$(top_builddir)/build/win32/GdkWin32_3_0_gir_list
$(top_builddir)/win32/Gdk-3.0.gir.msvc.introspect \
$(top_builddir)/win32/Gdk_3_0_gir_list \
$(top_builddir)/win32/GdkWin32-3.0.gir.msvc.introspect \
$(top_builddir)/win32/GdkWin32_3_0_gir_list
Gdk_3_0_gir_MSVC_FILES = $(introspection_files)
Gdk_3_0_gir_MSVC_EXPORT_PACKAGES = $(Gdk_3_0_gir_EXPORT_PACKAGES)
@@ -542,15 +542,15 @@ GdkWin32_3_0_gir_MSVC_SCANNERFLAGS = \
--c-include="gdk/gdkwin32.h" \
--include-uninstalled='./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin/Gdk-3.0.gir'
include $(top_srcdir)/build/Makefile.msvc-introspection
include $(top_srcdir)/win32/Makefile.msvc-introspection
else
INTROSPECTION_INTERMEDIATE_ITEMS =
endif
dist-hook: \
$(top_builddir)/build/win32/vs9/gdk-3.vcproj \
$(top_builddir)/build/win32/vs9/gdk-3.headers \
$(top_builddir)/win32/vs9/gdk-3.vcproj \
$(top_builddir)/win32/vs9/gdk-3.headers \
$(INTROSPECTION_INTERMEDIATE_ITEMS)
DISTCLEANFILES = gdkconfig.h stamp-gc-h
+4 -4
View File
@@ -126,11 +126,11 @@ gdk3_broadway_HEADERS_EXCLUDES = dummy
broadwayd_FILES = $(broadwayd_SOURCES)
broadwayd_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
include $(top_srcdir)/win32/Makefile.msvcproj
dist-hook: \
$(top_builddir)/build/win32/vs9/gdk3-broadway.vcproj \
$(top_builddir)/build/win32/vs9/broadwayd.vcproj \
$(top_builddir)/build/win32/vs9/gdk3-broadway.headers
$(top_builddir)/win32/vs9/gdk3-broadway.vcproj \
$(top_builddir)/win32/vs9/broadwayd.vcproj \
$(top_builddir)/win32/vs9/gdk3-broadway.headers
-include $(top_srcdir)/git.mk
+142 -20
View File
@@ -1,3 +1,27 @@
/* check if we are on Android and using Chrome */
var isAndroidChrome = false;
{
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("android") > -1 && ua.indexOf("chrom") > -1) {
isAndroidChrome = true;
}
}
/* check for the passive option for Event listener */
let passiveSupported = false;
try {
const options = {
get passive() { // This function will be called when the browser
// attempts to access the passive property.
passiveSupported = true;
return false;
}
};
window.addEventListener("test", null, options);
window.removeEventListener("test", null, options);
} catch(err) {
passiveSupported = false;
}
/* Helper functions for debugging */
var logDiv = null;
function log(str) {
@@ -10,6 +34,25 @@ function log(str) {
logDiv.appendChild(document.createTextNode(str));
logDiv.appendChild(document.createElement('br'));
}
/* Helper functions for touch identifier to make it unique on Android */
var globalTouchIdentifier = Math.round(Date.now() / 1000);
function touchIdentifierStart(tId)
{
if (isAndroidChrome) {
if (tId == 0) {
return ++globalTouchIdentifier;
}
return globalTouchIdentifier + tId;
}
return tId;
}
function touchIdentifier(tId)
{
if (isAndroidChrome) {
return globalTouchIdentifier + tId;
}
return tId;
}
function getStackTrace()
{
@@ -91,6 +134,7 @@ grab.window = null;
grab.ownerEvents = false;
grab.implicit = false;
var keyDownList = [];
var inputList = [];
var lastSerial = 0;
var lastX = 0;
var lastY = 0;
@@ -223,6 +267,7 @@ function cmdSetTransientFor(id, parentId)
{
var surface = surfaces[id];
if (surface === undefined) return;
if (surface.transientParent == parentId)
return;
@@ -253,8 +298,9 @@ function moveToHelper(surface, position) {
for (var cid in surfaces) {
var child = surfaces[cid];
if (child.transientParent == surface.id)
if (child.transientParent == surface.id) {
moveToHelper(child, stackingOrder.indexOf(surface) + 1);
}
}
}
@@ -269,6 +315,13 @@ function cmdDeleteSurface(id)
stackingOrder.splice(i, 1);
var canvas = surface.canvas;
canvas.parentNode.removeChild(canvas);
if (id == windowWithMouse) {
windowWithMouse = 0;
}
if (id == realWindowWithMouse) {
realWindowWithMouse = 0;
firstTouchDownId = null;
}
delete surfaces[id];
}
@@ -307,6 +360,7 @@ function cmdRaiseSurface(id)
{
var surface = surfaces[id];
if (surface === undefined) return;
moveToHelper(surface);
restackWindows();
}
@@ -315,6 +369,7 @@ function cmdLowerSurface(id)
{
var surface = surfaces[id];
if (surface === undefined) return;
moveToHelper(surface, 0);
restackWindows();
}
@@ -520,6 +575,7 @@ function cmdPutBuffer(id, w, h, compressed)
var data = inflate.decompress();
var imageData = decodeBuffer (context, surface.imageData, w, h, data, debugDecoding);
context.imageSmoothingEnabled = false;
context.putImageData(imageData, 0, 0);
if (debugDecoding)
@@ -776,8 +832,15 @@ function getEffectiveEventTarget (id) {
function updateKeyboardStatus() {
if (fakeInput != null && showKeyboardChanged) {
showKeyboardChanged = false;
if (showKeyboard)
if (showKeyboard) {
if (isAndroidChrome) {
fakeInput.blur();
fakeInput.value = ' '.repeat(80); // TODO: Should be exchange with broadway server
// to bring real value here.
}
fakeInput.focus();
//if (isAndroidChrome) fakeInput.click();
}
else
fakeInput.blur();
}
@@ -2329,6 +2392,19 @@ function pushKeyEvent(fev) {
keyDownList.push(fev);
}
function copyInputEvent(ev) {
var members = ['inputType', 'data'], i, obj = {};
for (i = 0; i < members.length; i++) {
if (typeof ev[members[i]] !== "undefined")
obj[members[i]] = ev[members[i]];
}
return obj;
}
function pushInputEvent(fev) {
inputList.push(fev);
}
function getKeyEvent(keyCode, pop) {
var i, fev = null;
for (i = keyDownList.length-1; i >= 0; i--) {
@@ -2366,8 +2442,9 @@ function handleKeyDown(e) {
// If it is a key or key combination that might trigger
// browser behaviors or it has no corresponding keyPress
// event, then send it immediately
if (!ignoreKeyEvent(ev))
if (!ignoreKeyEvent(ev)) {
sendInput("k", [keysym, lastState]);
}
suppress = true;
}
@@ -2411,8 +2488,9 @@ function handleKeyPress(e) {
}
// Send the translated keysym
if (keysym > 0)
if (keysym > 0) {
sendInput ("k", [keysym, lastState]);
}
// Stop keypress events just in case
return cancelEvent(ev);
@@ -2427,11 +2505,45 @@ function handleKeyUp(e) {
keysym = fev.keysym;
else {
//log("Key event (keyCode = " + ev.keyCode + ") not found on keyDownList");
if (isAndroidChrome && (ev.keyCode == 229)) {
var i, fev = null, len = inputList.length, str;
for (i = 0; i < len; i++) {
fev = inputList[i];
switch(fev.inputType) {
case "deleteContentBackward":
sendInput ("k", [65288, lastState]);
sendInput ("K", [65288, lastState]);
break;
case "insertText":
if (fev.data !== undefined) {
for (let sym of fev.data) {
sendInput ("k", [sym.codePointAt(0), lastState]);
sendInput ("K", [sym.codePointAt(0), lastState]);
}
}
break;
default:
break;
}
}
inputList.splice(0, len);
}
keysym = 0;
}
if (keysym > 0)
if (keysym > 0) {
sendInput ("K", [keysym, lastState]);
}
return cancelEvent(ev);
}
function handleInput (e) {
var fev = null, ev = (e ? e : window.event), keysym = null, suppress = false;
fev = copyInputEvent(ev);
pushInputEvent(fev);
// Stop keypress events just in case
return cancelEvent(ev);
}
@@ -2450,6 +2562,11 @@ function onKeyUp (ev) {
return handleKeyUp(ev);
}
function onInput (ev) {
updateForEvent(ev);
return handleInput(ev);
}
function cancelEvent(ev)
{
ev = ev ? ev : window.event;
@@ -2481,13 +2598,14 @@ function onMouseWheel(ev)
}
function onTouchStart(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifierStart(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
@@ -2495,7 +2613,7 @@ function onTouchStart(ev) {
var isEmulated = 0;
if (firstTouchDownId == null) {
firstTouchDownId = touch.identifier;
firstTouchDownId = touchId;
isEmulated = 1;
if (realWindowWithMouse != origId || id != windowWithMouse) {
@@ -2510,52 +2628,54 @@ function onTouchStart(ev) {
}
}
sendInput ("t", [0, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput ("t", [0, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
function onTouchMove(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifier(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
var pos = getPositionsFromEvent(touch, id);
var isEmulated = 0;
if (firstTouchDownId == touch.identifier) {
if (firstTouchDownId == touchId) {
isEmulated = 1;
}
sendInput ("t", [1, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput ("t", [1, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
function onTouchEnd(ev) {
event.preventDefault();
ev.preventDefault();
updateKeyboardStatus();
updateForEvent(ev);
for (var i = 0; i < ev.changedTouches.length; i++) {
var touch = ev.changedTouches.item(i);
var touchId = touchIdentifier(touch.identifier);
var origId = getSurfaceId(touch);
var id = getEffectiveEventTarget (origId);
var pos = getPositionsFromEvent(touch, id);
var isEmulated = 0;
if (firstTouchDownId == touch.identifier) {
if (firstTouchDownId == touchId) {
isEmulated = 1;
firstTouchDownId = null;
}
sendInput ("t", [2, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
sendInput ("t", [2, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
}
}
@@ -2572,11 +2692,11 @@ function setupDocument(document)
document.onkeyup = onKeyUp;
if (document.addEventListener) {
document.addEventListener('DOMMouseScroll', onMouseWheel, false);
document.addEventListener('mousewheel', onMouseWheel, false);
document.addEventListener('touchstart', onTouchStart, false);
document.addEventListener('touchmove', onTouchMove, false);
document.addEventListener('touchend', onTouchEnd, false);
document.addEventListener('DOMMouseScroll', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('mousewheel', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchstart', onTouchStart, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchmove', onTouchMove, passiveSupported ? { passive: false, capture: false } : false);
document.addEventListener('touchend', onTouchEnd, passiveSupported ? { passive: false, capture: false } : false);
} else if (document.attachEvent) {
element.attachEvent("onmousewheel", onMouseWheel);
}
@@ -2630,12 +2750,14 @@ function connect()
};
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
if (iOS) {
if (iOS || isAndroidChrome) {
fakeInput = document.createElement("input");
fakeInput.type = "text";
fakeInput.style.position = "absolute";
fakeInput.style.left = "-1000px";
fakeInput.style.top = "-1000px";
document.body.appendChild(fakeInput);
if (isAndroidChrome)
fakeInput.addEventListener('input', onInput, passiveSupported ? { passive: false, capture: false } : false);
}
}
+1
View File
@@ -224,6 +224,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->scroll.y = message->pointer.win_y;
event->scroll.x_root = message->pointer.root_x;
event->scroll.y_root = message->pointer.root_y;
event->scroll.state = message->pointer.state;
event->scroll.direction = message->scroll.dir == 0 ? GDK_SCROLL_UP : GDK_SCROLL_DOWN;
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
-8
View File
@@ -104,14 +104,6 @@
* Use this macro to guard code that is specific to the Wayland backend.
*/
/**
* GDK_DISABLE_DEPRECATION_WARNINGS:
*
* A macro that should be defined before including the gdk.h header.
* If it is defined, no compiler warnings will be produced for uses
* of deprecated GDK APIs.
*/
typedef struct _GdkPredicate GdkPredicate;
struct _GdkPredicate
+1 -1
View File
@@ -226,7 +226,7 @@ gdk_cursor_get_cursor_type (GdkCursor *cursor)
*
* Creates a new cursor from the set of builtin cursors.
*
* Returns: a new #GdkCursor
* Returns: (nullable) (transfer full): a new #GdkCursor, or %NULL on failure
*
* Since: 2.2
**/
+1
View File
@@ -278,6 +278,7 @@ free_pointer_info (GdkPointerWindowInfo *info)
{
if (info->toplevel_under_pointer)
g_object_unref (info->toplevel_under_pointer);
g_clear_object (&info->last_slave);
g_slice_free (GdkPointerWindowInfo, info);
}
+10 -2
View File
@@ -585,7 +585,7 @@ gdk_event_new (GdkEventType type)
return new_event;
}
static gboolean
gboolean
gdk_event_is_allocated (const GdkEvent *event)
{
if (event_hash)
@@ -663,6 +663,11 @@ gdk_event_copy (const GdkEvent *event)
new_private->source_device = private->source_device ? g_object_ref (private->source_device) : NULL;
new_private->seat = private->seat;
new_private->tool = private->tool;
#ifdef GDK_WINDOWING_WIN32
new_private->translation_len = private->translation_len;
new_private->translation = g_memdup (private->translation, private->translation_len * sizeof (private->translation[0]));
#endif
}
switch (event->any.type)
@@ -767,6 +772,9 @@ gdk_event_free (GdkEvent *event)
private = (GdkEventPrivate *) event;
g_clear_object (&private->device);
g_clear_object (&private->source_device);
#ifdef GDK_WINDOWING_WIN32
g_free (private->translation);
#endif
}
switch (event->any.type)
@@ -2564,4 +2572,4 @@ gdk_event_get_scancode (GdkEvent *event)
private = (GdkEventPrivate *) event;
return private->key_scancode;
}
}
+25 -11
View File
@@ -505,11 +505,15 @@ _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
GString *str;
gint64 previous_frame_time = 0;
gint64 previous_smoothed_frame_time = 0;
GdkFrameTimings *previous_timings = gdk_frame_clock_get_timings (clock,
timings->frame_counter - 1);
if (previous_timings != NULL)
previous_frame_time = previous_timings->frame_time;
{
previous_frame_time = previous_timings->frame_time;
previous_smoothed_frame_time = previous_timings->smoothed_frame_time;
}
str = g_string_new ("");
@@ -518,6 +522,9 @@ _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
{
g_string_append_printf (str, " interval=%-4.1f", (timings->frame_time - previous_frame_time) / 1000.);
g_string_append_printf (str, timings->slept_before ? " (sleep)" : " ");
g_string_append_printf (str, " smoothed=%4.1f / %-4.1f",
(timings->smoothed_frame_time - timings->frame_time) / 1000.,
(timings->smoothed_frame_time - previous_smoothed_frame_time) / 1000.);
}
if (timings->layout_start_time != 0)
g_string_append_printf (str, " layout_start=%-4.1f", (timings->layout_start_time - timings->frame_time) / 1000.);
@@ -525,6 +532,8 @@ _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
g_string_append_printf (str, " paint_start=%-4.1f", (timings->paint_start_time - timings->frame_time) / 1000.);
if (timings->frame_end_time != 0)
g_string_append_printf (str, " frame_end=%-4.1f", (timings->frame_end_time - timings->frame_time) / 1000.);
if (timings->drawn_time != 0)
g_string_append_printf (str, " drawn=%-4.1f", (timings->drawn_time - timings->frame_time) / 1000.);
if (timings->presentation_time != 0)
g_string_append_printf (str, " present=%-4.1f", (timings->presentation_time - timings->frame_time) / 1000.);
if (timings->predicted_presentation_time != 0)
@@ -566,16 +575,12 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
gint64 *presentation_time_return)
{
gint64 frame_counter;
gint64 default_refresh_interval = DEFAULT_REFRESH_INTERVAL;
g_return_if_fail (GDK_IS_FRAME_CLOCK (frame_clock));
frame_counter = gdk_frame_clock_get_frame_counter (frame_clock);
if (presentation_time_return)
*presentation_time_return = 0;
if (refresh_interval_return)
*refresh_interval_return = DEFAULT_REFRESH_INTERVAL;
while (TRUE)
{
GdkFrameTimings *timings = gdk_frame_clock_get_timings (frame_clock, frame_counter);
@@ -583,19 +588,21 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
gint64 refresh_interval;
if (timings == NULL)
return;
break;
refresh_interval = timings->refresh_interval;
presentation_time = timings->presentation_time;
if (refresh_interval == 0)
refresh_interval = default_refresh_interval;
else
default_refresh_interval = refresh_interval;
if (presentation_time != 0)
{
if (presentation_time > base_time - MAX_HISTORY_AGE &&
presentation_time_return)
{
if (refresh_interval == 0)
refresh_interval = DEFAULT_REFRESH_INTERVAL;
if (refresh_interval_return)
*refresh_interval_return = refresh_interval;
@@ -604,13 +611,20 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
if (presentation_time_return)
*presentation_time_return = presentation_time;
return;
}
return;
break;
}
frame_counter--;
}
if (presentation_time_return)
*presentation_time_return = 0;
if (refresh_interval_return)
*refresh_interval_return = default_refresh_interval;
}
void
+237 -69
View File
@@ -36,10 +36,25 @@
#define FRAME_INTERVAL 16667 /* microseconds */
typedef enum {
SMOOTH_PHASE_STATE_VALID = 0, /* explicit, since we count on zero-init */
SMOOTH_PHASE_STATE_AWAIT_FIRST,
SMOOTH_PHASE_STATE_AWAIT_DRAWN,
} SmoothDeltaState;
struct _GdkFrameClockIdlePrivate
{
gint64 frame_time;
gint64 min_next_frame_time;
gint64 frame_time; /* The exact time we last ran the clock cycle, or 0 if never */
gint64 smoothed_frame_time_base; /* A grid-aligned version of frame_time (grid size == refresh period), never more than half a grid from frame_time */
gint64 smoothed_frame_time_period; /* The grid size that smoothed_frame_time_base is aligned to */
gint64 smoothed_frame_time_reported; /* Ensures we are always monotonic */
gint64 smoothed_frame_time_phase; /* The offset of the first reported frame time, in the current animation sequence, from the preceding vsync */
gint64 min_next_frame_time; /* We're not synced to vblank, so wait at least until this before next cycle to avoid busy looping */
SmoothDeltaState smooth_phase_state; /* The state of smoothed_frame_time_phase - is it valid, awaiting vsync etc. Thanks to zero-init, the initial value
of smoothed_frame_time_phase is `0`. This is valid, since we didn't get a "frame drawn" event yet. Accordingly,
the initial value of smooth_phase_state is SMOOTH_PHASE_STATE_VALID. See the comment in gdk_frame_clock_paint_idle()
for details. */
gint64 sleep_serial;
#ifdef G_ENABLE_DEBUG
gint64 freeze_time;
@@ -54,6 +69,7 @@ struct _GdkFrameClockIdlePrivate
GdkFrameClockPhase phase;
guint in_paint_idle : 1;
guint paint_is_thaw : 1;
#ifdef G_OS_WIN32
guint begin_period : 1;
#endif
@@ -124,8 +140,8 @@ gdk_frame_clock_idle_init (GdkFrameClockIdle *frame_clock_idle)
frame_clock_idle->priv = priv =
gdk_frame_clock_idle_get_instance_private (frame_clock_idle);
priv->frame_time = g_get_monotonic_time (); /* more sane than zero */
priv->freeze_count = 0;
priv->smoothed_frame_time_period = FRAME_INTERVAL;
}
static void
@@ -156,44 +172,107 @@ gdk_frame_clock_idle_dispose (GObject *object)
G_OBJECT_CLASS (gdk_frame_clock_idle_parent_class)->dispose (object);
}
/* Note: This is never called on first frame, so
* smoothed_frame_time_base != 0 and we have a valid frame_interval. */
static gint64
compute_frame_time (GdkFrameClockIdle *idle)
compute_smooth_frame_time (GdkFrameClock *clock,
gint64 new_frame_time,
gboolean new_frame_time_is_vsync_related,
gint64 smoothed_frame_time_base,
gint64 frame_interval)
{
GdkFrameClockIdlePrivate *priv = idle->priv;
gint64 computed_frame_time;
GdkFrameClockIdlePrivate *priv = GDK_FRAME_CLOCK_IDLE (clock)->priv;
int frames_passed;
gint64 new_smoothed_time;
gint64 current_error;
gint64 correction_magnitude;
computed_frame_time = g_get_monotonic_time ();
/* Consecutive frame, assume it is an integer number of frames later, so round to nearest such */
/* NOTE: This is >= 0, because smoothed_frame_time_base is < frame_interval/2 from old_frame_time
* and new_frame_time >= old_frame_time. */
frames_passed = (new_frame_time - smoothed_frame_time_base + frame_interval / 2) / frame_interval;
/* ensure monotonicity of frame time */
if (computed_frame_time <= priv->frame_time)
computed_frame_time = priv->frame_time + 1;
/* We use an approximately whole number of frames in the future from
* last smoothed frame time. This way we avoid minor jitter in the
* frame times making the animation speed uneven, but still animate
* evenly in case of whole frame skips. */
new_smoothed_time = smoothed_frame_time_base + frames_passed * frame_interval;
return computed_frame_time;
/* However, sometimes the smoothed time is too much off from the
* real time. For example, if the first frame clock cycle happened
* not due to a frame rendering but an input event, then
* new_frame_time could happen to be near the middle between two
* frames. If that happens and we then start regularly animating at
* the refresh_rate, then the jitter in the real time may cause us
* to randomly sometimes round up, and sometimes down.
*
* To combat this we converge the smooth time towards the real time
* in a way that is slow when they are near and fast when they are
* far from each other.
*
* This is done by using the square of the error as the correction
* magnitude. I.e. if the error is 0.5 frame, we correct by
* 0.5*0.5=0.25 frame, if the error is 0.25 we correct by 0.125, if
* the error is 0.1, frame we correct by 0.01 frame, etc.
*
* The actual computation is:
* (current_error/frame_interval)*(current_error/frame_interval)*frame_interval
* But this can be simplified as below.
*
* Note: We only do this correction if the new frame is caused by a
* thaw of the frame clock, so that we know the time is actually
* related to the physical vblank. For frameclock cycles triggered
* by other events we always step up in whole frames from the last
* reported time.
*/
if (new_frame_time_is_vsync_related)
{
current_error = new_smoothed_time - new_frame_time;
correction_magnitude = current_error * current_error / frame_interval; /* Note, this is always > 0 due to the square */
if (current_error > 0)
new_smoothed_time -= correction_magnitude;
else
new_smoothed_time += correction_magnitude;
}
/* Ensure we're always monotonic */
if (new_smoothed_time <= priv->smoothed_frame_time_reported)
new_smoothed_time = priv->smoothed_frame_time_reported;
return new_smoothed_time;
}
static gint64
gdk_frame_clock_idle_get_frame_time (GdkFrameClock *clock)
{
GdkFrameClockIdlePrivate *priv = GDK_FRAME_CLOCK_IDLE (clock)->priv;
gint64 computed_frame_time;
gint64 now;
gint64 new_smoothed_time;
/* can't change frame time during a paint */
if (priv->phase != GDK_FRAME_CLOCK_PHASE_NONE &&
priv->phase != GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS)
return priv->frame_time;
priv->phase != GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS &&
(priv->phase != GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT || priv->in_paint_idle))
return priv->smoothed_frame_time_base;
/* Outside a paint, pick something close to "now" */
computed_frame_time = compute_frame_time (GDK_FRAME_CLOCK_IDLE (clock));
/* Outside a paint, pick something smoothed close to now */
now = g_get_monotonic_time ();
/* 16ms is 60fps. We only update frame time that often because we'd
* like to try to keep animations on the same start times.
* get_frame_time() would normally be used outside of a paint to
* record an animation start time for example.
*/
if ((computed_frame_time - priv->frame_time) > FRAME_INTERVAL)
priv->frame_time = computed_frame_time;
/* First time frame, just return something */
if (priv->smoothed_frame_time_base == 0)
{
priv->smoothed_frame_time_reported = now;
return now;
}
return priv->frame_time;
/* Since time is monotonic this is <= what we will pick for the next cycle, but
more likely than not it will be equal if we're doing a constant animation. */
new_smoothed_time = compute_smooth_frame_time (clock, now, FALSE,
priv->smoothed_frame_time_base,
priv->smoothed_frame_time_period);
priv->smoothed_frame_time_reported = new_smoothed_time;
return new_smoothed_time;
}
#define RUN_FLUSH_IDLE(priv) \
@@ -211,7 +290,8 @@ gdk_frame_clock_idle_get_frame_time (GdkFrameClock *clock)
(priv)->updating_count > 0))
static void
maybe_start_idle (GdkFrameClockIdle *clock_idle)
maybe_start_idle (GdkFrameClockIdle *clock_idle,
gboolean caused_by_thaw)
{
GdkFrameClockIdlePrivate *priv = clock_idle->priv;
@@ -221,7 +301,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
if (priv->min_next_frame_time != 0)
{
gint64 now = compute_frame_time (clock_idle);
gint64 now = g_get_monotonic_time ();
gint64 min_interval_us = MAX (priv->min_next_frame_time, now) - now;
min_interval = (min_interval_us + 500) / 1000;
}
@@ -239,6 +319,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
if (!priv->in_paint_idle &&
priv->paint_idle_id == 0 && RUN_PAINT_IDLE (priv))
{
priv->paint_is_thaw = caused_by_thaw;
priv->paint_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_REDRAW,
min_interval,
gdk_frame_clock_paint_idle,
@@ -267,23 +348,6 @@ maybe_stop_idle (GdkFrameClockIdle *clock_idle)
}
}
static gint64
compute_min_next_frame_time (GdkFrameClockIdle *clock_idle,
gint64 last_frame_time)
{
gint64 presentation_time;
gint64 refresh_interval;
gdk_frame_clock_get_refresh_info (GDK_FRAME_CLOCK (clock_idle),
last_frame_time,
&refresh_interval, &presentation_time);
if (presentation_time == 0)
return last_frame_time + refresh_interval;
else
return presentation_time + refresh_interval / 2;
}
static gboolean
gdk_frame_clock_flush_idle (void *data)
{
@@ -310,6 +374,25 @@ gdk_frame_clock_flush_idle (void *data)
return FALSE;
}
/*
* Returns the positive remainder.
*
* As an example, lets consider (-5) % 16:
*
* (-5) % 16 = (0 * 16) + (-5) = -5
*
* If we only want positive remainders, we can instead calculate
*
* (-5) % 16 = (1 * 16) + (-5) = 11
*
* The built-in `%` operator returns the former, positive_modulo() returns the latter.
*/
static int
positive_modulo (int i, int n)
{
return (i % n + n) % n;
}
static gboolean
gdk_frame_clock_paint_idle (void *data)
{
@@ -343,39 +426,103 @@ gdk_frame_clock_paint_idle (void *data)
if (priv->freeze_count == 0)
{
gint64 frame_interval = FRAME_INTERVAL;
gint64 reset_frame_time;
gint64 smoothest_frame_time;
gint64 frame_time_error;
GdkFrameTimings *prev_timings =
gdk_frame_clock_get_current_timings (clock);
GdkFrameTimings *prev_timings = gdk_frame_clock_get_current_timings (clock);
if (prev_timings && prev_timings->refresh_interval)
frame_interval = prev_timings->refresh_interval;
/* We are likely not getting precisely even callbacks in real
* time, particularly if the event loop is busy.
* This is a documented limitation in the precision of
* gdk_threads_add_timeout_full and g_timeout_add_full.
priv->frame_time = g_get_monotonic_time ();
/*
* The first clock cycle of an animation might have been triggered by some external event. An external
* event can be an input event, an expired timer, data arriving over the network etc. This can happen at
* any time, so the cycle could have been scheduled at some random time rather then immediately after a
* frame completion. The offset between the start of the first animation cycle and the preceding vsync is
* called the "phase" of the clock cycle start time (not to be confused with the phase of the frame
* clock).
*
* In order to avoid this imprecision from compounding between
* frames and affecting visual smoothness, we correct frame_time
* to more precisely match the even refresh interval of the
* physical display. This also means we proactively avoid (most)
* missed frames before they occur.
* In this first clock cycle, the "smooth" frame time is simply the time when the cycle was started. This
* could be followed by several cycles which are not vsync-related. As long as we don't get a "frame
* drawn" signal from the compositor, the clock cycles will occur every about frame_interval. Once we do
* get a "frame drawn" signal, from this point on the frame clock cycles will start shortly after the
* corresponding vsync signals, again every about frame_interval. The first vsync-related clock cycle
* might occur less than a refresh interval away from the last non-vsync-related cycle. See the diagram
* below for details. So while the cadence stays the same - a frame clock cycle every about frame_interval
* - the phase of the cycles start time has changed.
*
* Since we might have already reported the frame time to the application in the previous clock cycles, we
* have to adjust future reported frame times. We want the first vsync-related smooth time to be separated
* by exactly 1 frame_interval from the previous one, in order to maintain the regularity of the reported
* frame times. To achieve that, from this point on we add the phase of the first clock cycle start time to
* the smooth time. In order to compute that phase, accounting for possible skipped frames (e.g. due to
* compositor stalls), we want the following to be true:
*
* first_vsync_smooth_time = last_non_vsync_smooth_time + frame_interval * (1 + frames_skipped)
*
* We can assign the following known/desired values to the above equation:
*
* last_non_vsync_smooth_time = smoothed_frame_time_base
* first_vsync_smooth_time = frame_time + smoothed_frame_time_phase
*
* That leads us to the following, from which we can extract smoothed_frame_time_phase:
*
* frame_time + smoothed_frame_time_phase = smoothed_frame_time_base +
* frame_interval * (1 + frames_skipped)
*
* In the following diagram, '|' mark a vsync, '*' mark the start of a clock cycle, '+' is the adjusted
* frame time, '!' marks the reception of "frame drawn" events from the compositor. Note that the clock
* cycle cadence changed after the first vsync-related cycle. This cadence is kept even if we don't
* receive a 'frame drawn' signal in a subsequent frame, since then we schedule the clock at intervals of
* refresh_interval.
*
* vsync | | | | | |...
* frame drawn | | |! |! | |...
* cycle start | * | * |* |* |* |...
* adjusted times | * | * | + | + | + |...
* phase ^------^
*/
smoothest_frame_time = priv->frame_time + frame_interval;
reset_frame_time = compute_frame_time (clock_idle);
frame_time_error = ABS (reset_frame_time - smoothest_frame_time);
if (frame_time_error >= frame_interval)
priv->frame_time = reset_frame_time;
if (priv->smooth_phase_state == SMOOTH_PHASE_STATE_AWAIT_FIRST)
{
/* First animation cycle - usually unrelated to vsync */
priv->smoothed_frame_time_base = 0;
priv->smoothed_frame_time_phase = 0;
priv->smooth_phase_state = SMOOTH_PHASE_STATE_AWAIT_DRAWN;
}
else if (priv->smooth_phase_state == SMOOTH_PHASE_STATE_AWAIT_DRAWN &&
priv->paint_is_thaw)
{
/* First vsync-related animation cycle, we can now compute the phase. We want the phase to satisfy
0 <= phase < frame_interval */
priv->smoothed_frame_time_phase =
positive_modulo (priv->smoothed_frame_time_base - priv->frame_time,
frame_interval);
priv->smooth_phase_state = SMOOTH_PHASE_STATE_VALID;
}
if (priv->smoothed_frame_time_base == 0)
{
/* First frame ever, or first cycle in a new animation sequence. Ensure monotonicity */
priv->smoothed_frame_time_base = MAX (priv->frame_time, priv->smoothed_frame_time_reported);
}
else
priv->frame_time = smoothest_frame_time;
{
/* compute_smooth_frame_time() ensures monotonicity */
priv->smoothed_frame_time_base =
compute_smooth_frame_time (clock, priv->frame_time + priv->smoothed_frame_time_phase,
priv->paint_is_thaw,
priv->smoothed_frame_time_base,
priv->smoothed_frame_time_period);
}
priv->smoothed_frame_time_period = frame_interval;
priv->smoothed_frame_time_reported = priv->smoothed_frame_time_base;
_gdk_frame_clock_begin_frame (clock);
/* Note "current" is different now so timings != prev_timings */
timings = gdk_frame_clock_get_current_timings (clock);
timings->frame_time = priv->frame_time;
timings->smoothed_frame_time = priv->smoothed_frame_time_base;
timings->slept_before = priv->sleep_serial != get_sleep_serial ();
priv->phase = GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT;
@@ -496,9 +643,20 @@ gdk_frame_clock_paint_idle (void *data)
*/
if (priv->freeze_count == 0)
{
priv->min_next_frame_time = compute_min_next_frame_time (clock_idle,
priv->frame_time);
maybe_start_idle (clock_idle);
/*
* If we don't receive "frame drawn" events, smooth_cycle_start will simply be advanced in constant increments of
* the refresh interval. That way we get absolute target times for the next cycles, which should prevent skewing
* in the scheduling of the frame clock.
*
* Once we do receive "frame drawn" events, smooth_cycle_start will track the vsync, and do so in a more stable
* way compared to frame_time. If we then no longer receive "frame drawn" events, smooth_cycle_start will again be
* simply advanced in increments of the refresh interval, but this time we are in sync with the vsync. If we start
* receiving "frame drawn" events shortly after loosing them, then we should still be in sync.
*/
gint64 smooth_cycle_start = priv->smoothed_frame_time_base - priv->smoothed_frame_time_phase;
priv->min_next_frame_time = smooth_cycle_start + priv->smoothed_frame_time_period;
maybe_start_idle (clock_idle, FALSE);
}
if (priv->freeze_count == 0)
@@ -515,7 +673,7 @@ gdk_frame_clock_idle_request_phase (GdkFrameClock *clock,
GdkFrameClockIdlePrivate *priv = clock_idle->priv;
priv->requested |= phase;
maybe_start_idle (clock_idle);
maybe_start_idle (clock_idle, FALSE);
}
static void
@@ -533,8 +691,13 @@ gdk_frame_clock_idle_begin_updating (GdkFrameClock *clock)
}
#endif
if (priv->updating_count == 0)
{
priv->smooth_phase_state = SMOOTH_PHASE_STATE_AWAIT_FIRST;
}
priv->updating_count++;
maybe_start_idle (clock_idle);
maybe_start_idle (clock_idle, FALSE);
}
static void
@@ -548,6 +711,11 @@ gdk_frame_clock_idle_end_updating (GdkFrameClock *clock)
priv->updating_count--;
maybe_stop_idle (clock_idle);
if (priv->updating_count == 0)
{
priv->smooth_phase_state = SMOOTH_PHASE_STATE_VALID;
}
#ifdef G_OS_WIN32
if (priv->updating_count == 0 && priv->begin_period)
{
@@ -586,7 +754,7 @@ gdk_frame_clock_idle_thaw (GdkFrameClock *clock)
priv->freeze_count--;
if (priv->freeze_count == 0)
{
maybe_start_idle (clock_idle);
maybe_start_idle (clock_idle, TRUE);
/* If nothing is requested so we didn't start an idle, we need
* to skip to the end of the state chain, since the idle won't
* run and do it for us.
+1
View File
@@ -89,6 +89,7 @@ struct _GdkFrameTimings
gint64 frame_counter;
guint64 cookie;
gint64 frame_time;
gint64 smoothed_frame_time;
gint64 drawn_time;
gint64 presentation_time;
gint64 refresh_interval;
+3 -3
View File
@@ -812,10 +812,10 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
}
else
{
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
has_npot = priv->gl_version >= 20 || epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
has_texture_rectangle = priv->gl_version >= 31 || epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
priv->has_gl_framebuffer_blit = priv->gl_version >= 30 || epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
priv->has_unpack_subimage = TRUE;
+9
View File
@@ -192,6 +192,11 @@ struct _GdkEventPrivate
GdkSeat *seat;
GdkDeviceTool *tool;
guint16 key_scancode;
#ifdef GDK_WINDOWING_WIN32
gunichar2 *translation;
guint translation_len;
#endif
};
typedef struct _GdkWindowPaint GdkWindowPaint;
@@ -413,6 +418,10 @@ void gdk_event_set_scancode (GdkEvent *event,
void gdk_event_set_seat (GdkEvent *event,
GdkSeat *seat);
/* The IME IM module needs this symbol exported. */
_GDK_EXTERN
gboolean gdk_event_is_allocated (const GdkEvent *event);
void _gdk_event_emit (GdkEvent *event);
GList* _gdk_event_queue_find_first (GdkDisplay *display);
void _gdk_event_queue_remove_link (GdkDisplay *display,
+8
View File
@@ -274,6 +274,10 @@
#define GDK_dead_invertedbreve 0xfe6d
#define GDK_dead_belowcomma 0xfe6e
#define GDK_dead_currency 0xfe6f
#define GDK_dead_lowline 0xfe90
#define GDK_dead_aboveverticalline 0xfe91
#define GDK_dead_belowverticalline 0xfe92
#define GDK_dead_longsolidusoverlay 0xfe93
#define GDK_dead_a 0xfe80
#define GDK_dead_A 0xfe81
#define GDK_dead_e 0xfe82
@@ -2279,6 +2283,10 @@
#define GDK_TouchpadOn 0x1008ffb0
#define GDK_TouchpadOff 0x1008ffb1
#define GDK_AudioMicMute 0x1008ffb2
#define GDK_Keyboard 0x1008ffb3
#define GDK_WWAN 0x1008ffb4
#define GDK_RFKill 0x1008ffb5
#define GDK_AudioPreset 0x1008ffb6
#define GDK_Switch_VT_1 0x1008fe01
#define GDK_Switch_VT_2 0x1008fe02
#define GDK_Switch_VT_3 0x1008fe03
+8
View File
@@ -283,6 +283,10 @@
#define GDK_KEY_dead_invertedbreve 0xfe6d
#define GDK_KEY_dead_belowcomma 0xfe6e
#define GDK_KEY_dead_currency 0xfe6f
#define GDK_KEY_dead_lowline 0xfe90
#define GDK_KEY_dead_aboveverticalline 0xfe91
#define GDK_KEY_dead_belowverticalline 0xfe92
#define GDK_KEY_dead_longsolidusoverlay 0xfe93
#define GDK_KEY_dead_a 0xfe80
#define GDK_KEY_dead_A 0xfe81
#define GDK_KEY_dead_e 0xfe82
@@ -2288,6 +2292,10 @@
#define GDK_KEY_TouchpadOn 0x1008ffb0
#define GDK_KEY_TouchpadOff 0x1008ffb1
#define GDK_KEY_AudioMicMute 0x1008ffb2
#define GDK_KEY_Keyboard 0x1008ffb3
#define GDK_KEY_WWAN 0x1008ffb4
#define GDK_KEY_RFKill 0x1008ffb5
#define GDK_KEY_AudioPreset 0x1008ffb6
#define GDK_KEY_Switch_VT_1 0x1008fe01
#define GDK_KEY_Switch_VT_2 0x1008fe02
#define GDK_KEY_Switch_VT_3 0x1008fe03
+11 -1
View File
@@ -644,6 +644,16 @@ gdk_offscreen_window_set_wmfunctions (GdkWindow *window,
{
}
static void
gdk_offscreen_window_begin_move_drag (GdkWindow *window,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
}
static void
gdk_offscreen_window_set_transient_for (GdkWindow *window,
GdkWindow *another)
@@ -754,7 +764,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
impl_class->get_decorations = NULL;
impl_class->set_functions = gdk_offscreen_window_set_wmfunctions;
impl_class->begin_resize_drag = NULL;
impl_class->begin_move_drag = NULL;
impl_class->begin_move_drag = gdk_offscreen_window_begin_move_drag;
impl_class->enable_synchronized_configure = gdk_offscreen_window_do_nothing;
impl_class->configure_finished = NULL;
impl_class->set_opacity = gdk_offscreen_window_set_opacity;
+1
View File
@@ -288,6 +288,7 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
if (cairo_surface_status (surface) || dest == NULL)
{
cairo_surface_destroy (surface);
g_clear_object (&dest);
return NULL;
}
+2
View File
@@ -396,6 +396,7 @@ gdk_seat_default_remove_slave (GdkSeatDefault *seat,
priv->capabilities |= device_get_capability (GDK_DEVICE (l->data));
gdk_seat_device_removed (GDK_SEAT (seat), device);
g_object_unref (device);
}
else if (g_list_find (priv->slave_keyboards, device))
{
@@ -405,6 +406,7 @@ gdk_seat_default_remove_slave (GdkSeatDefault *seat,
priv->capabilities &= ~GDK_SEAT_CAPABILITY_KEYBOARD;
gdk_seat_device_removed (GDK_SEAT (seat), device);
g_object_unref (device);
}
}
+2 -2
View File
@@ -9931,7 +9931,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
if (source_device != pointer_info->last_slave &&
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
pointer_info->last_slave = source_device;
g_set_object (&pointer_info->last_slave, source_device);
else if (pointer_info->last_slave)
source_device = pointer_info->last_slave;
}
@@ -10200,7 +10200,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
* gdk_window_create_similar_image_surface:
* @window: (nullable): window to make new surface similar to, or
* %NULL if none
* @format: (type int): the format for the new surface
* @format: the format for the new surface
* @width: width of the new surface
* @height: height of the new surface
* @scale: the scale of the new surface, or 0 to use same as @window
+3 -332
View File
@@ -185,9 +185,9 @@
-(void)doCommandBySelector: (SEL)aSelector
{
GDK_NOTE (EVENTS, g_message ("doCommandBySelector"));
if ([self respondsToSelector: aSelector])
[self performSelector: aSelector];
GDK_NOTE (EVENTS, g_message ("doCommandBySelector %s", aSelector));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertText: (id)aString replacementRange: (NSRange)replacementRange
@@ -246,335 +246,6 @@
_gdk_quartz_synthesize_null_key_event(gdk_window);
}
}
-(void)deleteBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteToBeginningOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteToBeginningOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteToEndOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteToEndOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteWordBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteWordBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteWordForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteWordForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertBacktab: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertBacktab"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertNewline: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertNewline"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertTab: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertTab"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveBackwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveBackwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveDownAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveDownAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveForwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveForwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveLeft: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveLeft"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveLeftAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveLeftAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveRight: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveRight"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveRightAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveRightAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfDocument: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocument"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfDocumentAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocumentAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfLineAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLineAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfDocument: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocument"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfDocumentAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocumentAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfLineAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfLineAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveUpAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveUpAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordBackwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordBackwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordForwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordForwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordLeft: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordLeft"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordLeftAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordLeftAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordRight: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordRight"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordRightAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordRightAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageDownAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageDownAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageUpAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageUpAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)scrollPageDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("scrollPageDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)scrollPageUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("scrollPageUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectAll: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectAll"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectWord: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectWord"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)noop: (id)sender
{
GDK_NOTE (EVENTS, g_message ("noop"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
/* --------------------------------------------------------------- */
-(void)dealloc
+1
View File
@@ -24,6 +24,7 @@
#include "gdkquartzcursor.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
#include "gdkquartz-gtk-only.h"
#include "xcursors.h"
+37
View File
@@ -31,6 +31,10 @@
struct _GdkQuartzDeviceCore
{
GdkDevice parent_instance;
gboolean active;
NSUInteger device_id;
unsigned long long unique_id;
};
struct _GdkQuartzDeviceCoreClass
@@ -364,3 +368,36 @@ gdk_quartz_device_core_select_window_events (GdkDevice *device,
{
/* The mask is set in the common code. */
}
void
_gdk_quartz_device_core_set_active (GdkDevice *device,
gboolean active,
NSUInteger device_id)
{
GdkQuartzDeviceCore *self = GDK_QUARTZ_DEVICE_CORE (device);
self->active = active;
self->device_id = device_id;
}
gboolean
_gdk_quartz_device_core_is_active (GdkDevice *device,
NSUInteger device_id)
{
GdkQuartzDeviceCore *self = GDK_QUARTZ_DEVICE_CORE (device);
return (self->active && self->device_id == device_id);
}
void
_gdk_quartz_device_core_set_unique (GdkDevice *device,
unsigned long long unique_id)
{
GDK_QUARTZ_DEVICE_CORE (device)->unique_id = unique_id;
}
unsigned long long
_gdk_quartz_device_core_get_unique (GdkDevice *device)
{
return GDK_QUARTZ_DEVICE_CORE (device)->unique_id;
}
+226 -4
View File
@@ -27,7 +27,20 @@
#include "gdkquartzdevice-core.h"
#include "gdkkeysyms.h"
#include "gdkprivate-quartz.h"
#include "gdkinternal-quartz.h"
typedef enum
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
GDK_QUARTZ_POINTER_DEVICE_TYPE_CURSOR = NSCursorPointingDevice,
GDK_QUARTZ_POINTER_DEVICE_TYPE_ERASER = NSEraserPointingDevice,
GDK_QUARTZ_POINTER_DEVICE_TYPE_PEN = NSPenPointingDevice,
#else
GDK_QUARTZ_POINTER_DEVICE_TYPE_CURSOR = NSPointingDeviceTypeCursor,
GDK_QUARTZ_POINTER_DEVICE_TYPE_ERASER = NSPointingDeviceTypeEraser,
GDK_QUARTZ_POINTER_DEVICE_TYPE_PEN = NSPointingDeviceTypePen,
#endif
} GdkQuartzPointerDeviceType;
#define HAS_FOCUS(toplevel) \
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
@@ -87,6 +100,7 @@ create_core_keyboard (GdkDeviceManager *device_manager,
static void
gdk_quartz_device_manager_core_init (GdkQuartzDeviceManagerCore *device_manager)
{
device_manager->known_tablet_devices = NULL;
}
static void
@@ -99,6 +113,8 @@ gdk_quartz_device_manager_core_finalize (GObject *object)
g_object_unref (quartz_device_manager_core->core_pointer);
g_object_unref (quartz_device_manager_core->core_keyboard);
g_list_free_full (quartz_device_manager_core->known_tablet_devices, g_object_unref);
G_OBJECT_CLASS (gdk_quartz_device_manager_core_parent_class)->finalize (object);
}
@@ -127,16 +143,25 @@ static GList *
gdk_quartz_device_manager_core_list_devices (GdkDeviceManager *device_manager,
GdkDeviceType type)
{
GdkQuartzDeviceManagerCore *quartz_device_manager_core;
GdkQuartzDeviceManagerCore *self;
GList *devices = NULL;
GList *l;
self = GDK_QUARTZ_DEVICE_MANAGER_CORE (device_manager);
if (type == GDK_DEVICE_TYPE_MASTER)
{
quartz_device_manager_core = (GdkQuartzDeviceManagerCore *) device_manager;
devices = g_list_prepend (devices, quartz_device_manager_core->core_keyboard);
devices = g_list_prepend (devices, quartz_device_manager_core->core_pointer);
devices = g_list_prepend (devices, self->core_keyboard);
devices = g_list_prepend (devices, self->core_pointer);
}
for (l = self->known_tablet_devices; l; l = g_list_next (l))
{
devices = g_list_prepend (devices, GDK_DEVICE (l->data));
}
devices = g_list_reverse (devices);
return devices;
}
@@ -148,3 +173,200 @@ gdk_quartz_device_manager_core_get_client_pointer (GdkDeviceManager *device_mana
quartz_device_manager_core = (GdkQuartzDeviceManagerCore *) device_manager;
return quartz_device_manager_core->core_pointer;
}
static GdkDevice *
create_core_device (GdkDeviceManager *device_manager,
const gchar *device_name,
GdkInputSource source)
{
GdkDisplay *display = gdk_device_manager_get_display (device_manager);
GdkDevice *device = g_object_new (GDK_TYPE_QUARTZ_DEVICE_CORE,
"name", device_name,
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", source,
"input-mode", GDK_MODE_DISABLED,
"has-cursor", FALSE,
"display", display,
"device-manager", device_manager,
NULL);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_PRESSURE, 0.0, 1.0, 0.001);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_XTILT, -1.0, 1.0, 0.001);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_YTILT, -1.0, 1.0, 0.001);
return device;
}
static void
mimic_device_axes (GdkDevice *logical,
GdkDevice *physical)
{
double axis_min, axis_max, axis_resolution;
GdkAtom axis_label;
GdkAxisUse axis_use;
int axis_count;
int i;
axis_count = gdk_device_get_n_axes (physical);
for (i = 0; i < axis_count; i++)
{
_gdk_device_get_axis_info (physical, i, &axis_label, &axis_use, &axis_min,
&axis_max, &axis_resolution);
_gdk_device_add_axis (logical, axis_label, axis_use, axis_min,
axis_max, axis_resolution);
}
}
static void
translate_device_axes (GdkDevice *source_device,
gboolean active)
{
GdkSeat *seat = gdk_display_get_default_seat (_gdk_display);
GdkDevice *core_pointer = gdk_seat_get_pointer (seat);
g_object_freeze_notify (G_OBJECT (core_pointer));
_gdk_device_reset_axes (core_pointer);
if (active && source_device)
{
mimic_device_axes (core_pointer, source_device);
}
else
{
_gdk_device_add_axis (core_pointer, GDK_NONE, GDK_AXIS_X, 0, 0, 1);
_gdk_device_add_axis (core_pointer, GDK_NONE, GDK_AXIS_Y, 0, 0, 1);
}
g_object_thaw_notify (G_OBJECT (core_pointer));
}
void
_gdk_quartz_device_manager_register_device_for_ns_event (GdkDeviceManager *device_manager,
NSEvent *nsevent)
{
GdkQuartzDeviceManagerCore *self = GDK_QUARTZ_DEVICE_MANAGER_CORE (device_manager);
GList *l = NULL;
GdkInputSource input_source = GDK_SOURCE_MOUSE;
GdkDevice *device = NULL;
/* Only handle device updates for proximity events */
if ([nsevent type] != GDK_QUARTZ_EVENT_TABLET_PROXIMITY &&
[nsevent subtype] != GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY)
return;
if ([nsevent pointingDeviceType] == GDK_QUARTZ_POINTER_DEVICE_TYPE_PEN)
input_source = GDK_SOURCE_PEN;
else if ([nsevent pointingDeviceType] == GDK_QUARTZ_POINTER_DEVICE_TYPE_CURSOR)
input_source = GDK_SOURCE_CURSOR;
else if ([nsevent pointingDeviceType] == GDK_QUARTZ_POINTER_DEVICE_TYPE_ERASER)
input_source = GDK_SOURCE_ERASER;
for (l = self->known_tablet_devices; l; l = g_list_next (l))
{
GdkDevice *device_to_check = GDK_DEVICE (l->data);
if (input_source == gdk_device_get_source (device_to_check) &&
[nsevent uniqueID] == _gdk_quartz_device_core_get_unique (device_to_check))
{
device = device_to_check;
if ([nsevent isEnteringProximity])
{
if (!_gdk_quartz_device_core_is_active (device, [nsevent deviceID]))
self->num_active_devices++;
_gdk_quartz_device_core_set_active (device, TRUE, [nsevent deviceID]);
}
else
{
if (_gdk_quartz_device_core_is_active (device, [nsevent deviceID]))
self->num_active_devices--;
_gdk_quartz_device_core_set_active (device, FALSE, [nsevent deviceID]);
}
}
}
/* If we haven't seen this device before, add it */
if (!device)
{
GdkSeat *seat;
switch (input_source)
{
case GDK_SOURCE_PEN:
device = create_core_device (device_manager,
"Quartz Pen",
GDK_SOURCE_PEN);
break;
case GDK_SOURCE_CURSOR:
device = create_core_device (device_manager,
"Quartz Cursor",
GDK_SOURCE_CURSOR);
break;
case GDK_SOURCE_ERASER:
device = create_core_device (device_manager,
"Quartz Eraser",
GDK_SOURCE_ERASER);
break;
default:
g_warning ("GDK Quarz unknown input source: %i", input_source);
break;
}
_gdk_device_set_associated_device (GDK_DEVICE (device), self->core_pointer);
_gdk_device_add_slave (self->core_pointer, GDK_DEVICE (device));
seat = gdk_device_get_seat (self->core_pointer);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), device);
_gdk_quartz_device_core_set_unique (device, [nsevent uniqueID]);
_gdk_quartz_device_core_set_active (device, TRUE, [nsevent deviceID]);
self->known_tablet_devices = g_list_append (self->known_tablet_devices,
device);
if ([nsevent isEnteringProximity])
{
if (!_gdk_quartz_device_core_is_active (device, [nsevent deviceID]))
self->num_active_devices++;
_gdk_quartz_device_core_set_active (device, TRUE, [nsevent deviceID]);
}
}
translate_device_axes (device, [nsevent isEnteringProximity]);
if (self->num_active_devices)
[NSEvent setMouseCoalescingEnabled: FALSE];
else
[NSEvent setMouseCoalescingEnabled: TRUE];
}
GdkDevice *
_gdk_quartz_device_manager_core_device_for_ns_event (GdkDeviceManager *device_manager,
NSEvent *nsevent)
{
GdkQuartzDeviceManagerCore *self = GDK_QUARTZ_DEVICE_MANAGER_CORE (device_manager);
GdkDevice *device = NULL;
if ([nsevent type] == GDK_QUARTZ_EVENT_TABLET_PROXIMITY ||
[nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY ||
[nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT)
{
/* Find the device based on deviceID */
GList *l = NULL;
for (l = self->known_tablet_devices; l && !device; l = g_list_next (l))
{
GdkDevice *device_to_check = GDK_DEVICE (l->data);
if (_gdk_quartz_device_core_is_active (device_to_check, [nsevent deviceID]))
device = device_to_check;
}
}
if (!device)
device = self->core_pointer;
return device;
}
+10
View File
@@ -23,6 +23,8 @@
#include <gdkdevicemanagerprivate.h>
#include "gdkquartzdevicemanager-core.h"
#import <Cocoa/Cocoa.h>
G_BEGIN_DECLS
struct _GdkQuartzDeviceManagerCore
@@ -30,6 +32,8 @@ struct _GdkQuartzDeviceManagerCore
GdkDeviceManager parent_object;
GdkDevice *core_pointer;
GdkDevice *core_keyboard;
GList *known_tablet_devices;
guint num_active_devices;
};
struct _GdkQuartzDeviceManagerCoreClass
@@ -37,6 +41,12 @@ struct _GdkQuartzDeviceManagerCoreClass
GdkDeviceManagerClass parent_class;
};
void _gdk_quartz_device_manager_register_device_for_ns_event (GdkDeviceManager *device_manager,
NSEvent *nsevent);
GdkDevice *_gdk_quartz_device_manager_core_device_for_ns_event (GdkDeviceManager *device_manager,
NSEvent *ns_event);
G_END_DECLS
#endif /* __GDK_QUARTZ_DEVICE_MANAGER__ */
+6 -6
View File
@@ -88,9 +88,6 @@ _gdk_quartz_display_open (const gchar *display_name)
if (_gdk_display != NULL)
return NULL;
/* Initialize application */
[NSApplication sharedApplication];
_gdk_display = g_object_new (gdk_quartz_display_get_type (), NULL);
_gdk_display->device_manager = _gdk_device_manager_new (_gdk_display);
@@ -101,6 +98,8 @@ _gdk_quartz_display_open (const gchar *display_name)
_gdk_quartz_events_init ();
/* Initialize application */
[NSApplication sharedApplication];
#if 0
/* FIXME: Remove the #if 0 when we have these functions */
_gdk_quartz_dnd_init ();
@@ -380,16 +379,17 @@ display_reconfiguration_callback (CGDirectDisplayID cg_display,
"display", display, NULL);
monitor->id = cg_display;
g_ptr_array_add (display->monitors, monitor);
display_rect (display);
configure_monitor (GDK_MONITOR (monitor), display);
gdk_display_monitor_added (GDK_DISPLAY (display),
GDK_MONITOR (monitor));
}
else
{
monitor = g_ptr_array_index (display->monitors, index);
display_rect (display);
configure_monitor (GDK_MONITOR (monitor), display);
}
display_rect (display);
configure_monitor (GDK_MONITOR (monitor), display);
}
else if (flags & (kCGDisplayRemoveFlag | kCGDisplayDisabledFlag))
{
+58 -10
View File
@@ -42,6 +42,7 @@
#define GRIP_WIDTH 15
#define GRIP_HEIGHT 15
#define GDK_LION_RESIZE 5
#define TABLET_AXES 5
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
#define NSEventTypeRotate 13
@@ -173,7 +174,7 @@ gdk_event_apply_filters (NSEvent *nsevent,
{
GList *tmp_list;
GdkFilterReturn result;
tmp_list = *filters;
while (tmp_list)
@@ -557,7 +558,7 @@ generate_motion_event (GdkWindow *window)
event->motion.state = _gdk_quartz_events_get_current_keyboard_modifiers () |
_gdk_quartz_events_get_current_mouse_modifiers ();
event->motion.is_hint = FALSE;
event->motion.device = gdk_seat_get_pointer (seat);
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
gdk_event_set_seat (event, seat);
append_event (event, TRUE);
@@ -643,8 +644,9 @@ find_toplevel_under_pointer (GdkDisplay *display,
if (!(toplevel && WINDOW_IS_TOPLEVEL (toplevel)))
{
gint gdk_x = 0, gdk_y = 0;
GdkDevice *pointer = gdk_seat_get_pointer(seat);
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gdk_x, &gdk_y);
toplevel = gdk_display_get_window_at_pointer (display, &gdk_x, &gdk_y);
toplevel = gdk_device_get_window_at_position (pointer, &gdk_x, &gdk_y);
if (toplevel && ! WINDOW_IS_TOPLEVEL (toplevel))
toplevel = gdk_window_get_toplevel (toplevel);
@@ -1019,6 +1021,8 @@ fill_button_event (GdkWindow *window,
gint y_root)
{
GdkEventType type;
GdkDevice *event_device = NULL;
gdouble *axes = NULL;
gint state;
GdkSeat *seat = gdk_display_get_default_seat (_gdk_display);
@@ -1045,6 +1049,20 @@ fill_button_event (GdkWindow *window,
g_assert_not_reached ();
}
event_device = _gdk_quartz_device_manager_core_device_for_ns_event (gdk_display_get_device_manager (_gdk_display),
nsevent);
if ([nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT)
{
axes = g_new (gdouble, TABLET_AXES);
axes[0] = x;
axes[1] = y;
axes[2] = [nsevent pressure];
axes[3] = [nsevent tilt].x;
axes[4] = [nsevent tilt].y;
}
event->any.type = type;
event->button.window = window;
event->button.time = get_time_from_ns_event (nsevent);
@@ -1052,11 +1070,12 @@ fill_button_event (GdkWindow *window,
event->button.y = y;
event->button.x_root = x_root;
event->button.y_root = y_root;
/* FIXME event->axes */
event->button.axes = axes;
event->button.state = state;
event->button.button = get_mouse_button_from_ns_event (nsevent);
event->button.device = gdk_seat_get_pointer (seat);
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
gdk_event_set_source_device (event, event_device);
gdk_event_set_seat (event, seat);
}
@@ -1070,6 +1089,22 @@ fill_motion_event (GdkWindow *window,
gint y_root)
{
GdkSeat *seat = gdk_display_get_default_seat (_gdk_display);
GdkDevice *event_device = NULL;
gdouble *axes = NULL;
event_device = _gdk_quartz_device_manager_core_device_for_ns_event (gdk_display_get_device_manager (_gdk_display),
nsevent);
if ([nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT)
{
axes = g_new (gdouble, TABLET_AXES);
axes[0] = x;
axes[1] = y;
axes[2] = [nsevent pressure];
axes[3] = [nsevent tilt].x;
axes[4] = [nsevent tilt].y;
}
event->any.type = GDK_MOTION_NOTIFY;
event->motion.window = window;
@@ -1078,11 +1113,13 @@ fill_motion_event (GdkWindow *window,
event->motion.y = y;
event->motion.x_root = x_root;
event->motion.y_root = y_root;
/* FIXME event->axes */
event->motion.axes = axes;
event->motion.state = get_keyboard_modifiers_from_ns_event (nsevent) |
_gdk_quartz_events_get_current_mouse_modifiers ();
event->motion.is_hint = FALSE;
event->motion.device = gdk_seat_get_pointer (seat);
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
gdk_event_set_source_device (event, event_device);
gdk_event_set_seat (event, seat);
}
@@ -1112,9 +1149,9 @@ fill_scroll_event (GdkWindow *window,
event->scroll.y_root = y_root;
event->scroll.state = get_keyboard_modifiers_from_ns_event (nsevent);
event->scroll.direction = direction;
event->scroll.device = gdk_seat_get_pointer (seat);
event->scroll.delta_x = delta_x;
event->scroll.delta_y = delta_y;
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
gdk_event_set_seat (event, seat);
}
@@ -1343,16 +1380,18 @@ _gdk_quartz_events_get_current_keyboard_modifiers (void)
GdkModifierType
_gdk_quartz_events_get_current_mouse_modifiers (void)
{
NSUInteger buttons = 0;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
if (gdk_quartz_osx_version () >= GDK_OSX_SNOW_LEOPARD)
return get_mouse_button_modifiers_from_ns_buttons ([NSClassFromString(@"NSEvent") pressedMouseButtons]);
buttons = [NSClassFromString(@"NSEvent") pressedMouseButtons];
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
else
#endif
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
return get_mouse_button_modifiers_from_ns_buttons (GetCurrentButtonState ());
buttons = GetCurrentButtonState ();
#endif
return get_mouse_button_modifiers_from_ns_buttons (buttons);
}
/* Detect window resizing */
@@ -1470,6 +1509,15 @@ gdk_event_translate (GdkEvent *event,
}
}
/* We need to register the proximity event from any point on the screen
* to properly register the devices
*/
if (event_type == GDK_QUARTZ_EVENT_TABLET_PROXIMITY)
{
_gdk_quartz_device_manager_register_device_for_ns_event (gdk_display_get_device_manager (_gdk_display),
nsevent);
}
nswindow = [nsevent window];
/* Ignore events for windows not created by GDK. */
+1
View File
@@ -28,6 +28,7 @@
#include "gdkquartzglcontext.h"
#include "gdkquartzwindow.h"
#include "gdkprivate-quartz.h"
#include "gdkquartz-gtk-only.h"
#include "gdkinternals.h"
+2
View File
@@ -42,6 +42,8 @@ gdk_quartz_osx_version (void)
version = [[NSProcessInfo processInfo] operatingSystemVersion];
minor = version.minorVersion;
if (version.majorVersion == 11)
minor += 16;
#endif
}
+23
View File
@@ -75,6 +75,16 @@ typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
} GdkQuartzEventSubType;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 10130
#define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSEventTypeTabletProximity
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSEventSubtypeTabletProximity
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSEventSubtypeTabletPoint
#else
#define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSTabletProximity
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSTabletProximityEventSubtype
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSTabletPointEventSubtype
#endif
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
gboolean got_focus);
void _gdk_quartz_events_send_map_event (GdkWindow *window);
@@ -84,6 +94,19 @@ GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
void _gdk_quartz_events_break_all_grabs (guint32 time);
/* Devices */
void _gdk_quartz_device_core_set_active (GdkDevice *device,
gboolean active,
NSUInteger device_id);
gboolean _gdk_quartz_device_core_is_active (GdkDevice *device,
NSUInteger device_id);
void _gdk_quartz_device_core_set_unique (GdkDevice *device,
unsigned long long unique_id);
unsigned long long _gdk_quartz_device_core_get_unique (GdkDevice *device);
/* Event loop */
gboolean _gdk_quartz_event_loop_check_pending (void);
NSEvent * _gdk_quartz_event_loop_get_pending (void);
+14 -16
View File
@@ -650,7 +650,6 @@ gdk_quartz_keymap_translate_keyboard_state (GdkKeymap *keymap,
{
guint tmp_keyval;
GdkModifierType bit;
guint tmp_modifiers = 0;
if (keyval)
*keyval = 0;
@@ -664,24 +663,23 @@ gdk_quartz_keymap_translate_keyboard_state (GdkKeymap *keymap,
if (hardware_keycode < 0 || hardware_keycode >= NUM_KEYCODES)
return FALSE;
/* Check if modifiers modify the keyval */
for (bit = GDK_SHIFT_MASK; bit < GDK_BUTTON1_MASK; bit <<= 1)
{
if (translate_keysym (hardware_keycode,
(bit == GDK_MOD1_MASK) ? 0 : group,
state & ~bit,
NULL, NULL) !=
translate_keysym (hardware_keycode,
(bit == GDK_MOD1_MASK) ? 1 : group,
state | bit,
NULL, NULL))
tmp_modifiers |= bit;
}
tmp_keyval = translate_keysym (hardware_keycode, group, state, level, effective_group);
/* Check if modifiers modify the keyval */
if (consumed_modifiers)
*consumed_modifiers = tmp_modifiers;
{
guint tmp_modifiers = (state & GDK_MODIFIER_MASK);
for (bit = 1; bit <= tmp_modifiers; bit <<= 1)
{
if ((bit & tmp_modifiers) &&
translate_keysym (hardware_keycode, group, state & ~bit,
NULL, NULL) == tmp_keyval)
tmp_modifiers &= ~bit;
}
*consumed_modifiers = tmp_modifiers;
}
if (keyval)
*keyval = tmp_keyval;
+1 -1
View File
@@ -23,7 +23,7 @@
#error "This API is for use only in Gtk internal code."
#endif
#include <Appkit/Appkit.h>
#include <AppKit/AppKit.h>
#include <gdk/gdk.h>
#include <gdk/quartz/gdkquartz.h>
+3 -1
View File
@@ -40,7 +40,9 @@ typedef enum
GDK_OSX_SIERRA = 12,
GDK_OSX_HIGH_SIERRA = 13,
GDK_OSX_MOJAVE = 14,
GDK_OSX_CURRENT = 14,
GDK_OSX_CATALINA = 15,
GDK_OSX_BIGSUR = 16,
GDK_OSX_CURRENT = 15,
GDK_OSX_NEW = 99
} GdkOSXVersion;
+2 -4
View File
@@ -18,7 +18,8 @@
*/
#include "config.h"
/* GdkScreen is deprecated, but we need to support it still so silence the warnings.*/
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
#include <gdk/gdk.h>
#include "gdkprivate-quartz.h"
@@ -121,9 +122,6 @@ static void
gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen,
GdkQuartzDisplay *display)
{
int i, monitors;
int max_x, max_y;
if (!display)
display = GDK_QUARTZ_DISPLAY (gdk_screen_get_display (GDK_SCREEN (screen)));
+46 -11
View File
@@ -191,8 +191,11 @@ static void
gdk_window_impl_quartz_release_context (GdkWindowImplQuartz *window_impl,
CGContextRef cg_context)
{
CGContextRestoreGState (cg_context);
CGContextSetAllowsAntialiasing (cg_context, TRUE);
if (cg_context)
{
CGContextRestoreGState (cg_context);
CGContextSetAllowsAntialiasing (cg_context, TRUE);
}
/* See comment in gdk_quartz_window_get_context(). */
if (window_impl->in_paint_rect_count == 0)
@@ -740,15 +743,38 @@ _gdk_quartz_window_find_child (GdkWindow *window,
return NULL;
}
/* Raises a transient window.
*/
static void
raise_transient (GdkWindowImplQuartz *impl)
{
/* In quartz the transient-for behavior is implemented by
* attaching the transient-for GdkNSWindows to the parent's
* GdkNSWindow. Stacking is managed by Quartz and the order
* is that of the parent's childWindows array. The only way
* to change that order is to remove the child from the
* parent and then add it back in.
*/
GdkWindowImplQuartz *parent_impl =
GDK_WINDOW_IMPL_QUARTZ (impl->transient_for->impl);
[parent_impl->toplevel removeChildWindow:impl->toplevel];
[parent_impl->toplevel addChildWindow:impl->toplevel
ordered:NSWindowAbove];
}
void
_gdk_quartz_window_did_become_main (GdkWindow *window)
{
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
main_window_stack = g_slist_remove (main_window_stack, window);
if (window->window_type != GDK_WINDOW_TEMP)
main_window_stack = g_slist_prepend (main_window_stack, window);
if (impl->transient_for)
raise_transient (impl);
clear_toplevel_order ();
}
@@ -821,6 +847,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
{
GdkWindowImplQuartz *impl;
GdkWindowImplQuartz *parent_impl;
GdkWindowTypeHint type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
GDK_QUARTZ_ALLOC_POOL;
@@ -853,6 +880,12 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
impl->view = NULL;
if (attributes_mask & GDK_WA_TYPE_HINT)
{
type_hint = attributes->type_hint;
gdk_window_set_type_hint (window, type_hint);
}
switch (window->window_type)
{
case GDK_WINDOW_TOPLEVEL:
@@ -882,8 +915,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
window->height);
if (window->window_type == GDK_WINDOW_TEMP ||
((attributes_mask & GDK_WA_TYPE_HINT) &&
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
{
style_mask = GDK_QUARTZ_BORDERLESS_WINDOW;
}
@@ -901,6 +933,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
defer:NO
screen:screen];
if (type_hint != GDK_WINDOW_TYPE_HINT_NORMAL)
impl->toplevel.excludedFromWindowsMenu = true;
if (attributes_mask & GDK_WA_TITLE)
title = attributes->title;
else
@@ -956,9 +991,6 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
}
GDK_QUARTZ_RELEASE_POOL;
if (attributes_mask & GDK_WA_TYPE_HINT)
gdk_window_set_type_hint (window, attributes->type_hint);
}
void
@@ -1507,7 +1539,11 @@ gdk_window_quartz_raise (GdkWindow *window)
GdkWindowImplQuartz *impl;
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
[impl->toplevel orderFront:impl->toplevel];
if (impl->transient_for)
raise_transient (impl);
else
[impl->toplevel orderFront:impl->toplevel];
clear_toplevel_order ();
}
@@ -2860,8 +2896,8 @@ _gdk_quartz_window_update_fullscreen_state (GdkWindow *window)
if (gdk_quartz_osx_version() >= GDK_OSX_LION)
{
gboolean is_fullscreen = window_is_fullscreen (window);
gboolean was_fullscreen = (gdk_window_get_state (window) &&
GDK_WINDOW_STATE_FULLSCREEN != 0);
gboolean was_fullscreen = (gdk_window_get_state (window) &
GDK_WINDOW_STATE_FULLSCREEN) != 0;
if (is_fullscreen != was_fullscreen)
{
@@ -3080,7 +3116,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->set_decorations = gdk_quartz_window_set_decorations;
impl_class->get_decorations = gdk_quartz_window_get_decorations;
impl_class->set_functions = gdk_quartz_window_set_functions;
impl_class->set_functions = gdk_quartz_window_set_functions;
impl_class->begin_resize_drag = gdk_quartz_window_begin_resize_drag;
impl_class->begin_move_drag = gdk_quartz_window_begin_move_drag;
impl_class->set_opacity = gdk_quartz_window_set_opacity;
+5 -5
View File
@@ -40,7 +40,9 @@ BUILT_SOURCES = \
server-decoration-client-protocol.h \
server-decoration-protocol.c \
gtk-shell-client-protocol.h \
gtk-shell-protocol.c
gtk-shell-protocol.c \
primary-selection-unstable-v1-client-protocol.h \
primary-selection-unstable-v1-protocol.c
nodist_libgdk_wayland_la_SOURCES = \
$(BUILT_SOURCES)
@@ -92,14 +94,12 @@ $(shell echo $1 | sed 's/\([a-z\-]\{1,\}\)-[a-z]\{1,\}-v[0-9]\{1,\}/\1/')
endef
%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
$(AM_V_GEN)$(SED) -i -e 's/WL_EXPORT //' $@
$(AM_V_GEN)$(WAYLAND_SCANNER) private-code < $< > $@
%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
%-protocol.c : $(srcdir)/protocol/%.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
$(AM_V_GEN)$(SED) -i -e 's/WL_EXPORT //' $@
$(AM_V_GEN)$(WAYLAND_SCANNER) private-code < $< > $@
%-server-protocol.h : $(srcdir)/protocol/%.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@
+170 -39
View File
@@ -237,7 +237,8 @@ struct _GdkWaylandSeat
uint32_t keyboard_time;
uint32_t keyboard_key_serial;
struct gtk_primary_selection_device *primary_data_device;
struct gtk_primary_selection_device *gtk_primary_data_device;
struct zwp_primary_selection_device_v1 *zwp_primary_data_device_v1;
struct wl_data_device *data_device;
GdkDragContext *drop_context;
@@ -1308,23 +1309,43 @@ static const struct wl_data_device_listener data_device_listener = {
};
static void
primary_selection_data_offer (void *data,
struct gtk_primary_selection_device *gtk_primary_selection_device,
struct gtk_primary_selection_offer *gtk_primary_offer)
primary_selection_data_offer (void *data,
gpointer primary_selection_device,
gpointer primary_offer)
{
GdkWaylandSeat *seat = data;
GDK_NOTE (EVENTS,
g_message ("primary selection offer, device %p, data offer %p",
gtk_primary_selection_device, gtk_primary_offer));
primary_selection_device, primary_offer));
gdk_wayland_selection_ensure_primary_offer (seat->display, gtk_primary_offer);
gdk_wayland_selection_ensure_primary_offer (seat->display, primary_offer);
}
static void
primary_selection_selection (void *data,
struct gtk_primary_selection_device *gtk_primary_selection_device,
struct gtk_primary_selection_offer *gtk_primary_offer)
gtk_primary_selection_data_offer (void *data,
struct gtk_primary_selection_device *primary_selection_device,
struct gtk_primary_selection_offer *primary_offer)
{
primary_selection_data_offer (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static void
zwp_primary_selection_v1_data_offer (void *data,
struct zwp_primary_selection_device_v1 *primary_selection_device,
struct zwp_primary_selection_offer_v1 *primary_offer)
{
primary_selection_data_offer (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static void
primary_selection_selection (void *data,
gpointer primary_selection_device,
gpointer primary_offer)
{
GdkWaylandSeat *seat = data;
GdkAtom selection;
@@ -1334,16 +1355,41 @@ primary_selection_selection (void *data,
GDK_NOTE (EVENTS,
g_message ("primary selection selection, device %p, data offer %p",
gtk_primary_selection_device, gtk_primary_offer));
primary_selection_device, primary_offer));
selection = gdk_atom_intern_static_string ("PRIMARY");
gdk_wayland_selection_set_offer (seat->display, selection, gtk_primary_offer);
gdk_wayland_selection_set_offer (seat->display, selection, primary_offer);
emit_selection_owner_change (seat->keyboard_focus, selection);
}
static const struct gtk_primary_selection_device_listener primary_selection_device_listener = {
primary_selection_data_offer,
primary_selection_selection,
static void
gtk_primary_selection_selection (void *data,
struct gtk_primary_selection_device *primary_selection_device,
struct gtk_primary_selection_offer *primary_offer)
{
primary_selection_selection (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static void
zwp_primary_selection_v1_selection (void *data,
struct zwp_primary_selection_device_v1 *primary_selection_device,
struct zwp_primary_selection_offer_v1 *primary_offer)
{
primary_selection_selection (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static const struct gtk_primary_selection_device_listener gtk_primary_device_listener = {
gtk_primary_selection_data_offer,
gtk_primary_selection_selection,
};
static const struct zwp_primary_selection_device_v1_listener zwp_primary_device_v1_listener = {
zwp_primary_selection_v1_data_offer,
zwp_primary_selection_v1_selection,
};
static GdkDevice * get_scroll_device (GdkWaylandSeat *seat,
@@ -1986,6 +2032,7 @@ keyboard_handle_leave (void *data,
g_object_unref (seat->keyboard_focus);
seat->keyboard_focus = NULL;
seat->repeat_key = 0;
seat->key_modifiers = 0;
GDK_NOTE (EVENTS,
g_message ("focus out, seat %p surface %p",
@@ -2459,6 +2506,9 @@ touch_handle_down (void *data,
_gdk_wayland_display_update_serial (display, serial);
if (!wl_surface)
return;
touch = gdk_wayland_seat_add_touch (seat, id, wl_surface);
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
@@ -2494,6 +2544,9 @@ touch_handle_up (void *data,
_gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_seat_get_touch (seat, id);
if (!touch)
return;
event = _create_touch_event (seat, touch, GDK_TOUCH_END, time);
GDK_NOTE (EVENTS,
@@ -2520,6 +2573,9 @@ touch_handle_motion (void *data,
GdkEvent *event;
touch = gdk_wayland_seat_get_touch (seat, id);
if (!touch)
return;
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
@@ -2815,6 +2871,14 @@ _gdk_wayland_seat_remove_tablet (GdkWaylandSeat *seat,
zwp_tablet_v2_destroy (tablet->wp_tablet);
while (tablet->pads)
{
GdkWaylandTabletPadData *pad = tablet->pads->data;
pad->current_tablet = NULL;
tablet->pads = g_list_remove (tablet->pads, pad);
}
device_manager->devices =
g_list_remove (device_manager->devices, tablet->master);
device_manager->devices =
@@ -3625,19 +3689,21 @@ tablet_tool_handle_proximity_in (void *data,
struct zwp_tablet_tool_v2 *wp_tablet_tool,
uint32_t serial,
struct zwp_tablet_v2 *wp_tablet,
struct wl_surface *surface)
struct wl_surface *wl_surface)
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
GdkWindow *window = wl_surface_get_user_data (surface);
GdkWindow *window;
GdkEvent *event;
if (!surface)
return;
if (!wl_surface)
return;
window = wl_surface_get_user_data (wl_surface);
if (!GDK_IS_WINDOW (window))
return;
return;
tool->current_tablet = tablet;
tablet->current_tool = tool;
@@ -3671,8 +3737,13 @@ tablet_tool_handle_proximity_out (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
GdkEvent *event;
#ifdef G_ENABLE_DEBUG
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
#endif
if (!tablet)
return;
GDK_NOTE (EVENTS,
g_message ("proximity out, seat %p, tool %d", seat,
@@ -3730,7 +3801,7 @@ tablet_tool_handle_down (void *data,
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
if (!tablet->pointer_info.focus)
if (!tablet || !tablet->pointer_info.focus)
return;
_gdk_wayland_display_update_serial (display_wayland, serial);
@@ -3747,7 +3818,7 @@ tablet_tool_handle_up (void *data,
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
if (!tablet->pointer_info.focus)
if (!tablet || !tablet->pointer_info.focus)
return;
tablet_create_button_event_frame (tablet, GDK_BUTTON_RELEASE, GDK_BUTTON_PRIMARY);
@@ -3766,6 +3837,9 @@ tablet_tool_handle_motion (void *data,
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
GdkEvent *event;
if (!tablet)
return;
tablet->pointer_info.surface_x = wl_fixed_to_double (sx);
tablet->pointer_info.surface_y = wl_fixed_to_double (sy);
@@ -3798,7 +3872,12 @@ tablet_tool_handle_pressure (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
_gdk_device_translate_axis (tablet->current_device, axis_index,
pressure, &tablet->axes[axis_index]);
@@ -3815,7 +3894,12 @@ tablet_tool_handle_distance (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
_gdk_device_translate_axis (tablet->current_device, axis_index,
distance, &tablet->axes[axis_index]);
@@ -3833,8 +3917,14 @@ tablet_tool_handle_tilt (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
gint ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
gint xtilt_axis_index;
gint ytilt_axis_index;
if (!tablet)
return;
xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
_gdk_device_translate_axis (tablet->current_device, xtilt_axis_index,
wl_fixed_to_double (xtilt),
@@ -3861,7 +3951,7 @@ tablet_tool_handle_button (void *data,
GdkEventType evtype;
guint n_button;
if (!tablet->pointer_info.focus)
if (!tablet || !tablet->pointer_info.focus)
return;
tablet->pointer_info.press_serial = serial;
@@ -3892,7 +3982,12 @@ tablet_tool_handle_rotation (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
_gdk_device_translate_axis (tablet->current_device, axis_index,
wl_fixed_to_double (degrees),
@@ -3911,7 +4006,12 @@ tablet_tool_handle_slider (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
gint axis_index;
if (!tablet)
return;
axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
_gdk_device_translate_axis (tablet->current_device, axis_index,
position, &tablet->axes[axis_index]);
@@ -3929,9 +4029,12 @@ tablet_tool_handle_wheel (void *data,
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkWaylandSeat *seat;
GdkEvent *event;
if (!tablet)
return;
GDK_NOTE (EVENTS,
g_message ("tablet tool %d wheel %d/%d",
gdk_device_tool_get_tool_type (tool->tool), degrees, clicks));
@@ -3939,6 +4042,8 @@ tablet_tool_handle_wheel (void *data,
if (clicks == 0)
return;
seat = GDK_WAYLAND_SEAT (tablet->seat);
/* Send smooth event */
event = create_scroll_event (seat, &tablet->pointer_info,
tablet->master, tablet->current_device, FALSE);
@@ -3964,6 +4069,9 @@ tablet_tool_handle_frame (void *data,
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkEvent *frame_event;
if (!tablet)
return;
GDK_NOTE (EVENTS,
g_message ("tablet frame, time %d", time));
@@ -4587,6 +4695,9 @@ pointer_surface_update_scale (GdkDevice *device)
return;
}
if (!pointer->pointer_surface_outputs)
return;
scale = 1;
for (l = pointer->pointer_surface_outputs; l != NULL; l = l->next)
{
@@ -4596,6 +4707,8 @@ pointer_surface_update_scale (GdkDevice *device)
scale = MAX (scale, output_scale);
}
if (pointer->current_output_scale == scale)
return;
pointer->current_output_scale = scale;
if (pointer->cursor)
@@ -5067,13 +5180,23 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
wl_seat_add_listener (seat->wl_seat, &seat_listener, seat);
wl_seat_set_user_data (seat->wl_seat, seat);
if (display_wayland->primary_selection_manager)
if (display_wayland->zwp_primary_selection_manager_v1)
{
seat->primary_data_device =
gtk_primary_selection_device_manager_get_device (display_wayland->primary_selection_manager,
seat->zwp_primary_data_device_v1 =
zwp_primary_selection_device_manager_v1_get_device (display_wayland->zwp_primary_selection_manager_v1,
seat->wl_seat);
zwp_primary_selection_device_v1_add_listener (seat->zwp_primary_data_device_v1,
&zwp_primary_device_v1_listener,
seat);
}
else if (display_wayland->gtk_primary_selection_manager)
{
seat->gtk_primary_data_device =
gtk_primary_selection_device_manager_get_device (display_wayland->gtk_primary_selection_manager,
seat->wl_seat);
gtk_primary_selection_device_add_listener (seat->primary_data_device,
&primary_selection_device_listener, seat);
gtk_primary_selection_device_add_listener (seat->gtk_primary_data_device,
&gtk_primary_device_listener,
seat);
}
seat->data_device =
@@ -5344,8 +5467,8 @@ gdk_wayland_seat_set_selection (GdkSeat *seat,
}
void
gdk_wayland_seat_set_primary (GdkSeat *seat,
struct gtk_primary_selection_source *source)
gdk_wayland_seat_set_primary (GdkSeat *seat,
gpointer source)
{
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
GdkWaylandDisplay *display_wayland;
@@ -5355,8 +5478,16 @@ gdk_wayland_seat_set_primary (GdkSeat *seat,
{
display_wayland = GDK_WAYLAND_DISPLAY (gdk_seat_get_display (seat));
serial = _gdk_wayland_display_get_serial (display_wayland);
gtk_primary_selection_device_set_selection (wayland_seat->primary_data_device,
source, serial);
if (wayland_seat->zwp_primary_data_device_v1)
{
zwp_primary_selection_device_v1_set_selection (wayland_seat->zwp_primary_data_device_v1,
source, serial);
}
else if (wayland_seat->gtk_primary_data_device)
{
gtk_primary_selection_device_set_selection (wayland_seat->gtk_primary_data_device,
source, serial);
}
}
}
+10 -2
View File
@@ -84,7 +84,7 @@
#define MIN_SYSTEM_BELL_DELAY_MS 20
#define GTK_SHELL1_VERSION 3
#define GTK_SHELL1_VERSION 4
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland);
@@ -476,10 +476,16 @@ gdk_registry_handle_global (void *data,
}
else if (strcmp (interface, "gtk_primary_selection_device_manager") == 0)
{
display_wayland->primary_selection_manager =
display_wayland->gtk_primary_selection_manager =
wl_registry_bind(display_wayland->wl_registry, id,
&gtk_primary_selection_device_manager_interface, 1);
}
else if (strcmp (interface, "zwp_primary_selection_device_manager_v1") == 0)
{
display_wayland->zwp_primary_selection_manager_v1 =
wl_registry_bind(display_wayland->wl_registry, id,
&zwp_primary_selection_device_manager_v1_interface, 1);
}
else if (strcmp (interface, "zwp_tablet_manager_v2") == 0)
{
display_wayland->tablet_manager =
@@ -729,6 +735,8 @@ gdk_wayland_display_finalize (GObject *object)
g_ptr_array_free (display_wayland->monitors, TRUE);
wl_display_disconnect(display_wayland->wl_display);
G_OBJECT_CLASS (gdk_wayland_display_parent_class)->finalize (object);
}
+4 -2
View File
@@ -35,6 +35,7 @@
#include <gdk/wayland/keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h>
#include <gdk/wayland/server-decoration-client-protocol.h>
#include <gdk/wayland/xdg-output-unstable-v1-client-protocol.h>
#include <gdk/wayland/primary-selection-unstable-v1-client-protocol.h>
#include <glib.h>
#include <gdk/gdkkeys.h>
@@ -48,7 +49,7 @@
G_BEGIN_DECLS
#define GDK_WAYLAND_MAX_THEME_SCALE 3
#define GDK_WAYLAND_MAX_THEME_SCALE 4
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
#define GDK_ZWP_POINTER_GESTURES_V1_VERSION 1
@@ -88,7 +89,8 @@ struct _GdkWaylandDisplay
struct wl_data_device_manager *data_device_manager;
struct wl_subcompositor *subcompositor;
struct zwp_pointer_gestures_v1 *pointer_gestures;
struct gtk_primary_selection_device_manager *primary_selection_manager;
struct gtk_primary_selection_device_manager *gtk_primary_selection_manager;
struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_manager_v1;
struct zwp_tablet_manager_v2 *tablet_manager;
struct zxdg_exporter_v1 *xdg_exporter;
struct zxdg_importer_v1 *xdg_importer;
+1 -1
View File
@@ -374,7 +374,7 @@ gdk_wayland_drag_context_set_hotspot (GdkDragContext *context,
return;
_gdk_wayland_window_offset_next_wl_buffer (context_wayland->dnd_window,
-hot_x, -hot_y);
prev_hot_x - hot_x, prev_hot_y - hot_y);
gdk_window_invalidate_rect (context_wayland->dnd_window, &damage_rect, FALSE);
}
-1
View File
@@ -31,7 +31,6 @@
#include <limits.h>
#include <errno.h>
#include <sys/mman.h>
#include <fribidi.h>
#include "gdk.h"
#include "gdkwayland.h"
+4 -4
View File
@@ -191,8 +191,8 @@ struct wl_data_device * gdk_wayland_device_get_data_device (GdkDevice *gdk_devic
void gdk_wayland_seat_set_selection (GdkSeat *seat,
struct wl_data_source *source);
void gdk_wayland_seat_set_primary (GdkSeat *seat,
struct gtk_primary_selection_source *source);
void gdk_wayland_seat_set_primary (GdkSeat *seat,
gpointer source);
GdkDragContext * gdk_wayland_device_get_drop_context (GdkDevice *gdk_device);
@@ -249,8 +249,8 @@ void gdk_wayland_selection_free (GdkWaylandSelection *selection);
void gdk_wayland_selection_ensure_offer (GdkDisplay *display,
struct wl_data_offer *wl_offer);
void gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
struct gtk_primary_selection_offer *wp_offer);
void gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
gpointer wp_offer);
void gdk_wayland_selection_set_offer (GdkDisplay *display,
GdkAtom selection,
+51 -12
View File
@@ -351,25 +351,52 @@ update_xft_settings (GdkScreen *screen)
{
TranslationEntry *entry;
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "antialiasing");
antialiasing = entry->fallback.i;
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-antialiasing");
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "hinting");
hinting = entry->fallback.i;
if (entry->valid)
{
antialiasing = entry->fallback.i;
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "rgba-order");
order = entry->fallback.i;
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-hinting");
hinting = entry->fallback.i;
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-rgba-order");
order = entry->fallback.i;
}
else
{
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "antialiasing");
antialiasing = entry->fallback.i;
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "hinting");
hinting = entry->fallback.i;
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "rgba-order");
order = entry->fallback.i;
}
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "text-scaling-factor");
dpi = 96.0 * entry->fallback.i / 65536.0 * 1024; /* Xft wants 1/1024th of an inch */
}
else
{
settings = g_hash_table_lookup (screen_wayland->settings,
"org.gnome.settings-daemon.plugins.xsettings");
TranslationEntry *entry;
if (settings)
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-antialiasing");
if (entry && entry->valid)
{
settings = g_hash_table_lookup (screen_wayland->settings,
"org.gnome.desktop.interface");
antialiasing = g_settings_get_enum (settings, "font-antialiasing");
hinting = g_settings_get_enum (settings, "font-hinting");
order = g_settings_get_enum (settings, "font-rgba-order");
}
else if (g_hash_table_contains (screen_wayland->settings,
"org.gnome.settings-daemon.plugins.xsettings"))
{
settings = g_hash_table_lookup (screen_wayland->settings,
"org.gnome.settings-daemon.plugins.xsettings");
antialiasing = g_settings_get_enum (settings, "antialiasing");
hinting = g_settings_get_enum (settings, "hinting");
order = g_settings_get_enum (settings, "rgba-order");
@@ -504,6 +531,8 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, "org.gnome.desktop.interface", "gtk-enable-primary-paste", "gtk-enable-primary-paste", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, "org.gnome.desktop.interface", "overlay-scrolling", "gtk-overlay-scrolling", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, "org.gnome.desktop.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 400 } },
{ FALSE, "org.gnome.desktop.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 400 } },
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
{ FALSE, "org.gnome.desktop.sound", "theme-name", "gtk-sound-theme-name", G_TYPE_STRING, { .s = "freedesktop" } },
@@ -513,6 +542,10 @@ static TranslationEntry translations[] = {
{ FALSE, "org.gnome.desktop.privacy", "remember-recent-files", "gtk-recent-files-enabled", G_TYPE_BOOLEAN, { .b = TRUE } },
{ FALSE, WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
{ FALSE, CLASSIC_WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.desktop.interface", "font-rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
@@ -604,11 +637,14 @@ apply_portal_setting (TranslationEntry *entry,
entry->fallback.b = g_variant_get_boolean (value);
break;
case G_TYPE_NONE:
if (strcmp (entry->key, "antialiasing") == 0)
if (strcmp (entry->key, "antialiasing") == 0 ||
strcmp (entry->key, "font-antialiasing") == 0)
entry->fallback.i = get_antialiasing (g_variant_get_string (value, NULL));
else if (strcmp (entry->key, "hinting") == 0)
else if (strcmp (entry->key, "hinting") == 0 ||
strcmp (entry->key, "font-hinting") == 0)
entry->fallback.i = get_hinting (g_variant_get_string (value, NULL));
else if (strcmp (entry->key, "rgba-order") == 0)
else if (strcmp (entry->key, "rgba-order") == 0 ||
strcmp (entry->key, "font-rgba-order") == 0)
entry->fallback.i = get_order (g_variant_get_string (value, NULL));
else if (strcmp (entry->key, "text-scaling-factor") == 0)
entry->fallback.i = (int) (g_variant_get_double (value) * 65536.0);
@@ -725,6 +761,7 @@ init_settings (GdkScreen *screen)
char *a = g_variant_print (v, FALSE);
g_debug ("Using portal setting for %s %s: %s\n", schema, key, a);
g_free (a);
entry->valid = TRUE;
apply_portal_setting (entry, v, screen);
}
else
@@ -1539,10 +1576,12 @@ xdg_output_handle_description (void *data,
struct zxdg_output_v1 *xdg_output,
const char *description)
{
#ifdef G_ENABLE_DEBUG
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *) data;
GDK_NOTE (MISC,
g_message ("handle description xdg-output %d", monitor->id));
#endif
}
static const struct zxdg_output_v1_listener xdg_output_listener = {
+376 -149
View File
@@ -53,12 +53,14 @@ struct _SelectionBuffer
struct _StoredSelection
{
GdkWaylandSelection *selection;
GdkWindow *source;
GCancellable *cancellable;
guchar *data;
gsize data_len;
GdkAtom type;
gint fd;
GdkAtom selection_atom;
GPtrArray *pending_writes; /* Array of AsyncWriteData */
};
struct _DataOfferData
@@ -71,7 +73,7 @@ struct _DataOfferData
struct _AsyncWriteData
{
GOutputStream *stream;
GdkWaylandSelection *selection;
StoredSelection *stored_selection;
gsize index;
};
@@ -97,11 +99,12 @@ struct _GdkWaylandSelection
GHashTable *offers; /* Currently alive offers, Hashtable of wl_data_offer->DataOfferData */
/* Source-side data */
StoredSelection stored_selection;
GPtrArray *stored_selections; /* Array of StoredSelection */
GdkAtom current_request_selection;
GArray *source_targets;
GdkAtom requested_target;
struct gtk_primary_selection_source *primary_source;
gpointer primary_source;
GdkWindow *primary_owner;
struct wl_data_source *clipboard_source;
@@ -113,10 +116,12 @@ struct _GdkWaylandSelection
static void selection_buffer_read (SelectionBuffer *buffer);
static void async_write_data_write (AsyncWriteData *write_data);
static void async_write_data_free (AsyncWriteData *write_data);
static void emit_selection_clear (GdkDisplay *display, GdkAtom selection);
static void emit_empty_selection_notify (GdkWindow *requestor,
GdkAtom selection,
GdkAtom target);
static void gdk_wayland_selection_handle_next_request (GdkWaylandSelection *wayland_selection);
static void
selection_buffer_notify (SelectionBuffer *buffer)
@@ -317,6 +322,89 @@ data_offer_data_free (DataOfferData *info)
g_slice_free (DataOfferData, info);
}
static StoredSelection *
stored_selection_new (GdkWaylandSelection *wayland_selection,
GdkWindow *source,
GdkAtom selection,
GdkAtom type)
{
StoredSelection *stored_selection;
stored_selection = g_new0 (StoredSelection, 1);
stored_selection->source = source;
stored_selection->type = type;
stored_selection->selection_atom = selection;
stored_selection->selection = wayland_selection;
stored_selection->cancellable = g_cancellable_new ();
stored_selection->pending_writes =
g_ptr_array_new_with_free_func ((GDestroyNotify) async_write_data_free);
return stored_selection;
}
static void
stored_selection_add_data (StoredSelection *stored_selection,
GdkPropMode mode,
guchar *data,
gsize data_len)
{
if (mode == GDK_PROP_MODE_REPLACE)
{
g_free (stored_selection->data);
stored_selection->data = g_memdup (data, data_len);
stored_selection->data_len = data_len;
}
else
{
GArray *array;
array = g_array_new (TRUE, TRUE, sizeof (guchar));
g_array_append_vals (array, stored_selection->data, stored_selection->data_len);
if (mode == GDK_PROP_MODE_APPEND)
g_array_append_vals (array, data, data_len);
else if (mode == GDK_PROP_MODE_PREPEND)
g_array_prepend_vals (array, data, data_len);
g_free (stored_selection->data);
stored_selection->data_len = array->len;
stored_selection->data = (guchar *) g_array_free (array, FALSE);
}
}
static void
stored_selection_free (StoredSelection *stored_selection)
{
g_cancellable_cancel (stored_selection->cancellable);
g_object_unref (stored_selection->cancellable);
g_ptr_array_unref (stored_selection->pending_writes);
g_free (stored_selection->data);
g_free (stored_selection);
}
static void
stored_selection_notify_write (StoredSelection *stored_selection)
{
gint i;
for (i = 0; i < stored_selection->pending_writes->len; i++)
{
AsyncWriteData *write_data;
write_data = g_ptr_array_index (stored_selection->pending_writes, i);
async_write_data_write (write_data);
}
}
static void
stored_selection_cancel_write (StoredSelection *stored_selection)
{
g_cancellable_cancel (stored_selection->cancellable);
g_object_unref (stored_selection->cancellable);
stored_selection->cancellable = g_cancellable_new ();
g_ptr_array_set_size (stored_selection->pending_writes, 0);
}
GdkWaylandSelection *
gdk_wayland_selection_new (void)
{
@@ -339,11 +427,25 @@ gdk_wayland_selection_new (void)
selection->offers =
g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) data_offer_data_free);
selection->stored_selection.fd = -1;
selection->stored_selections =
g_ptr_array_new_with_free_func ((GDestroyNotify) stored_selection_free);
selection->source_targets = g_array_new (FALSE, FALSE, sizeof (GdkAtom));
return selection;
}
static void
primary_selection_source_destroy (gpointer primary_source)
{
GdkDisplay *display = gdk_display_get_default ();
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
if (display_wayland->zwp_primary_selection_manager_v1)
zwp_primary_selection_source_v1_destroy (primary_source);
else if (display_wayland->gtk_primary_selection_manager)
gtk_primary_selection_source_destroy (primary_source);
}
void
gdk_wayland_selection_free (GdkWaylandSelection *selection)
{
@@ -355,19 +457,10 @@ gdk_wayland_selection_free (GdkWaylandSelection *selection)
g_array_unref (selection->source_targets);
g_hash_table_destroy (selection->offers);
g_free (selection->stored_selection.data);
if (selection->stored_selection.cancellable)
{
g_cancellable_cancel (selection->stored_selection.cancellable);
g_object_unref (selection->stored_selection.cancellable);
}
if (selection->stored_selection.fd > 0)
close (selection->stored_selection.fd);
g_ptr_array_unref (selection->stored_selections);
if (selection->primary_source)
gtk_primary_selection_source_destroy (selection->primary_source);
primary_selection_source_destroy (selection->primary_source);
if (selection->clipboard_source)
wl_data_source_destroy (selection->clipboard_source);
if (selection->dnd_source)
@@ -465,27 +558,47 @@ static const struct wl_data_offer_listener data_offer_listener = {
};
static void
primary_offer_offer (void *data,
struct gtk_primary_selection_offer *gtk_offer,
const char *type)
primary_offer_offer (void *data,
gpointer offer,
const char *type)
{
GdkWaylandSelection *selection = data;
DataOfferData *info;
GdkAtom atom = gdk_atom_intern (type, FALSE);
info = g_hash_table_lookup (selection->offers, gtk_offer);
info = g_hash_table_lookup (selection->offers, offer);
if (!info || g_list_find (info->targets, atom))
return;
GDK_NOTE (EVENTS,
g_message ("primary offer offer, offer %p, type = %s", gtk_offer, type));
g_message ("primary offer offer, offer %p, type = %s", offer, type));
info->targets = g_list_prepend (info->targets, atom);
}
static const struct gtk_primary_selection_offer_listener primary_offer_listener = {
primary_offer_offer,
static void
gtk_primary_offer_offer (void *data,
struct gtk_primary_selection_offer *offer,
const char *type)
{
primary_offer_offer (data, (gpointer) offer, type);
}
static void
zwp_primary_offer_v1_offer (void *data,
struct zwp_primary_selection_offer_v1 *offer,
const char *type)
{
primary_offer_offer (data, (gpointer) offer, type);
}
static const struct gtk_primary_selection_offer_listener gtk_primary_offer_listener = {
gtk_primary_offer_offer,
};
static const struct zwp_primary_selection_offer_v1_listener zwp_primary_offer_listener_v1 = {
zwp_primary_offer_v1_offer,
};
SelectionData *
@@ -523,9 +636,10 @@ gdk_wayland_selection_ensure_offer (GdkDisplay *display,
}
void
gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
struct gtk_primary_selection_offer *gtk_offer)
gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
gpointer gtk_offer)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
DataOfferData *info;
@@ -533,12 +647,24 @@ gdk_wayland_selection_ensure_primary_offer (GdkDisplay *
if (!info)
{
info = data_offer_data_new (gtk_offer,
(GDestroyNotify) gtk_primary_selection_offer_destroy);
g_hash_table_insert (selection->offers, gtk_offer, info);
gtk_primary_selection_offer_add_listener (gtk_offer,
&primary_offer_listener,
selection);
if (display_wayland->zwp_primary_selection_manager_v1)
{
info = data_offer_data_new (gtk_offer,
(GDestroyNotify) zwp_primary_selection_offer_v1_destroy);
g_hash_table_insert (selection->offers, gtk_offer, info);
zwp_primary_selection_offer_v1_add_listener (gtk_offer,
&zwp_primary_offer_listener_v1,
selection);
}
else if (display_wayland->gtk_primary_selection_manager)
{
info = data_offer_data_new (gtk_offer,
(GDestroyNotify) gtk_primary_selection_offer_destroy);
g_hash_table_insert (selection->offers, gtk_offer, info);
gtk_primary_selection_offer_add_listener (gtk_offer,
&gtk_primary_offer_listener,
selection);
}
}
}
@@ -620,16 +746,15 @@ gdk_wayland_selection_emit_request (GdkWindow *window,
}
static AsyncWriteData *
async_write_data_new (GdkWaylandSelection *selection)
async_write_data_new (StoredSelection *stored_selection,
gint fd)
{
AsyncWriteData *write_data;
write_data = g_slice_new0 (AsyncWriteData);
write_data->selection = selection;
write_data->stream =
g_unix_output_stream_new (selection->stored_selection.fd, TRUE);
selection->stored_selection.fd = -1;
write_data->stored_selection = stored_selection;
write_data->stream = g_unix_output_stream_new (fd, TRUE);
g_ptr_array_add (stored_selection->pending_writes, write_data);
return write_data;
}
@@ -654,68 +779,89 @@ async_write_data_cb (GObject *object,
res, &error);
if (error)
{
if (error->domain != G_IO_ERROR ||
error->code != G_IO_ERROR_CANCELLED)
g_warning ("Error writing selection data: %s", error->message);
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
g_warning ("Error writing selection data: %s", error->message);
g_ptr_array_remove_fast (write_data->stored_selection->pending_writes,
write_data);
}
g_error_free (error);
async_write_data_free (write_data);
return;
}
write_data->index += bytes_written;
if (write_data->index <
write_data->selection->stored_selection.data_len)
if (write_data->index < write_data->stored_selection->data_len)
{
/* Write the next chunk */
async_write_data_write (write_data);
}
else
async_write_data_free (write_data);
{
g_ptr_array_remove_fast (write_data->stored_selection->pending_writes,
write_data);
}
}
static void
async_write_data_write (AsyncWriteData *write_data)
{
GdkWaylandSelection *selection = write_data->selection;
gsize buf_len;
guchar *buf;
buf = selection->stored_selection.data;
buf_len = selection->stored_selection.data_len;
buf = write_data->stored_selection->data;
buf_len = write_data->stored_selection->data_len;
g_output_stream_write_async (write_data->stream,
&buf[write_data->index],
buf_len - write_data->index,
G_PRIORITY_DEFAULT,
selection->stored_selection.cancellable,
write_data->stored_selection->cancellable,
async_write_data_cb,
write_data);
}
static gboolean
gdk_wayland_selection_check_write (GdkWaylandSelection *selection)
static StoredSelection *
gdk_wayland_selection_find_stored_selection (GdkWaylandSelection *wayland_selection,
GdkWindow *window,
GdkAtom selection,
GdkAtom type)
{
AsyncWriteData *write_data;
gint i;
if (selection->stored_selection.fd < 0)
return FALSE;
/* Cancel any previous ongoing async write */
if (selection->stored_selection.cancellable)
for (i = 0; i < wayland_selection->stored_selections->len; i++)
{
g_cancellable_cancel (selection->stored_selection.cancellable);
g_object_unref (selection->stored_selection.cancellable);
StoredSelection *stored_selection;
stored_selection = g_ptr_array_index (wayland_selection->stored_selections, i);
if (stored_selection->source == window &&
stored_selection->selection_atom == selection &&
stored_selection->type == type)
return stored_selection;
}
selection->stored_selection.cancellable = g_cancellable_new ();
return NULL;
}
write_data = async_write_data_new (selection);
async_write_data_write (write_data);
selection->stored_selection.fd = -1;
static void
gdk_wayland_selection_reset_selection (GdkWaylandSelection *wayland_selection,
GdkAtom selection)
{
gint i = 0;
return TRUE;
while (i < wayland_selection->stored_selections->len)
{
StoredSelection *stored_selection;
stored_selection = g_ptr_array_index (wayland_selection->stored_selections, i);
if (stored_selection->selection_atom == selection)
g_ptr_array_remove_index_fast (wayland_selection->stored_selections, i);
else
i++;
}
}
void
@@ -727,51 +873,50 @@ gdk_wayland_selection_store (GdkWindow *window,
{
GdkDisplay *display = gdk_window_get_display (window);
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
GArray *array;
StoredSelection *stored_selection;
if (type == gdk_atom_intern_static_string ("NULL"))
return;
if (selection->current_request_selection == GDK_NONE)
return;
array = g_array_new (TRUE, FALSE, sizeof (guchar));
g_array_append_vals (array, data, len);
stored_selection =
gdk_wayland_selection_find_stored_selection (selection, window,
selection->current_request_selection,
type);
if (selection->stored_selection.data)
if (!stored_selection)
{
if (mode != GDK_PROP_MODE_REPLACE &&
type != selection->stored_selection.type)
{
gchar *type_str, *stored_str;
type_str = gdk_atom_name (type);
stored_str = gdk_atom_name (selection->stored_selection.type);
g_warning (G_STRLOC ": Attempted to append/prepend selection data with "
"type %s into the current selection with type %s",
type_str, stored_str);
g_free (type_str);
g_free (stored_str);
return;
}
/* In these cases we also replace the stored data, so we
* apply the inverse operation into the just given data.
*/
if (mode == GDK_PROP_MODE_APPEND)
g_array_prepend_vals (array, selection->stored_selection.data,
selection->stored_selection.data_len - 1);
else if (mode == GDK_PROP_MODE_PREPEND)
g_array_append_vals (array, selection->stored_selection.data,
selection->stored_selection.data_len - 1);
g_free (selection->stored_selection.data);
stored_selection = stored_selection_new (selection, window,
selection->current_request_selection,
type);
g_ptr_array_add (selection->stored_selections, stored_selection);
}
selection->stored_selection.source = window;
selection->stored_selection.data_len = array->len;
selection->stored_selection.data = (guchar *) g_array_free (array, FALSE);
selection->stored_selection.type = type;
if ((mode == GDK_PROP_MODE_PREPEND ||
mode == GDK_PROP_MODE_REPLACE) &&
stored_selection->data &&
stored_selection->pending_writes->len > 0)
{
/* If a prepend/replace action happens, all current readers are
* pretty much stale.
*/
stored_selection_cancel_write (stored_selection);
}
gdk_wayland_selection_check_write (selection);
stored_selection_add_data (stored_selection, mode, data, len);
if (stored_selection->data)
stored_selection_notify_write (stored_selection);
else
{
g_ptr_array_remove_fast (selection->stored_selections,
stored_selection);
}
/* Handle the next GDK_SELECTION_REQUEST / store, if any */
selection->current_request_selection = GDK_NONE;
gdk_wayland_selection_handle_next_request (selection);
}
static SelectionBuffer *
@@ -818,6 +963,28 @@ gdk_wayland_selection_source_handles_target (GdkWaylandSelection *wayland_select
return FALSE;
}
static void
gdk_wayland_selection_handle_next_request (GdkWaylandSelection *wayland_selection)
{
gint i;
for (i = 0; i < wayland_selection->stored_selections->len; i++)
{
StoredSelection *stored_selection;
stored_selection = g_ptr_array_index (wayland_selection->stored_selections, i);
if (!stored_selection->data)
{
gdk_wayland_selection_emit_request (stored_selection->source,
stored_selection->selection_atom,
stored_selection->type);
wayland_selection->current_request_selection = stored_selection->selection_atom;
break;
}
}
}
static gboolean
gdk_wayland_selection_request_target (GdkWaylandSelection *wayland_selection,
GdkWindow *window,
@@ -825,33 +992,41 @@ gdk_wayland_selection_request_target (GdkWaylandSelection *wayland_selection,
GdkAtom target,
gint fd)
{
if (wayland_selection->stored_selection.fd == fd &&
wayland_selection->requested_target == target)
return FALSE;
StoredSelection *stored_selection;
AsyncWriteData *write_data;
/* If we didn't issue gdk_wayland_selection_check_write() yet
* on a previous fd, it will still linger here. Just close it,
* as we can't have more than one fd on the fly.
*/
if (wayland_selection->stored_selection.fd >= 0)
close (wayland_selection->stored_selection.fd);
wayland_selection->stored_selection.fd = fd;
wayland_selection->requested_target = target;
if (window &&
gdk_wayland_selection_source_handles_target (wayland_selection, target))
{
gdk_wayland_selection_emit_request (window, selection, target);
return TRUE;
}
else
if (!window ||
!gdk_wayland_selection_source_handles_target (wayland_selection, target))
{
close (fd);
wayland_selection->stored_selection.fd = -1;
return FALSE;
}
return FALSE;
stored_selection =
gdk_wayland_selection_find_stored_selection (wayland_selection, window,
selection, target);
if (stored_selection && stored_selection->data)
{
/* Fast path, we already have the type cached */
write_data = async_write_data_new (stored_selection, fd);
async_write_data_write (write_data);
return TRUE;
}
if (!stored_selection)
{
stored_selection = stored_selection_new (wayland_selection, window,
selection, target);
g_ptr_array_add (wayland_selection->stored_selections, stored_selection);
}
write_data = async_write_data_new (stored_selection, fd);
if (wayland_selection->current_request_selection == GDK_NONE)
gdk_wayland_selection_handle_next_request (wayland_selection);
return TRUE;
}
static void
@@ -903,11 +1078,10 @@ data_source_send (void *data,
if (!window)
return;
if (!gdk_wayland_selection_request_target (wayland_selection, window,
selection,
gdk_atom_intern (mime_type, FALSE),
fd))
gdk_wayland_selection_check_write (wayland_selection);
gdk_wayland_selection_request_target (wayland_selection, window,
selection,
gdk_atom_intern (mime_type, FALSE),
fd);
}
static void
@@ -1009,10 +1183,10 @@ static const struct wl_data_source_listener data_source_listener = {
};
static void
primary_source_send (void *data,
struct gtk_primary_selection_source *source,
const char *mime_type,
int32_t fd)
primary_source_send (void *data,
gpointer source,
const char *mime_type,
int32_t fd)
{
GdkWaylandSelection *wayland_selection = data;
@@ -1026,17 +1200,34 @@ primary_source_send (void *data,
return;
}
if (!gdk_wayland_selection_request_target (wayland_selection,
wayland_selection->primary_owner,
atoms[ATOM_PRIMARY],
gdk_atom_intern (mime_type, FALSE),
fd))
gdk_wayland_selection_check_write (wayland_selection);
gdk_wayland_selection_request_target (wayland_selection,
wayland_selection->primary_owner,
atoms[ATOM_PRIMARY],
gdk_atom_intern (mime_type, FALSE),
fd);
}
static void
primary_source_cancelled (void *data,
struct gtk_primary_selection_source *source)
gtk_primary_source_send (void *data,
struct gtk_primary_selection_source *source,
const char *mime_type,
int32_t fd)
{
primary_source_send (data, (gpointer) source, mime_type, fd);
}
static void
zwp_primary_source_v1_send (void *data,
struct zwp_primary_selection_source_v1 *source,
const char *mime_type,
int32_t fd)
{
primary_source_send (data, (gpointer) source, mime_type, fd);
}
static void
primary_source_cancelled (void *data,
gpointer source)
{
GdkDisplay *display;
GdkAtom atom;
@@ -1052,9 +1243,28 @@ primary_source_cancelled (void *data,
gdk_wayland_selection_unset_data_source (display, atom);
}
static const struct gtk_primary_selection_source_listener primary_source_listener = {
primary_source_send,
primary_source_cancelled,
static void
gtk_primary_source_cancelled (void *data,
struct gtk_primary_selection_source *source)
{
primary_source_cancelled (data, source);
}
static void
zwp_primary_source_v1_cancelled (void *data,
struct zwp_primary_selection_source_v1 *source)
{
primary_source_cancelled (data, source);
}
static const struct gtk_primary_selection_source_listener gtk_primary_source_listener = {
gtk_primary_source_send,
gtk_primary_source_cancelled,
};
static const struct zwp_primary_selection_source_v1_listener zwp_primary_source_v1_listener = {
zwp_primary_source_v1_send,
zwp_primary_source_v1_cancelled,
};
struct wl_data_source *
@@ -1076,11 +1286,11 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
{
if (wayland_selection->primary_source &&
(!owner || owner == wayland_selection->primary_owner))
return (gpointer) wayland_selection->primary_source;
return wayland_selection->primary_source;
if (wayland_selection->primary_source)
{
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
primary_selection_source_destroy (wayland_selection->primary_source);
wayland_selection->primary_source = NULL;
}
}
@@ -1106,11 +1316,18 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
if (selection == atoms[ATOM_PRIMARY])
{
if (display_wayland->primary_selection_manager)
if (display_wayland->zwp_primary_selection_manager_v1)
{
source = gtk_primary_selection_device_manager_create_source (display_wayland->primary_selection_manager);
source = zwp_primary_selection_device_manager_v1_create_source (display_wayland->zwp_primary_selection_manager_v1);
zwp_primary_selection_source_v1_add_listener (source,
&zwp_primary_source_v1_listener,
wayland_selection);
}
else if (display_wayland->gtk_primary_selection_manager)
{
source = gtk_primary_selection_device_manager_create_source (display_wayland->gtk_primary_selection_manager);
gtk_primary_selection_source_add_listener (source,
&primary_source_listener,
&gtk_primary_source_listener,
wayland_selection);
}
}
@@ -1150,7 +1367,7 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display,
{
if (wayland_selection->primary_source)
{
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
primary_selection_source_destroy (wayland_selection->primary_source);
wayland_selection->primary_source = NULL;
}
}
@@ -1186,6 +1403,8 @@ _gdk_wayland_display_set_selection_owner (GdkDisplay *display,
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
GdkSeat *seat = gdk_display_get_default_seat (display);
gdk_wayland_selection_reset_selection (wayland_selection, selection);
if (selection == atoms[ATOM_CLIPBOARD])
{
wayland_selection->clipboard_owner = owner;
@@ -1319,6 +1538,7 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
GdkAtom target,
guint32 time)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
const SelectionData *selection_data;
SelectionBuffer *buffer_data;
@@ -1384,9 +1604,16 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
g_unix_open_pipe (pipe_fd, FD_CLOEXEC, NULL);
if (selection == atoms[ATOM_PRIMARY])
gtk_primary_selection_offer_receive (offer, mimetype, pipe_fd[1]);
{
if (display_wayland->zwp_primary_selection_manager_v1)
zwp_primary_selection_offer_v1_receive (offer, mimetype, pipe_fd[1]);
else if (display_wayland->gtk_primary_selection_manager)
gtk_primary_selection_offer_receive (offer, mimetype, pipe_fd[1]);
}
else
wl_data_offer_receive (offer, mimetype, pipe_fd[1]);
{
wl_data_offer_receive (offer, mimetype, pipe_fd[1]);
}
stream = g_unix_input_stream_new (pipe_fd[0], TRUE);
close (pipe_fd[1]);
+12
View File
@@ -77,12 +77,24 @@ GDK_AVAILABLE_IN_3_22
gboolean gdk_wayland_window_set_transient_for_exported (GdkWindow *window,
char *parent_handle_str);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_set_application_id (GdkWindow *window,
const char *application_id);
GDK_AVAILABLE_IN_3_22
void gdk_wayland_window_announce_csd (GdkWindow *window);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_announce_ssd (GdkWindow *window);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_add_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface);
GDK_AVAILABLE_IN_3_24
void gdk_wayland_window_remove_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface);
G_END_DECLS
#endif /* __GDK_WAYLAND_WINDOW_H__ */
+371 -55
View File
@@ -202,6 +202,13 @@ struct _GdkWindowImplWayland
int saved_width;
int saved_height;
gboolean saved_size_changed;
int unconfigured_width;
int unconfigured_height;
int fixed_size_width;
int fixed_size_height;
gulong parent_surface_committed_handler;
@@ -229,6 +236,9 @@ struct _GdkWindowImplWayland
struct zxdg_imported_v1 *imported_transient_for;
GHashTable *shortcuts_inhibitors;
struct wl_callback *surface_callback;
GHashTable *frame_callback_surfaces;
};
struct _GdkWindowImplWaylandClass
@@ -266,6 +276,9 @@ static gboolean gdk_wayland_window_is_exported (GdkWindow *window);
static void gdk_wayland_window_unexport (GdkWindow *window);
static void gdk_wayland_window_announce_decoration_mode (GdkWindow *window);
static gboolean should_map_as_subsurface (GdkWindow *window);
static gboolean should_map_as_popup (GdkWindow *window);
GType _gdk_window_impl_wayland_get_type (void);
G_DEFINE_TYPE (GdkWindowImplWayland, _gdk_window_impl_wayland, GDK_TYPE_WINDOW_IMPL)
@@ -304,16 +317,54 @@ drop_cairo_surfaces (GdkWindow *window)
impl->committed_cairo_surface = NULL;
}
static int
calculate_width_without_margin (GdkWindow *window,
int width)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
return width - (impl->margin_left + impl->margin_right);
}
static int
calculate_height_without_margin (GdkWindow *window,
int height)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
return height - (impl->margin_top + impl->margin_bottom);
}
static int
calculate_width_with_margin (GdkWindow *window,
int width)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
return width + impl->margin_left + impl->margin_right;
}
static int
calculate_height_with_margin (GdkWindow *window,
int height)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
return height + impl->margin_top + impl->margin_bottom;
}
static void
_gdk_wayland_window_save_size (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (window->state & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_MAXIMIZED))
if (window->state & (GDK_WINDOW_STATE_FULLSCREEN |
GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_TILED))
return;
impl->saved_width = window->width - impl->margin_left - impl->margin_right;
impl->saved_height = window->height - impl->margin_top - impl->margin_bottom;
impl->saved_width = calculate_width_without_margin (window, window->width);
impl->saved_height = calculate_height_without_margin (window, window->height);
}
static void
@@ -321,7 +372,9 @@ _gdk_wayland_window_clear_saved_size (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (window->state & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_MAXIMIZED))
if (window->state & (GDK_WINDOW_STATE_FULLSCREEN |
GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_TILED))
return;
impl->saved_width = -1;
@@ -522,9 +575,25 @@ frame_callback (void *data,
GdkFrameClock *clock = gdk_window_get_frame_clock (window);
GdkFrameTimings *timings;
GDK_NOTE (EVENTS,
g_message ("frame %p", window));
if (callback == impl->surface_callback)
{
impl->surface_callback = NULL;
}
else
{
GHashTableIter iter;
gpointer surface_callback;
g_hash_table_iter_init (&iter, impl->frame_callback_surfaces);
while (g_hash_table_iter_next (&iter, NULL, &surface_callback))
{
if (callback == surface_callback)
{
g_hash_table_iter_replace (&iter, NULL);
break;
}
}
}
wl_callback_destroy (callback);
if (GDK_WINDOW_DESTROYED (window))
@@ -533,6 +602,9 @@ frame_callback (void *data,
if (!impl->awaiting_frame)
return;
GDK_NOTE (EVENTS,
g_message ("frame %p", window));
impl->awaiting_frame = FALSE;
_gdk_frame_clock_thaw (clock);
@@ -610,6 +682,8 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
struct wl_callback *callback;
GHashTableIter iter;
gpointer surface, surface_callback;
if (!impl->pending_commit)
return;
@@ -617,8 +691,6 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
if (window->update_freeze_count > 0)
return;
callback = wl_surface_frame (impl->display_server.wl_surface);
wl_callback_add_listener (callback, &frame_listener, window);
_gdk_frame_clock_freeze (clock);
/* Before we commit a new buffer, make sure we've backfilled
@@ -627,6 +699,24 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
if (impl->pending_buffer_attached)
read_back_cairo_surface (window);
if (impl->surface_callback == NULL)
{
callback = wl_surface_frame (impl->display_server.wl_surface);
wl_callback_add_listener (callback, &frame_listener, window);
impl->surface_callback = callback;
}
g_hash_table_iter_init (&iter, impl->frame_callback_surfaces);
while (g_hash_table_iter_next (&iter, &surface, &surface_callback))
{
if (surface_callback)
continue;
callback = wl_surface_frame (surface);
wl_callback_add_listener (callback, &frame_listener, window);
g_hash_table_iter_replace (&iter, callback);
}
/* From this commit forward, we can't write to the buffer,
* it's "live". In the future, if we need to stage more changes
* we have to allocate a new staging buffer and draw to it instead.
@@ -701,9 +791,13 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
window->impl = GDK_WINDOW_IMPL (impl);
impl->unconfigured_width = window->width;
impl->unconfigured_height = window->height;
impl->wrapper = GDK_WINDOW (window);
impl->shortcuts_inhibitors = g_hash_table_new (NULL, NULL);
impl->using_csd = TRUE;
impl->surface_callback = NULL;
impl->frame_callback_surfaces = g_hash_table_new (NULL, NULL);
if (window->width > 65535)
{
@@ -992,15 +1086,14 @@ gdk_window_impl_wayland_beep (GdkWindow *window)
static void
gdk_window_impl_wayland_finalize (GObject *object)
{
GdkWindow *window = GDK_WINDOW (object);
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
impl = GDK_WINDOW_IMPL_WAYLAND (object);
if (gdk_wayland_window_is_exported (window))
gdk_wayland_window_unexport_handle (window);
if (gdk_wayland_window_is_exported (impl->wrapper))
gdk_wayland_window_unexport_handle (impl->wrapper);
g_free (impl->title);
@@ -1016,6 +1109,7 @@ gdk_window_impl_wayland_finalize (GObject *object)
g_clear_pointer (&impl->staged_updates_region, cairo_region_destroy);
g_clear_pointer (&impl->shortcuts_inhibitors, g_hash_table_unref);
g_clear_pointer (&impl->frame_callback_surfaces, g_hash_table_unref);
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
}
@@ -1029,6 +1123,9 @@ gdk_wayland_window_configure (GdkWindow *window,
GdkDisplay *display;
GdkEvent *event;
g_return_if_fail (width > 0);
g_return_if_fail (height > 0);
event = gdk_event_new (GDK_CONFIGURE);
event->configure.window = g_object_ref (window);
event->configure.send_event = FALSE;
@@ -1069,6 +1166,30 @@ is_realized_popup (GdkWindow *window)
impl->display_server.zxdg_popup_v6);
}
static gboolean
should_inhibit_resize (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (impl->display_server.wl_subsurface)
return FALSE;
else if (impl->use_custom_surface)
return FALSE;
else if (impl->hint == GDK_WINDOW_TYPE_HINT_DND)
return FALSE;
else if (is_realized_popup (window))
return FALSE;
else if (should_map_as_popup (window))
return FALSE;
else if (should_map_as_subsurface (window))
return FALSE;
/* This should now either be, or eventually be, a toplevel window,
* and we should wait for the initial configure to really configure it.
*/
return !impl->initial_configure_received;
}
static void
gdk_wayland_window_maybe_configure (GdkWindow *window,
int width,
@@ -1079,6 +1200,12 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
gboolean is_xdg_popup;
gboolean is_visible;
impl->unconfigured_width = calculate_width_without_margin (window, width);
impl->unconfigured_height = calculate_height_without_margin (window, height);
if (should_inhibit_resize (window))
return;
if (window->width == width &&
window->height == height &&
impl->scale == scale)
@@ -1248,8 +1375,8 @@ gdk_wayland_window_get_window_geometry (GdkWindow *window,
*geometry = (GdkRectangle) {
.x = impl->margin_left,
.y = impl->margin_top,
.width = window->width - (impl->margin_left + impl->margin_right),
.height = window->height - (impl->margin_top + impl->margin_bottom)
.width = calculate_width_without_margin (window, window->width),
.height = calculate_height_without_margin (window, window->height)
};
}
@@ -1265,6 +1392,9 @@ gdk_wayland_window_sync_margin (GdkWindow *window)
return;
gdk_wayland_window_get_window_geometry (window, &geometry);
g_return_if_fail (geometry.width > 0 && geometry.height > 0);
gdk_window_set_geometry_hints (window,
&impl->geometry_hints,
impl->geometry_mask);
@@ -1502,6 +1632,14 @@ gdk_wayland_window_create_surface (GdkWindow *window)
wl_surface_add_listener (impl->display_server.wl_surface, &surface_listener, window);
}
static gboolean
should_use_fixed_size (GdkWindowState state)
{
return state & (GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_FULLSCREEN |
GDK_WINDOW_STATE_TILED);
}
static void
gdk_wayland_window_handle_configure (GdkWindow *window,
uint32_t serial)
@@ -1536,10 +1674,7 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
new_state = impl->pending.state;
impl->pending.state = 0;
fixed_size =
new_state & (GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_FULLSCREEN |
GDK_WINDOW_STATE_TILED);
fixed_size = should_use_fixed_size (new_state);
saved_size = (width == 0 && height == 0);
/* According to xdg_shell, an xdg_surface.configure with size 0x0
@@ -1549,16 +1684,23 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
* When transitioning from maximize or fullscreen state, this means
* the client should configure its size back to what it was before
* being maximize or fullscreen.
* Additionally, if we receive a manual resize request, we must prefer this
* new size instead of the compositor's size hints.
* In such a scenario, and without letting the compositor know about the new
* size, the client has to manage all dimensions and ignore any server hints.
*/
if (saved_size && !fixed_size)
if (!fixed_size && (saved_size || impl->saved_size_changed))
{
width = impl->saved_width;
height = impl->saved_height;
impl->saved_size_changed = FALSE;
}
if (width > 0 && height > 0)
{
GdkWindowHints geometry_mask = impl->geometry_mask;
int configure_width;
int configure_height;
/* Ignore size increments for maximized/fullscreen windows */
if (fixed_size)
@@ -1568,8 +1710,8 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
/* Do not reapply contrains if we are restoring original size */
gdk_window_constrain_size (&impl->geometry_hints,
geometry_mask,
width + impl->margin_left + impl->margin_right,
height + impl->margin_top + impl->margin_bottom,
calculate_width_with_margin (window, width),
calculate_height_with_margin (window, height),
&width,
&height);
@@ -1577,7 +1719,40 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
_gdk_wayland_window_save_size (window);
}
gdk_wayland_window_configure (window, width, height, impl->scale);
if (saved_size)
{
configure_width = calculate_width_with_margin (window, width);
configure_height = calculate_height_with_margin (window, height);
}
else
{
configure_width = width;
configure_height = height;
}
gdk_wayland_window_configure (window,
configure_width,
configure_height,
impl->scale);
}
else
{
int unconfigured_width;
int unconfigured_height;
unconfigured_width =
calculate_width_with_margin (window, impl->unconfigured_width);
unconfigured_height =
calculate_height_with_margin (window, impl->unconfigured_height);
gdk_wayland_window_configure (window,
unconfigured_width,
unconfigured_height,
impl->scale);
}
if (fixed_size)
{
impl->fixed_size_width = width;
impl->fixed_size_height = height;
}
GDK_NOTE (EVENTS,
@@ -1810,6 +1985,36 @@ create_zxdg_toplevel_v6_resources (GdkWindow *window)
window);
}
void
gdk_wayland_window_set_application_id (GdkWindow *window, const char* application_id)
{
GdkWindowImplWayland *impl;
GdkWaylandDisplay *display_wayland;
g_return_if_fail (application_id != NULL);
if (GDK_WINDOW_DESTROYED (window))
return;
if (!is_realized_toplevel (window))
return;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
switch (display_wayland->shell_variant)
{
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
xdg_toplevel_set_app_id (impl->display_server.xdg_toplevel,
application_id);
break;
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
zxdg_toplevel_v6_set_app_id (impl->display_server.zxdg_toplevel_v6,
application_id);
break;
}
}
static void
gdk_wayland_window_create_xdg_toplevel (GdkWindow *window)
{
@@ -1865,17 +2070,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (app_id == NULL)
app_id = gdk_get_program_class ();
switch (display_wayland->shell_variant)
{
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
xdg_toplevel_set_app_id (impl->display_server.xdg_toplevel,
app_id);
break;
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
zxdg_toplevel_v6_set_app_id (impl->display_server.zxdg_toplevel_v6,
app_id);
break;
}
gdk_wayland_window_set_application_id (window, app_id);
maybe_set_gtk_surface_dbus_properties (window);
maybe_set_gtk_surface_modal (window);
@@ -2182,7 +2377,7 @@ get_real_parent_and_translate (GdkWindow *window,
GDK_WINDOW_IMPL_WAYLAND (parent->impl);
GdkWindow *effective_parent = gdk_window_get_effective_parent (parent);
if ((gdk_window_has_native (parent) &&
if (parent == NULL || (gdk_window_has_native (parent) &&
!parent_impl->display_server.wl_subsurface) ||
!effective_parent)
break;
@@ -2209,8 +2404,10 @@ translate_to_real_parent_window_geometry (GdkWindow *window,
parent = get_real_parent_and_translate (window, x, y);
*x -= parent->shadow_left;
*y -= parent->shadow_top;
if (parent != NULL) {
*x -= parent->shadow_left;
*y -= parent->shadow_top;
}
}
static GdkWindow *
@@ -2224,8 +2421,13 @@ translate_from_real_parent_window_geometry (GdkWindow *window,
parent = get_real_parent_and_translate (window, &dx, &dy);
*x -= dx - parent->shadow_left;
*y -= dy - parent->shadow_top;
*x -= dx;
*y -= dy;
if (parent != NULL) {
*x += parent->shadow_left;
*y += parent->shadow_top;
}
return parent;
}
@@ -2405,12 +2607,17 @@ calculate_moved_to_rect_result (GdkWindow *window,
gboolean *flipped_x,
gboolean *flipped_y)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWindowImplWayland *impl;
GdkWindow *parent;
gint window_x, window_y;
gint window_width, window_height;
GdkRectangle best_rect;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
parent = translate_from_real_parent_window_geometry (window, &x, &y);
*final_rect = (GdkRectangle) {
.x = x,
@@ -2825,10 +3032,6 @@ should_map_as_popup (GdkWindow *window)
if (impl->grab_input_seat)
return TRUE;
}
else
g_message ("Window %p is a temporary window without parent, "
"application will not be able to position it on screen.",
window);
}
/* Yet we need to keep the window type hint tests for compatibility */
@@ -2913,6 +3116,16 @@ gdk_wayland_window_map (GdkWindow *window)
if (impl->mapped || impl->use_custom_surface)
return;
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
{
if (!impl->transient_for)
{
g_message ("Window %p is a temporary window without parent, "
"application will not be able to position it on screen.",
window);
}
}
if (should_map_as_subsurface (window))
{
if (impl->transient_for)
@@ -3165,7 +3378,11 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
if (impl->display_server.gtk_surface)
{
gtk_surface1_destroy (impl->display_server.gtk_surface);
if (display_wayland->gtk_shell_version >=
GTK_SURFACE1_RELEASE_SINCE_VERSION)
gtk_surface1_release (impl->display_server.gtk_surface);
else
gtk_surface1_destroy (impl->display_server.gtk_surface);
impl->display_server.gtk_surface = NULL;
impl->application.was_set = FALSE;
}
@@ -3178,6 +3395,7 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
wl_surface_destroy (impl->display_server.wl_surface);
impl->display_server.wl_surface = NULL;
impl->surface_callback = NULL;
g_slist_free (impl->display_server.outputs);
impl->display_server.outputs = NULL;
@@ -3311,17 +3529,37 @@ gdk_window_wayland_move_resize (GdkWindow *window,
}
}
if (window->state & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_MAXIMIZED))
if (window->state & (GDK_WINDOW_STATE_FULLSCREEN |
GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_TILED))
{
impl->saved_width = width;
impl->saved_height = height;
impl->saved_size_changed = (width > 0 && height > 0);
}
/* If this function is called with width and height = -1 then that means
* just move the window - don't update its size
*/
if (width > 0 && height > 0)
gdk_wayland_window_maybe_configure (window, width, height, impl->scale);
{
if (!should_use_fixed_size (window->state) ||
(width == impl->fixed_size_width &&
height == impl->fixed_size_height))
{
gdk_wayland_window_maybe_configure (window,
width,
height,
impl->scale);
}
else if (!should_inhibit_resize (window))
{
gdk_wayland_window_configure (window,
window->width,
window->height,
impl->scale);
}
}
}
/* Avoid zero width/height as this is a protocol error */
@@ -3760,14 +3998,18 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
if (geom_mask & GDK_HINT_MIN_SIZE)
{
min_width = MAX (0, geometry->min_width - (impl->margin_left + impl->margin_right));
min_height = MAX (0, geometry->min_height - (impl->margin_top + impl->margin_bottom));
min_width =
MAX (0, calculate_width_without_margin (window, geometry->min_width));
min_height =
MAX (0, calculate_height_without_margin (window, geometry->min_height));
}
if (geom_mask & GDK_HINT_MAX_SIZE)
{
max_width = MAX (0, geometry->max_width - (impl->margin_left + impl->margin_right));
max_height = MAX (0, geometry->max_height - (impl->margin_top + impl->margin_bottom));
max_width =
MAX (0, calculate_width_without_margin (window, geometry->max_width));
max_height =
MAX (0, calculate_height_without_margin (window, geometry->max_height));
}
switch (display_wayland->shell_variant)
@@ -4446,10 +4688,10 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window,
return;
/* Reconfigure window to keep the same window geometry */
new_width = window->width -
(impl->margin_left + impl->margin_right) + (left + right);
new_height = window->height -
(impl->margin_top + impl->margin_bottom) + (top + bottom);
new_width = (calculate_width_without_margin (window, window->width) +
(left + right));
new_height = (calculate_height_without_margin (window, window->height) +
(top + bottom));
gdk_wayland_window_maybe_configure (window, new_width, new_height, impl->scale);
impl->margin_left = left;
@@ -5181,10 +5423,16 @@ void
gdk_wayland_window_restore_shortcuts (GdkWindow *window,
GdkSeat *gdk_seat)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat);
GdkWindowImplWayland *impl;
struct wl_seat *seat;
struct zwp_keyboard_shortcuts_inhibitor_v1 *inhibitor;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
seat = gdk_wayland_seat_get_wl_seat (gdk_seat);
inhibitor = gdk_wayland_window_get_inhibitor (impl, seat);
if (inhibitor == NULL)
return; /* Not inhibitted */
@@ -5193,3 +5441,71 @@ gdk_wayland_window_restore_shortcuts (GdkWindow *window,
g_hash_table_remove (impl->shortcuts_inhibitors, seat);
}
/**
* gdk_wayland_window_add_frame_callback_surface:
* @window: the #GdkWindow requesting callbacks
* @surface: the wl_surface to add
*
* Add @surface to a list of surfaces for which frame callback
* listeners will get set up, additionally to the one of @window.
*
* This is useful when clients use subsurfaces independently of GDK.
* For example if a client creates a subsurface that covers @window
* entirely. If this subsurface is opaque, Wayland compositors may not
* emit callbacks for the surface of @window any more.
* Adding the covering subsurface via this function ensures the
* @window will continue to update.
*
* A single callback is sufficient to trigger the next update. If more
* than one are triggered, the later ones will get ignored.
*
* Before @surface gets destroyed it must get removed again using
* gdk_wayland_window_remove_frame_callback_surface().
*
* Note that the client is responsible to commit the @surface.
* One way to archive this is to always commit after the
* #GdkSurface::after-paint signal was triggered.
*
* Since: 3.24.25
*/
void
gdk_wayland_window_add_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface)
{
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
g_return_if_fail (surface != NULL);
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
g_hash_table_insert (impl->frame_callback_surfaces, surface, NULL);
}
/**
* gdk_wayland_window_remove_frame_callback_surface:
* @window: the #GdkWindow requesting callbacks
* @surface: the surface to remove
*
* Remove @surface from the list of surfaces again that got added via
* gdk_wayland_window_add_frame_callback_surface().
*
* This function must be called before @surface gets destroyed.
*
* Since: 3.24.25
*/
void
gdk_wayland_window_remove_frame_callback_surface (GdkWindow *window,
struct wl_surface *surface)
{
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
g_return_if_fail (surface != NULL);
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
g_hash_table_remove (impl->frame_callback_surfaces, surface);
}
+1
View File
@@ -56,6 +56,7 @@ proto_sources = [
['keyboard-shortcuts-inhibit', 'unstable', 'v1', ],
['server-decoration', 'private' ],
['xdg-output', 'unstable', 'v1', ],
['primary-selection', 'unstable', 'v1', ],
]
gdk_wayland_gen_headers = []
+5 -2
View File
@@ -1,6 +1,6 @@
<protocol name="gtk">
<interface name="gtk_shell1" version="3">
<interface name="gtk_shell1" version="4">
<description summary="gtk specific extensions">
gtk_shell is a protocol extension providing additional features for
clients implementing it.
@@ -35,7 +35,7 @@
</request>
</interface>
<interface name="gtk_surface1" version="3">
<interface name="gtk_surface1" version="4">
<request name="set_dbus_properties">
<arg name="application_id" type="string" allow-null="true"/>
<arg name="app_menu_path" type="string" allow-null="true"/>
@@ -82,6 +82,9 @@
<request name="request_focus" since="3">
<arg name="startup_id" type="string" allow-null="true"/>
</request>
<!-- Version 4 additions -->
<request name="release" type="destructor" since="4"/>
</interface>
</protocol>
+3 -3
View File
@@ -107,10 +107,10 @@ gdk3_win32_HEADERS_INST = $(libgdkwin32include_HEADERS)
gdk3_win32_HEADERS_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
include $(top_srcdir)/win32/Makefile.msvcproj
dist-hook: \
$(top_builddir)/build/win32/vs9/gdk3-win32.vcproj \
$(top_builddir)/build/win32/vs9/gdk3-win32.headers
$(top_builddir)/win32/vs9/gdk3-win32.vcproj \
$(top_builddir)/win32/vs9/gdk3-win32.headers
-include $(top_srcdir)/git.mk
+41 -27
View File
@@ -37,6 +37,10 @@
#include "gdkwin32langnotification.h"
#ifndef IMAGE_FILE_MACHINE_ARM64
# define IMAGE_FILE_MACHINE_ARM64 0xAA64
#endif
static int debug_indent = 0;
static GdkMonitor *
@@ -523,8 +527,6 @@ gdk_win32_display_supports_selection_notification (GdkDisplay *display)
return TRUE;
}
static HWND _hwnd_next_viewer = NULL;
/*
* maybe this should be integrated with the default message loop - or maybe not ;-)
*/
@@ -538,24 +540,11 @@ inner_clipboard_window_procedure (HWND hwnd,
{
case WM_DESTROY: /* remove us from chain */
{
ChangeClipboardChain (hwnd, _hwnd_next_viewer);
RemoveClipboardFormatListener (hwnd);
PostQuitMessage (0);
return 0;
}
case WM_CHANGECBCHAIN:
{
HWND hwndRemove = (HWND) wparam; /* handle of window being removed */
HWND hwndNext = (HWND) lparam; /* handle of next window in chain */
if (hwndRemove == _hwnd_next_viewer)
_hwnd_next_viewer = hwndNext == hwnd ? NULL : hwndNext;
else if (_hwnd_next_viewer != NULL)
return SendMessage (_hwnd_next_viewer, message, wparam, lparam);
return 0;
}
case WM_CLIPBOARDUPDATE:
case WM_DRAWCLIPBOARD:
{
HWND hwnd_owner;
HWND stored_hwnd_owner;
@@ -632,9 +621,6 @@ inner_clipboard_window_procedure (HWND hwnd,
event->owner_change.selection_time = GDK_CURRENT_TIME;
_gdk_win32_append_event (event);
if (_hwnd_next_viewer != NULL)
return SendMessage (_hwnd_next_viewer, message, wparam, lparam);
/* clear error to avoid confusing SetClipboardViewer() return */
SetLastError (0);
return 0;
@@ -694,16 +680,10 @@ register_clipboard_notification (GdkDisplay *display)
goto failed;
SetLastError (0);
_hwnd_next_viewer = SetClipboardViewer (display_win32->clipboard_hwnd);
if (_hwnd_next_viewer == NULL && GetLastError() != 0)
if (AddClipboardFormatListener (display_win32->clipboard_hwnd) == FALSE)
goto failed;
/* FIXME: http://msdn.microsoft.com/en-us/library/ms649033(v=VS.85).aspx */
/* This is only supported by Vista, and not yet by mingw64 */
/* if (AddClipboardFormatListener (hwnd) == FALSE) */
/* goto failed; */
return TRUE;
failed:
@@ -850,7 +830,6 @@ gdk_win32_display_dispose (GObject *object)
{
DestroyWindow (display_win32->clipboard_hwnd);
display_win32->clipboard_hwnd = NULL;
_hwnd_next_viewer = NULL;
}
if (display_win32->have_at_least_win81)
@@ -1059,6 +1038,40 @@ _gdk_win32_enable_hidpi (GdkWin32Display *display)
}
}
static void
_gdk_win32_check_on_arm64 (GdkWin32Display *display)
{
static gsize checked = 0;
if (g_once_init_enter (&checked))
{
HMODULE kernel32 = LoadLibraryW (L"kernel32.dll");
if (kernel32 != NULL)
{
display->cpu_funcs.isWow64Process2 =
(funcIsWow64Process2) GetProcAddress (kernel32, "IsWow64Process2");
if (display->cpu_funcs.isWow64Process2 != NULL)
{
USHORT proc_cpu = 0;
USHORT native_cpu = 0;
display->cpu_funcs.isWow64Process2 (GetCurrentProcess (),
&proc_cpu,
&native_cpu);
if (native_cpu == IMAGE_FILE_MACHINE_ARM64)
display->running_on_arm64 = TRUE;
}
FreeLibrary (kernel32);
}
g_once_init_leave (&checked, 1);
}
}
static void
gdk_win32_display_init (GdkWin32Display *display)
{
@@ -1067,6 +1080,7 @@ gdk_win32_display_init (GdkWin32Display *display)
display->monitors = g_ptr_array_new_with_free_func (g_object_unref);
_gdk_win32_enable_hidpi (display);
_gdk_win32_check_on_arm64 (display);
/* if we have DPI awareness, set up fixed scale if set */
if (display->dpi_aware_type != PROCESS_DPI_UNAWARE &&
+14
View File
@@ -60,6 +60,13 @@ typedef struct _GdkWin32User32DPIFuncs
funcIsProcessDPIAware isDpiAwareFunc;
} GdkWin32User32DPIFuncs;
/* Detect running architecture */
typedef BOOL (WINAPI *funcIsWow64Process2) (HANDLE, USHORT *, USHORT *);
typedef struct _GdkWin32KernelCPUFuncs
{
funcIsWow64Process2 isWow64Process2;
} GdkWin32KernelCPUFuncs;
struct _GdkWin32Display
{
GdkDisplay display;
@@ -95,6 +102,9 @@ struct _GdkWin32Display
guint hasWglARBPixelFormat : 1;
guint hasWglARBmultisample : 1;
/* compensate around Intel OpenGL driver issues on blitting, see issue #3487 */
guint needIntelGLWorkaround : 1;
#ifdef GDK_WIN32_ENABLE_EGL
guint hasEglKHRCreateContext : 1;
guint hasEglSurfacelessContext : 1;
@@ -109,6 +119,10 @@ struct _GdkWin32Display
GdkWin32ShcoreFuncs shcore_funcs;
GdkWin32User32DPIFuncs user32_dpi_funcs;
/* Running CPU items */
guint running_on_arm64 : 1;
GdkWin32KernelCPUFuncs cpu_funcs;
};
struct _GdkWin32DisplayClass
+39 -268
View File
@@ -1863,202 +1863,6 @@ generate_button_event (GdkEventType type,
_gdk_win32_append_event (event);
}
/*
* Used by the stacking functions to see if a window
* should be always on top.
* Restacking is only done if both windows are either ontop
* or not ontop.
*/
static gboolean
should_window_be_always_on_top (GdkWindow *window)
{
DWORD exstyle;
if ((GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) ||
(window->state & GDK_WINDOW_STATE_ABOVE))
return TRUE;
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
if (exstyle & WS_EX_TOPMOST)
return TRUE;
return FALSE;
}
static void
ensure_stacking_on_unminimize (MSG *msg)
{
HWND rover;
HWND lowest_transient = NULL;
GdkWindow *msg_window;
gboolean window_ontop = FALSE;
msg_window = gdk_win32_handle_table_lookup (msg->hwnd);
if (msg_window)
window_ontop = should_window_be_always_on_top (msg_window);
for (rover = GetNextWindow (msg->hwnd, GW_HWNDNEXT);
rover;
rover = GetNextWindow (rover, GW_HWNDNEXT))
{
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
GdkWindowImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
if (rover_gdkw == NULL)
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
lowest_transient = rover;
}
}
if (lowest_transient != NULL)
{
GDK_NOTE (EVENTS,
g_print (" restacking %p above %p",
msg->hwnd, lowest_transient));
SetWindowPos (msg->hwnd, lowest_transient, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
}
}
static gboolean
ensure_stacking_on_window_pos_changing (MSG *msg,
GdkWindow *window)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
WINDOWPOS *windowpos = (WINDOWPOS *) msg->lParam;
HWND rover;
gboolean restacking;
gboolean window_ontop;
if (GetActiveWindow () != msg->hwnd ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
impl->transient_owner != NULL)
return FALSE;
/* Make sure the window stays behind any transient-type windows
* of the same window group.
*
* If the window is not active and being activated, we let
* Windows bring it to the top and rely on the WM_ACTIVATEAPP
* handling to bring any utility windows on top of it.
*/
window_ontop = should_window_be_always_on_top (window);
for (rover = windowpos->hwndInsertAfter, restacking = FALSE;
rover;
rover = GetNextWindow (rover, GW_HWNDNEXT))
{
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
GdkWindowImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
if (rover_gdkw == NULL)
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
restacking = TRUE;
windowpos->hwndInsertAfter = rover;
}
}
if (restacking)
{
GDK_NOTE (EVENTS,
g_print (" letting Windows restack %p above %p",
msg->hwnd, windowpos->hwndInsertAfter));
return TRUE;
}
return FALSE;
}
static void
ensure_stacking_on_activate_app (MSG *msg,
GdkWindow *window)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
HWND rover;
gboolean window_ontop;
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
impl->transient_owner != NULL)
{
SetWindowPos (msg->hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
return;
}
if (!IsWindowVisible (msg->hwnd) ||
msg->hwnd != GetActiveWindow ())
return;
/* This window is not a transient-type window and it is the
* activated window. Make sure this window is as visible as
* possible, just below the lowest transient-type window of this
* app.
*/
window_ontop = should_window_be_always_on_top (window);
for (rover = GetNextWindow (msg->hwnd, GW_HWNDPREV);
rover;
rover = GetNextWindow (rover, GW_HWNDPREV))
{
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
GdkWindowImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
if (rover_gdkw == NULL)
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
GDK_NOTE (EVENTS,
g_print (" restacking %p above %p",
msg->hwnd, rover));
SetWindowPos (msg->hwnd, rover, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
break;
}
}
}
static gboolean
handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
{
@@ -2556,31 +2360,6 @@ gdk_event_translate (MSG *msg,
API_CALL (GetKeyboardState, (key_state));
ccount = 0;
if (msg->wParam == VK_PACKET)
{
ccount = ToUnicode (VK_PACKET, HIWORD (msg->lParam), key_state, wbuf, 1, 0);
if (ccount == 1)
{
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
{
if (msg->message == WM_KEYDOWN)
impl->leading_surrogate_keydown = wbuf[0];
else
impl->leading_surrogate_keyup = wbuf[0];
/* don't emit an event */
return_val = TRUE;
break;
}
else
{
/* wait until an event is created */;
}
}
}
event = gdk_event_new ((msg->message == WM_KEYDOWN ||
msg->message == WM_SYSKEYDOWN) ?
GDK_KEY_PRESS : GDK_KEY_RELEASE);
@@ -2595,6 +2374,39 @@ gdk_event_translate (MSG *msg,
gdk_event_set_device (event, device_manager_win32->core_keyboard);
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager_win32->core_keyboard));
/* Get the WinAPI translation of the WM_KEY messages to characters.
The WM_CHAR messages are generated by a previous call to TranslateMessage() and always
follow directly after the corresponding WM_KEY* messages.
There could be 0 or more WM_CHAR messages following (for example dead keys don't generate
WM_CHAR messages - they generate WM_DEAD_CHAR instead, but we are not interested in those
messages). */
if (gdk_event_is_allocated (event)) /* Should always be true */
{
GdkEventPrivate *event_priv = (GdkEventPrivate*) event;
MSG msg2;
while (PeekMessageW (&msg2, msg->hwnd, 0, 0, 0) && (msg2.message == WM_CHAR || msg2.message == WM_SYSCHAR))
{
/* The character is encoded in WPARAM as UTF-16. */
gunichar2 c = msg2.wParam;
/* Ignore control sequences like Backspace */
if (!g_unichar_iscntrl(c))
{
/* Append character to translation string. */
event_priv->translation_len ++;
event_priv->translation = g_realloc (event_priv->translation, event_priv->translation_len * sizeof (event_priv->translation[0]));
event_priv->translation[event_priv->translation_len - 1] = c;
}
/* Remove message from queue */
GetMessageW (&msg2, msg->hwnd, 0, 0);
}
}
if (HIWORD (msg->lParam) & KF_EXTENDED)
{
switch (msg->wParam)
@@ -2623,42 +2435,12 @@ gdk_event_translate (MSG *msg,
build_key_event_state (event, key_state);
if (msg->wParam == VK_PACKET && ccount == 1)
{
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
{
g_assert_not_reached ();
}
else if (wbuf[0] >= 0xDC00 && wbuf[0] < 0xE000)
{
wchar_t leading;
if (msg->message == WM_KEYDOWN)
leading = impl->leading_surrogate_keydown;
else
leading = impl->leading_surrogate_keyup;
event->key.keyval = gdk_unicode_to_keyval ((leading - 0xD800) * 0x400 + wbuf[0] - 0xDC00 + 0x10000);
}
else
{
event->key.keyval = gdk_unicode_to_keyval (wbuf[0]);
}
}
else
{
gdk_keymap_translate_keyboard_state (_gdk_win32_display_get_keymap (display),
event->key.hardware_keycode,
event->key.state,
event->key.group,
&event->key.keyval,
NULL, NULL, NULL);
}
if (msg->message == WM_KEYDOWN)
impl->leading_surrogate_keydown = 0;
else
impl->leading_surrogate_keyup = 0;
gdk_keymap_translate_keyboard_state (_gdk_win32_display_get_keymap (display),
event->key.hardware_keycode,
event->key.state,
event->key.group,
&event->key.keyval,
NULL, NULL, NULL);
fill_key_event_string (event);
@@ -3389,8 +3171,6 @@ gdk_event_translate (MSG *msg,
if (GDK_WINDOW_IS_MAPPED (window))
{
return_val = ensure_stacking_on_window_pos_changing (msg, window);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->maximizing)
@@ -3480,13 +3260,6 @@ gdk_event_translate (MSG *msg,
if ((old_state & GDK_WINDOW_STATE_ICONIFIED) !=
(new_state & GDK_WINDOW_STATE_ICONIFIED))
do_show_window (window, (new_state & GDK_WINDOW_STATE_ICONIFIED));
/* When un-minimizing, make sure we're stacked under any
transient-type windows. */
if (!(old_state & GDK_WINDOW_STATE_ICONIFIED) &&
(new_state & GDK_WINDOW_STATE_ICONIFIED))
ensure_stacking_on_unminimize (msg);
}
/* Show, New size or position => configure event */
@@ -3968,8 +3741,6 @@ gdk_event_translate (MSG *msg,
GDK_NOTE (EVENTS, g_print (" %s thread: %" G_GINT64_FORMAT,
msg->wParam ? "YES" : "NO",
(gint64) msg->lParam));
if (msg->wParam && GDK_WINDOW_IS_MAPPED (window))
ensure_stacking_on_activate_app (msg, window);
break;
case WM_NCHITTEST:
/* TODO: pass all messages to DwmDefWindowProc() first! */
+30 -11
View File
@@ -123,21 +123,34 @@ gdk_win32_gl_context_init (GdkWin32GLContext *self)
}
static void
gdk_gl_blit_region (GdkWindow *window, cairo_region_t *region)
gdk_gl_blit_region (GdkWindow *window,
cairo_region_t *region,
gboolean use_intel_workaround)
{
int n_rects, i;
int n_rects, i, j;
int scale = gdk_window_get_scale_factor (window);
int wh = gdk_window_get_height (window);
cairo_rectangle_int_t rect;
int retries = 0;
if (use_intel_workaround)
retries = 1;
n_rects = cairo_region_num_rectangles (region);
for (i = 0; i < n_rects; i++)
for (i = 0; i <= retries; i ++)
{
cairo_region_get_rectangle (region, i, &rect);
glScissor (rect.x * scale, (wh - rect.y - rect.height) * scale, rect.width * scale, rect.height * scale);
glBlitFramebuffer (rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
for (j = 0; j < n_rects; j++)
{
cairo_region_get_rectangle (region, j, &rect);
glScissor (rect.x * scale, (wh - rect.y - rect.height) * scale, rect.width * scale, rect.height * scale);
glBlitFramebuffer (rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
if (retries > 0 && i < retries)
glFlush ();
}
}
@@ -206,7 +219,7 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
{
glDrawBuffer(GL_FRONT);
glReadBuffer(GL_BACK);
gdk_gl_blit_region (window, painted);
gdk_gl_blit_region (window, painted, display->needIntelGLWorkaround);
glDrawBuffer(GL_BACK);
glFlush();
@@ -224,7 +237,7 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
gboolean force_egl_redraw_all = _get_is_egl_force_redraw (window);
if (context_win32->do_blit_swap && !force_egl_redraw_all)
gdk_gl_blit_region (window, painted);
gdk_gl_blit_region (window, painted, FALSE);
else if (force_egl_redraw_all)
{
GdkRectangle rect = {0, 0, gdk_window_get_width (window), gdk_window_get_height (window)};
@@ -577,7 +590,9 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
#ifdef GDK_WIN32_ENABLE_EGL
EGLDisplay egl_disp;
disable_wgl = (_gdk_gl_flags & GDK_GL_GLES) != 0;
disable_wgl = ((_gdk_gl_flags & GDK_GL_GLES) != 0) ||
display_win32->running_on_arm64;
#endif
if (display_win32->have_wgl
@@ -614,10 +629,13 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_pixel_format");
display_win32->hasWglARBmultisample =
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_multisample");
display_win32->needIntelGLWorkaround =
(g_ascii_strcasecmp (glGetString (GL_VENDOR), "intel") == 0);
GDK_NOTE (OPENGL,
g_print ("WGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Intel OpenGL workaround: %s\n"
" - Checked extensions:\n"
"\t* WGL_ARB_pixel_format: %s\n"
"\t* WGL_ARB_create_context: %s\n"
@@ -627,6 +645,7 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
display_win32->gl_version / 10,
display_win32->gl_version % 10,
glGetString (GL_VENDOR),
display_win32->needIntelGLWorkaround ? "yes" : "no",
display_win32->hasWglARBPixelFormat ? "yes" : "no",
display_win32->hasWglARBCreateContext ? "yes" : "no",
display_win32->hasWglEXTSwapControl ? "yes" : "no",
+82 -4
View File
@@ -559,6 +559,7 @@ enum_monitor (HMONITOR hmonitor,
DEVMODEW dm;
DWORD i_monitor;
DWORD frequency;
GdkWin32MonitorRotation orientation;
memset (&dd, 0, sizeof (dd));
dd.cb = sizeof (dd);
@@ -577,12 +578,36 @@ enum_monitor (HMONITOR hmonitor,
continue;
dm.dmSize = sizeof (dm);
dm.dmDriverExtra = 0;
frequency = 0;
orientation = GDK_WIN32_MONITOR_ROTATION_UNKNOWN;
/* Grab refresh rate for this adapter while we're at it */
if (EnumDisplaySettingsW (dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm))
frequency = dm.dmDisplayFrequency;
else
frequency = 0;
if (EnumDisplaySettingsExW (dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm, 0))
{
if ((dm.dmFields & DM_DISPLAYORIENTATION) == DM_DISPLAYORIENTATION)
{
switch (dm.dmDisplayOrientation)
{
default:
case DMDO_DEFAULT:
orientation = GDK_WIN32_MONITOR_ROTATION_0;
break;
case DMDO_90:
orientation = GDK_WIN32_MONITOR_ROTATION_90;
break;
case DMDO_180:
orientation = GDK_WIN32_MONITOR_ROTATION_180;
break;
case DMDO_270:
orientation = GDK_WIN32_MONITOR_ROTATION_270;
break;
}
}
if ((dm.dmFields & DM_DISPLAYFREQUENCY) == DM_DISPLAYFREQUENCY)
frequency = dm.dmDisplayFrequency;
}
/* Enumerate monitors connected to this display adapter */
for (i_monitor = 0; TRUE; i_monitor++)
@@ -744,6 +769,7 @@ enum_monitor (HMONITOR hmonitor,
* keep remove == TRUE and be removed further up the stack.
*/
w32mon->remove = FALSE;
w32mon->orientation = orientation;
/* One virtual monitor per display adapter */
if (w32mon->madeup)
@@ -770,6 +796,58 @@ prune_monitors (EnumMonitorData *data)
}
}
const gchar *
_gdk_win32_monitor_get_pixel_structure (GdkMonitor *monitor)
{
GdkWin32Monitor *w32_m;
BOOL enabled = TRUE;
unsigned int smoothing_orientation = FE_FONTSMOOTHINGORIENTATIONRGB;
UINT cleartype = FE_FONTSMOOTHINGCLEARTYPE;
g_return_val_if_fail (monitor != NULL, NULL);
w32_m = GDK_WIN32_MONITOR (monitor);
SystemParametersInfoW (SPI_GETFONTSMOOTHING, 0, &enabled, 0);
SystemParametersInfoW (SPI_GETFONTSMOOTHINGTYPE, 0, &cleartype, 0);
if (!enabled ||
(cleartype == FE_FONTSMOOTHINGSTANDARD) ||
!SystemParametersInfoW (SPI_GETFONTSMOOTHINGORIENTATION, 0, &smoothing_orientation, 0))
return "none";
if (smoothing_orientation == FE_FONTSMOOTHINGORIENTATIONBGR)
switch (w32_m->orientation)
{
default:
case GDK_WIN32_MONITOR_ROTATION_UNKNOWN:
return "none";
case GDK_WIN32_MONITOR_ROTATION_0:
return "bgr";
case GDK_WIN32_MONITOR_ROTATION_90:
return "vbgr";
case GDK_WIN32_MONITOR_ROTATION_180:
return "rgb";
case GDK_WIN32_MONITOR_ROTATION_270:
return "vrgb";
}
else
switch (w32_m->orientation)
{
default:
case GDK_WIN32_MONITOR_ROTATION_UNKNOWN:
return "none";
case GDK_WIN32_MONITOR_ROTATION_0:
return "rgb";
case GDK_WIN32_MONITOR_ROTATION_90:
return "vrgb";
case GDK_WIN32_MONITOR_ROTATION_180:
return "bgr";
case GDK_WIN32_MONITOR_ROTATION_270:
return "vbgr";
}
}
GPtrArray *
_gdk_win32_display_get_monitor_list (GdkWin32Display *win32_display)
{
+37
View File
@@ -26,6 +26,36 @@
#include "gdkwin32monitor.h"
/*
* The number is the degrees the display is rotated clockwise
* from its natural position.
* I.e. most displays will have 0. A normal display
* that is rotated by 90 degrees will
* have 90. The same display rotated counter-clockwise
* will have 270. The same display
* rotated by 180 degrees (i.e. upside-down)
* will have 180.
* Accordingly, 0 mode
* fontsmoothing is used as-is - i.e. it is assumed that
* subpixel structure is horizontal (ClearType does not support
* vertical subpixels; if the display has naturally vertical
* subpixel structure, ClearType should be disabled altogether).
* In 90 subpixel structure has
* its verticality flipped (rgb -> vrgb; bgr -> vbgr).
* In 180 subpixel structure is
* horizontally flipped (rgb -> bgr; bgr -> rgb).
* In 270 subpixel structure is
* flipped both horizontally and vertically
* (rgb -> vbgr; bgr -> vrgb).
*/
typedef enum _GdkWin32MonitorRotation {
GDK_WIN32_MONITOR_ROTATION_UNKNOWN = 0,
GDK_WIN32_MONITOR_ROTATION_0 = 1,
GDK_WIN32_MONITOR_ROTATION_90 = 2,
GDK_WIN32_MONITOR_ROTATION_180 = 3,
GDK_WIN32_MONITOR_ROTATION_270 = 4,
} GdkWin32MonitorRotation;
struct _GdkWin32Monitor
{
GdkMonitor parent;
@@ -36,6 +66,11 @@ struct _GdkWin32Monitor
/* Device instance path (used to match GdkWin32Monitor to monitor device) */
gchar *instance_path;
/* Indicates display rotation and its normal proportions.
* Used to determine pixel structure for subpixel smoothing.
*/
GdkWin32MonitorRotation orientation;
/* TRUE if monitor is made up by us
* (this happens when system has logical monitors, but no physical ones).
*/
@@ -54,4 +89,6 @@ struct _GdkWin32MonitorClass {
int _gdk_win32_monitor_compare (GdkWin32Monitor *a, GdkWin32Monitor *b);
const gchar *_gdk_win32_monitor_get_pixel_structure (GdkMonitor *monitor);
#endif
+1 -1
View File
@@ -298,7 +298,7 @@ extern UINT _gdk_input_codepage;
extern guint _gdk_keymap_serial;
/* The singleton selection object pointer */
GdkWin32Selection *_win32_selection;
extern GdkWin32Selection *_win32_selection;
void _gdk_win32_dnd_do_dragdrop (void);
void _gdk_win32_ole2_dnd_property_change (GdkAtom type,
+11 -14
View File
@@ -33,6 +33,7 @@
#include "gdkproperty.h"
#include "gdkselection.h"
#include "gdkprivate-win32.h"
#include "gdkmonitor-win32.h"
#include "gdkwin32.h"
GdkAtom
@@ -368,8 +369,11 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
}
else if (strcmp ("gtk-xft-antialias", name) == 0)
{
GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : 1\n", name));
g_value_set_int (value, 1);
BOOL val = TRUE;
SystemParametersInfoW (SPI_GETFONTSMOOTHING, 0, &val, 0);
g_value_set_int (value, val ? 1 : 0);
GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : %u\n", name, val));
return TRUE;
}
else if (strcmp ("gtk-xft-hintstyle", name) == 0)
@@ -380,18 +384,11 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
}
else if (strcmp ("gtk-xft-rgba", name) == 0)
{
unsigned int orientation = 0;
if (SystemParametersInfoW (SPI_GETFONTSMOOTHINGORIENTATION, 0, &orientation, 0))
{
if (orientation == FE_FONTSMOOTHINGORIENTATIONRGB)
g_value_set_static_string (value, "rgb");
else if (orientation == FE_FONTSMOOTHINGORIENTATIONBGR)
g_value_set_static_string (value, "bgr");
else
g_value_set_static_string (value, "none");
}
else
g_value_set_static_string (value, "none");
const gchar *rgb_value;
GdkMonitor *monitor;
monitor = gdk_display_get_monitor (gdk_display_get_default (), 0);
rgb_value = _gdk_win32_monitor_get_pixel_structure (monitor);
g_value_set_static_string (value, rgb_value);
GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : %s\n", name, g_value_get_string (value)));
return TRUE;
+9 -8
View File
@@ -1474,7 +1474,7 @@ show_window_internal (GdkWindow *window,
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
(window->state & GDK_WINDOW_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
}
@@ -1834,7 +1834,7 @@ gdk_win32_window_raise (GdkWindow *window)
else
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
}
}
@@ -1851,7 +1851,7 @@ gdk_win32_window_lower (GdkWindow *window)
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_BOTTOM,
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
}
}
@@ -2910,7 +2910,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
rect.right += after.right - before.right;
rect.bottom += after.bottom - before.bottom;
flags = SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOREPOSITION | SWP_NOOWNERZORDER;
flags = SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOREPOSITION;
if (will_be_topmost && !was_topmost)
{
@@ -5372,7 +5372,7 @@ gdk_win32_window_fullscreen (GdkWindow *window)
y - workaround_padding,
width + (workaround_padding * 2),
height + (workaround_padding * 2),
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
}
}
@@ -5392,10 +5392,11 @@ gdk_win32_window_unfullscreen (GdkWindow *window)
impl->hint_flags = fi->hint_flags;
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, fi->style);
_gdk_win32_window_invalidate_egl_framebuffer (window);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST,
fi->r.left, fi->r.top,
fi->r.right - fi->r.left, fi->r.bottom - fi->r.top,
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
g_object_set_data (G_OBJECT (window), "fullscreen-info", NULL);
g_free (fi);
@@ -5421,7 +5422,7 @@ gdk_win32_window_set_keep_above (GdkWindow *window,
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
setting ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
gdk_synthesize_window_state (window,
@@ -5447,7 +5448,7 @@ gdk_win32_window_set_keep_below (GdkWindow *window,
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
setting ? HWND_BOTTOM : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
gdk_synthesize_window_state (window,
-8
View File
@@ -240,14 +240,6 @@ struct _GdkWindowImplWin32
HICON hicon_big;
HICON hicon_small;
/* When VK_PACKET sends us a leading surrogate, it's stashed here.
* Later, when another VK_PACKET sends a tailing surrogate, we make up
* a full unicode character from them, or discard the leading surrogate,
* if the next key is not a tailing surrogate.
*/
wchar_t leading_surrogate_keydown;
wchar_t leading_surrogate_keyup;
/* Window size hints */
gint hint_flags;
GdkGeometry hints;
+5 -5
View File
@@ -643,14 +643,14 @@ remove_device (GdkX11DeviceManagerXI2 *device_manager,
if (device)
{
detach_from_seat (device);
device_manager->devices = g_list_remove (device_manager->devices, device);
g_signal_emit_by_name (device_manager, "device-removed", device);
g_object_run_dispose (G_OBJECT (device));
g_hash_table_remove (device_manager->id_table,
GINT_TO_POINTER (device_id));
device_manager->devices = g_list_remove (device_manager->devices, device);
g_signal_emit_by_name (device_manager, "device-removed", device);
g_object_run_dispose (G_OBJECT (device));
g_object_unref (device);
}
}
+5 -1
View File
@@ -149,7 +149,7 @@ gdk_x11_window_invalidate_for_new_frame (GdkWindow *window,
invalidate_all = FALSE;
if (buffer_age == 0 || buffer_age >= 4)
if (buffer_age >= 4)
{
cairo_rectangle_int_t whole_window = { 0, 0, gdk_window_get_width (window), gdk_window_get_height (window) };
@@ -163,6 +163,10 @@ gdk_x11_window_invalidate_for_new_frame (GdkWindow *window,
}
else
{
if (buffer_age == 0)
{
invalidate_all = TRUE;
}
if (buffer_age >= 2)
{
if (window->old_updated_area[0])
+18 -10
View File
@@ -66,19 +66,27 @@ gdk_x11_monitor_get_workarea (GdkMonitor *monitor,
gdk_monitor_get_geometry (monitor, dest);
/* The EWMH constrains workarea to be a rectangle, so it
* can't adequately deal with L-shaped monitor arrangements.
* As a workaround, we ignore the workarea for anything
* but the primary monitor. Since that is where the 'desktop
* chrome' usually lives, this works ok in practice.
*/
if (gdk_monitor_is_primary (monitor) &&
!gdk_monitor_has_fullscreen_window (monitor))
if (_gdk_x11_screen_get_monitor_work_area (screen, monitor, &workarea))
{
gdk_x11_screen_get_work_area (screen, &workarea);
if (gdk_rectangle_intersect (dest, &workarea, &workarea))
if (!gdk_monitor_has_fullscreen_window (monitor))
*dest = workarea;
}
else
{
/* The EWMH constrains workarea to be a rectangle, so it
* can't adequately deal with L-shaped monitor arrangements.
* As a workaround, we ignore the workarea for anything
* but the primary monitor. Since that is where the 'desktop
* chrome' usually lives, this works ok in practice.
*/
if (gdk_monitor_is_primary (monitor) &&
!gdk_monitor_has_fullscreen_window (monitor))
{
gdk_x11_screen_get_work_area (screen, &workarea);
if (gdk_rectangle_intersect (dest, &workarea, &workarea))
*dest = workarea;
}
}
}
static void
+104
View File
@@ -234,6 +234,106 @@ get_current_desktop (GdkScreen *screen)
return workspace;
}
gboolean
_gdk_x11_screen_get_monitor_work_area (GdkScreen *screen,
GdkMonitor *monitor,
GdkRectangle *area)
{
GdkX11Screen *x11_screen;
GdkAtom net_workareas;
GdkDisplay *display;
Display *xdisplay;
int current_desktop;
char *workareas_dn_name;
Atom workareas_dn;
int screen_number;
Window xroot;
int result;
Atom type;
int format;
gulong num;
gulong leftovers;
guchar *ret_workarea;
long *workareas;
GdkRectangle geometry;
int i;
x11_screen = GDK_X11_SCREEN (screen);
net_workareas = gdk_atom_intern_static_string ("_GTK_WORKAREAS");
if (!gdk_x11_screen_supports_net_wm_hint (screen, net_workareas))
return FALSE;
display = gdk_screen_get_display (screen);
xdisplay = gdk_x11_display_get_xdisplay (display);
current_desktop = get_current_desktop (screen);
workareas_dn_name = g_strdup_printf ("_GTK_WORKAREAS_D%d", current_desktop);
workareas_dn = XInternAtom (xdisplay, workareas_dn_name, True);
g_free (workareas_dn_name);
if (workareas_dn == None)
return FALSE;
screen_number = gdk_x11_screen_get_screen_number (screen);
xroot = XRootWindow (xdisplay, screen_number);
gdk_x11_display_error_trap_push (display);
ret_workarea = NULL;
result = XGetWindowProperty (xdisplay,
xroot,
workareas_dn,
0,
G_MAXLONG,
False,
AnyPropertyType,
&type,
&format,
&num,
&leftovers,
&ret_workarea);
gdk_x11_display_error_trap_pop_ignored (display);
if (result != Success ||
type == None ||
format == 0 ||
leftovers ||
num % 4 != 0)
{
XFree (ret_workarea);
return FALSE;
}
workareas = (long *) ret_workarea;
gdk_monitor_get_geometry (monitor, &geometry);
*area = geometry;
for (i = 0; i < num / 4; i++)
{
GdkRectangle work_area;
work_area = (GdkRectangle) {
.x = workareas[0] / x11_screen->window_scale,
.y = workareas[1] / x11_screen->window_scale,
.width = workareas[2] / x11_screen->window_scale,
.height = workareas[3] / x11_screen->window_scale,
};
if (gdk_rectangle_intersect (area, &work_area, &work_area))
*area = work_area;
workareas += 4;
}
XFree (ret_workarea);
return TRUE;
}
void
gdk_x11_screen_get_work_area (GdkScreen *screen,
GdkRectangle *area)
@@ -1007,6 +1107,10 @@ _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
root = x11_screen->root_window;
GDK_WINDOW_IMPL_X11 (root->impl)->window_scale = scale;
if (GDK_WINDOW_IMPL_X11 (root->impl)->cairo_surface)
cairo_surface_set_device_scale (GDK_WINDOW_IMPL_X11 (root->impl)->cairo_surface,
scale, scale);
toplevels = gdk_screen_get_toplevel_windows (GDK_SCREEN (x11_screen));
for (l = toplevels; l != NULL; l = l->next)
+3
View File
@@ -119,6 +119,9 @@ void _gdk_x11_screen_get_edge_monitors (GdkScreen *screen,
gint *right);
void _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen,
int scale);
gboolean _gdk_x11_screen_get_monitor_work_area (GdkScreen *screen,
GdkMonitor *monitor,
GdkRectangle *area);
void gdk_x11_screen_get_work_area (GdkScreen *screen,
GdkRectangle *area);
gint gdk_x11_screen_get_width (GdkScreen *screen);
+20 -3
View File
@@ -3025,12 +3025,29 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (pattern == parent_relative_pattern)
{
GdkWindow *parent;
Window xroot, xparent, *xchildren;
guint nxchildren, xparent_depth;
XWindowAttributes xattrs;
if (!XQueryTree (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
&xroot, &xparent, &xchildren, &nxchildren))
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
return;
}
if (xchildren)
XFree (xchildren);
if (xparent) {
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window), xparent, &xattrs);
xparent_depth = xattrs.depth;
}
/* X throws BadMatch if the parent has a different depth when
* using ParentRelative */
parent = gdk_window_get_parent (window);
if (parent != NULL && window->depth == parent->depth &&
if (xparent && window->depth == xparent_depth &&
cairo_pattern_status (pattern) == CAIRO_STATUS_SUCCESS)
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
+277
View File
@@ -0,0 +1,277 @@
# Actual GTK things
{
GtkWidgetClass action GPtrArray
Memcheck:Leak
fun:malloc
fun:g_malloc
fun:g_slice_alloc
fun:g_ptr_array_sized_new
fun:g_ptr_array_new
fun:gtk_widget_class_add_action
}
{
GTK media extension gio modules
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:g_malloc
fun:g_slice_alloc
fun:g_slice_alloc0
fun:g_type_create_instance
fun:g_object_new_internal
fun:g_object_new_with_properties
fun:g_object_new
fun:g_io_module_new
fun:g_io_modules_scan_all_in_directory_with_scope
fun:gtk_media_file_extension_init
}
{
gtk-style-context
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:g_malloc
...
fun:gtk_css_node_declaration_make_writable
...
fun:gtk_style_constructed
}
{
gtk-style-context2
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:g_malloc
...
fun:gtk_css_node_declaration_make_writable_resize
...
fun:gtk_style_constructed
}
# AMD driver
{
radeonsi_dri general
Memcheck:Leak
fun:calloc
...
obj:/usr/lib*/dri/radeonsi_dri.so
}
# mesa driver stuff
{
i965 addr4
Memcheck:Addr4
obj:/usr/lib*/dri/i965_dri.so*
}
{
i965 addr8
Memcheck:Addr8
obj:/usr/lib*/dri/i965_dri.so*
}
{
i965 memcpy
Memcheck:Addr8
fun:memcpy*
obj:/usr/lib*/dri/i965_dri.so*
}
{
i965 memcpy
Memcheck:Addr2
fun:memcpy*
obj:/usr/lib*/dri/i965_dri.so*
}
{
mesa memcmp 8
Memcheck:Addr8
fun:*memcmp*
obj:/usr/lib*/dri/i965_dri.so*
}
{
mesa memcmp 1
Memcheck:Addr1
fun:*memcmp*
obj:/usr/lib*/dri/i965_dri.so*
}
{
mesa memset 8
Memcheck:Addr8
fun:*memset*
obj:/usr/lib*/dri/i965_dri.so
}
{
mesa realpath
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:realpath@@GLIBC_2.3
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
fun:epoxy_eglInitialize_global_rewrite_ptr
}
{
mesa calloc
Memcheck:Leak
match-leak-kinds: definite
fun:calloc
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
fun:epoxy_eglInitialize_global_rewrite_ptr
}
{
mesa malloc
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
obj:/usr/lib*/dri/i965_dri.so*
}
{
mesa glReadPixels
Memcheck:Addr16
obj:*
obj:*
obj:*
obj:*
obj:*
fun:epoxy_glReadPixels_global_rewrite_ptr
}
{
epoxy glxQueryServerString 1
Memcheck:Leak
fun:malloc
fun:XextAddDisplay
obj:*
obj:*
obj:*
obj:*
obj:*
fun:epoxy_glXQueryServerString_global_rewrite_ptr
}
{
epoxy glxQueryServerString 2
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:realpath*
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
obj:*
fun:epoxy_glXQueryServerString_global_rewrite_ptr
}
{
epoxy glGetTexImage
Memcheck:Addr16
obj:*
obj:*
obj:*
obj:*
obj:*
fun:epoxy_glGetTexImage_global_rewrite_ptr
}
# Fontconfig
{
FcFontSetList
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
obj:/usr/lib*/libfontconfig.so*
obj:/usr/lib*/libfontconfig.so*
fun:FcFontSetList
}
{
FcFontRenderPrepare
Memcheck:Leak
match-leak-kinds: definite
fun:realloc
obj:/usr/lib*/libfontconfig.so*
obj:/usr/lib*/libfontconfig.so*
fun:FcFontRenderPrepare
}
{
FcDefaultSubstitute
Memcheck:Leak
match-leak-kinds: definite
fun:realloc
obj:/usr/lib*/libfontconfig.so*
obj:/usr/lib*/libfontconfig.so*
fun:FcDefaultSubstitute
}
# Pixman
{
pixman_image_composite32
Memcheck:Cond
obj:/usr/lib*/libpixman-1.so*
obj:/usr/lib*/libpixman-1.so*
fun:pixman_image_composite32
}
# Pango
{
pango 1
Memcheck:Leak
match-leak-kinds: definite
fun:realloc
obj:/usr/lib*/libfontconfig.so*
obj:/usr/lib*/libfontconfig.so*
obj:/usr/lib*/libcairo.so*
fun:pango_cairo_fc_font_map_fontset_key_substitute
}
{
pango 2
Memcheck:Leak
fun:realloc
obj:/usr/lib*/libfontconfig.so*
obj:/usr/lib*/libfontconfig.so*
fun:_cairo_ft_font_options_substitute
}
# GLib
{
glib 1
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:g_malloc
fun:g_quark_init
}
+36 -34
View File
@@ -510,7 +510,6 @@ gtk_private_h_sources = \
gtkiconviewprivate.h \
gtkimagedefinitionprivate.h \
gtkimageprivate.h \
gtkimcontextsimpleprivate.h \
gtkimmoduleprivate.h \
gtkimcontextsimpleseqs.h \
gtkintl.h \
@@ -583,6 +582,7 @@ gtk_private_h_sources = \
gtktextmarkprivate.h \
gtktextsegment.h \
gtktexttagprivate.h \
gtktexttagtableprivate.h \
gtktexttypes.h \
gtktextutil.h \
gtktrashmonitor.h \
@@ -1029,6 +1029,13 @@ gtk_private_h_sources += \
gtkprinteroptionwidget.h \
gtksearchenginetracker.h
if HAVE_TRACKER3
gtk_private_h_sources += \
gtksearchenginetracker3.h
gtk_os_unix_c_sources += \
gtksearchenginetracker3.c
endif
gtk_c_sources += $(gtk_os_unix_c_sources)
endif
@@ -1370,9 +1377,7 @@ adwaita_theme_scss = \
$()
highcontrast_theme_scss = \
theme/HighContrast/_colors.scss \
theme/HighContrast/_common.scss \
theme/HighContrast/_drawing.scss \
theme/HighContrast/_colors-hc.scss \
theme/HighContrast/gtk-contained-inverse.scss \
theme/HighContrast/gtk-contained.scss \
$()
@@ -1422,10 +1427,10 @@ resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --gener
gtkresources.h: gtk.gresource.xml
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register --internal
gtkresources.c: gtk.gresource.xml $(resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register --internal
gtkprivatetypebuiltins.h: stamp-gtkprivatetypebuiltins.h
@true
@@ -1521,7 +1526,7 @@ gtk_3_HEADERS_INST = \
gtk_3_HEADERS_EXCLUDES = dummy
include $(top_srcdir)/build/Makefile.msvcproj
include $(top_srcdir)/win32/Makefile.msvcproj
if HAVE_INTROSPECTION
# Introspection Items for MSVC
@@ -1547,11 +1552,11 @@ GTK_MSVC_GIR_CFLAGS = \
-DINCLUDE_IM_ti_et \
-DINCLUDE_IM_viqr \
-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API \
-I../.. -I../../gtk -I../../gdk
-I.. -I../gtk -I../gdk
INTROSPECTION_INTERMEDIATE_ITEMS = \
$(top_builddir)/build/win32/Gtk-3.0.gir.msvc.introspect \
$(top_builddir)/build/win32/Gtk_3_0_gir_list
$(top_builddir)/win32/Gtk-3.0.gir.msvc.introspect \
$(top_builddir)/win32/Gtk_3_0_gir_list
Gtk_3_0_gir_MSVC_FILES = \
$(introspected_pub_headers) \
@@ -1566,7 +1571,7 @@ Gtk_3_0_gir_MSVC_LIBS = gtk-3.0 gdk-3.0
Gtk_3_0_gir_MSVC_CFLAGS = $(GTK_MSVC_GIR_CFLAGS)
Gtk_3_0_gir_MSVC_SCANNERFLAGS = --warn-all --include-uninstalled='./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin/Gdk-3.0.gir'
include $(top_srcdir)/build/Makefile.msvc-introspection
include $(top_srcdir)/win32/Makefile.msvc-introspection
else
INTROSPECTION_INTERMEDIATE_ITEMS =
@@ -1574,8 +1579,8 @@ INTROSPECTION_INTERMEDIATE_ITEMS =
endif
dist-hook: \
$(top_builddir)/build/win32/vs9/gtk-3.vcproj \
$(top_builddir)/build/win32/vs9/gtk-3.headers \
$(top_builddir)/win32/vs9/gtk-3.vcproj \
$(top_builddir)/win32/vs9/gtk-3.headers \
$(INTROSPECTION_INTERMEDIATE_ITEMS)
# Install a RC file for the default GTK+ theme, and key themes
@@ -1704,27 +1709,10 @@ GTK_UPDATE_ICON_CACHE_MANIFEST = gtk-update-icon-cache.exe.manifest
GTK_UPDATE_ICON_CACHE_RC = gtk-update-icon-cache.rc
GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT = gtk-update-icon-cache_manifest.o
$(GTK_UPDATE_ICON_CACHE_MANIFEST):
(echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' ; \
echo '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">' ; \
echo ' <assemblyIdentity version="1.0.0.0"' ; \
echo ' processorArchitecture="'$(EXE_MANIFEST_ARCHITECTURE)'"' ; \
echo ' name="gtk-update-icon-cache.exe"' ; \
echo ' type="win32"/>' ; \
echo ' <!-- Identify the application security requirements. -->' ; \
echo ' <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">' ; \
echo ' <security>' ; \
echo ' <requestedPrivileges>' ; \
echo ' <requestedExecutionLevel' ; \
echo ' level="asInvoker"' ; \
echo ' uiAccess="false"/>' ; \
echo ' </requestedPrivileges>' ; \
echo ' </security>' ; \
echo ' </trustInfo>' ; \
echo '</assembly>' ) >$@
$(GTK_UPDATE_ICON_CACHE_MANIFEST): Makefile generate-uac-manifest.py
$(PYTHON) $(srcdir)/generate-uac-manifest.py -p=gtk3 -n=gtk-update-icon-cache --pkg-version=$(GTK_VERSION) --output-dir=$(builddir)
$(GTK_UPDATE_ICON_CACHE_RC):
(echo -e '#include <winuser.h>\nCREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST '$(GTK_UPDATE_ICON_CACHE_MANIFEST)) >$@
$(GTK_UPDATE_ICON_CACHE_RC): $(GTK_UPDATE_ICON_CACHE_MANIFEST)
$(GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT): $(GTK_UPDATE_ICON_CACHE_RC) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
$(WINDRES) --input $< --output $@ --output-format=coff
@@ -1753,10 +1741,15 @@ EXTRA_DIST += \
$(gesture_sources) \
$(theme_sources) \
$(gsettings_SCHEMAS) \
compose-parse.py \
emoji/convert-emoji.c \
emoji/emoji.json \
emoji/emoji1.json \
a11y/Makefile.inc \
deprecated/Makefile.inc \
glade/README.glade \
glade/gtk-private-widgets.xml \
gtk-compose-lookaside.txt \
inspector/Makefile.inc \
libgtk3.manifest.in \
gtk-win32.rc.body.in \
@@ -1766,6 +1759,8 @@ EXTRA_DIST += \
gtkwin32embedwidget.c \
gtkprint-win32.h \
gtkprint-win32.c \
gtksearchenginetracker3.c \
gtksearchenginetracker3.h \
gtksearchenginequartz.h \
gtkdbusinterfaces.xml \
gtk-keys.css.default \
@@ -1780,12 +1775,19 @@ EXTRA_DIST += \
meson.build \
gen-gtk-gresources-xml.py \
gen-rc.py \
generate-uac-manifest.py \
gentypefuncs.py \
a11y/meson.build \
deprecated/meson.build \
inspector/meson.build \
theme/Adwaita/meson.build \
theme/HighContrast/meson.build
theme/Adwaita/parse-sass.sh \
theme/Adwaita/render-assets.sh \
theme/HighContrast/assets.svg \
theme/HighContrast/assets.txt \
theme/HighContrast/meson.build \
theme/HighContrast/parse-sass.sh \
theme/HighContrast/render-assets.sh
-include $(top_srcdir)/git.mk
+4
View File
@@ -31,6 +31,7 @@ a11y_h_sources = \
a11y/gtknotebookaccessible.h \
a11y/gtknotebookpageaccessible.h \
a11y/gtkpanedaccessible.h \
a11y/gtkplugaccessible.h \
a11y/gtkpopoveraccessible.h \
a11y/gtkprogressbaraccessible.h \
a11y/gtkradiobuttonaccessible.h \
@@ -40,6 +41,7 @@ a11y_h_sources = \
a11y/gtkscaleaccessible.h \
a11y/gtkscalebuttonaccessible.h \
a11y/gtkscrolledwindowaccessible.h \
a11y/gtksocketaccessible.h \
a11y/gtkspinbuttonaccessible.h \
a11y/gtkspinneraccessible.h \
a11y/gtkstatusbaraccessible.h \
@@ -106,6 +108,7 @@ a11y_c_sources = \
a11y/gtknotebookaccessible.c \
a11y/gtknotebookpageaccessible.c \
a11y/gtkpanedaccessible.c \
a11y/gtkplugaccessible.c \
a11y/gtkpopoveraccessible.c \
a11y/gtkprogressbaraccessible.c \
a11y/gtkradiobuttonaccessible.c \
@@ -115,6 +118,7 @@ a11y_c_sources = \
a11y/gtkscaleaccessible.c \
a11y/gtkscalebuttonaccessible.c \
a11y/gtkscrolledwindowaccessible.c \
a11y/gtksocketaccessible.c \
a11y/gtkspinbuttonaccessible.c \
a11y/gtkspinneraccessible.c \
a11y/gtkstatusbaraccessible.c \
+4 -12
View File
@@ -311,18 +311,10 @@ gtk_notebook_page_accessible_get_extents (AtkComponent *component,
label = get_label_from_notebook_page (GTK_NOTEBOOK_PAGE_ACCESSIBLE (component));
if (!label)
{
AtkObject *child;
*width = 0;
*height = 0;
child = atk_object_ref_accessible_child (ATK_OBJECT (component), 0);
if (!child)
return;
atk_component_get_extents (ATK_COMPONENT (child), x, y, NULL, NULL,
coord_type);
g_object_unref (child);
*x = -1;
*y = -1;
*width = -1;
*height = -1;
}
else
{

Some files were not shown because too many files have changed in this diff Show More