Compare commits

..

536 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
Thomas Holder e278f38905 macOS: fix #2436 raise transient window on focus 2020-04-02 17:57:18 +02: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
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
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
Руслан Ижбулатов 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
341 changed files with 82597 additions and 65612 deletions
+7 -7
View File
@@ -64,30 +64,30 @@ reference:
- gdk3-docs.tar.xz
- gtk3-docs.tar.xz
msys2-mingw32-meson:
msys2-mingw64-meson:
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-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"
+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"
+3 -1
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 \
@@ -84,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 \
+310
View File
@@ -1,3 +1,313 @@
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
===================================
+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 */
+40 -17
View File
@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [24])
m4_define([gtk_micro_version], [17])
m4_define([gtk_interface_age], [13])
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.14.91])
m4_define([wayland_protocols_required_version], [1.14])
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
+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 \
+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));
+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;
+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
+1
View File
@@ -646,6 +646,7 @@ 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,
+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 -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
+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__ */
+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. */
+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);
+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)));
+39 -6
View File
@@ -743,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 ();
}
@@ -824,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;
@@ -856,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:
@@ -885,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;
}
@@ -904,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
@@ -959,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
@@ -1510,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 ();
}
+3 -1
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)
+166 -38
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,
@@ -2460,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);
@@ -2495,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,
@@ -2521,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);
@@ -2816,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 =
@@ -3626,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;
@@ -3677,6 +3742,9 @@ tablet_tool_handle_proximity_out (void *data,
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
#endif
if (!tablet)
return;
GDK_NOTE (EVENTS,
g_message ("proximity out, seat %p, tool %d", seat,
gdk_device_tool_get_tool_type (tool->tool)));
@@ -3733,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);
@@ -3750,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);
@@ -3769,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);
@@ -3801,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]);
@@ -3818,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]);
@@ -3836,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),
@@ -3864,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;
@@ -3895,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),
@@ -3914,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]);
@@ -3932,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));
@@ -3942,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);
@@ -3967,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));
@@ -4590,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)
{
@@ -4599,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)
@@ -5070,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 =
@@ -5347,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;
@@ -5358,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);
}
+3 -1
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>
@@ -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,
+49 -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
+131 -34
View File
@@ -104,7 +104,7 @@ struct _GdkWaylandSelection
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;
@@ -434,6 +434,18 @@ gdk_wayland_selection_new (void)
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)
{
@@ -448,7 +460,7 @@ gdk_wayland_selection_free (GdkWaylandSelection *selection)
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)
@@ -546,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 *
@@ -604,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;
@@ -614,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);
}
}
}
@@ -1138,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;
@@ -1163,8 +1208,26 @@ primary_source_send (void *data,
}
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;
@@ -1180,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 *
@@ -1204,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;
}
}
@@ -1234,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);
}
}
@@ -1278,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;
}
}
@@ -1449,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;
@@ -1514,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__ */
+292 -57
View File
@@ -202,6 +202,7 @@ struct _GdkWindowImplWayland
int saved_width;
int saved_height;
gboolean saved_size_changed;
int unconfigured_width;
int unconfigured_height;
@@ -235,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
@@ -273,6 +277,7 @@ 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);
@@ -312,6 +317,42 @@ 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)
{
@@ -322,8 +363,8 @@ _gdk_wayland_window_save_size (GdkWindow *window)
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
@@ -534,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))
@@ -545,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);
@@ -622,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;
@@ -629,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
@@ -639,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.
@@ -713,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)
{
@@ -1027,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);
}
@@ -1040,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;
@@ -1081,18 +1167,27 @@ is_realized_popup (GdkWindow *window)
}
static gboolean
needs_initial_configure (GdkWindow *window)
should_inhibit_resize (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (impl->display_server.wl_subsurface)
return FALSE;
else if (is_realized_toplevel (window))
return TRUE;
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 TRUE;
else
return !should_map_as_subsurface (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
@@ -1105,19 +1200,17 @@ 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)
return;
if (needs_initial_configure (window) &&
!impl->initial_configure_received)
{
impl->unconfigured_width = width;
impl->unconfigured_height = height;
return;
}
/* For xdg_popup using an xdg_positioner, there is a race condition if
* the application tries to change the size after it's mapped, but before
* the initial configure is received, so hide and show the surface again
@@ -1282,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)
};
}
@@ -1299,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);
@@ -1588,11 +1684,16 @@ 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)
@@ -1609,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);
@@ -1620,8 +1721,8 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
if (saved_size)
{
configure_width = width + impl->margin_left + impl->margin_right;
configure_height = height + impl->margin_top + impl->margin_bottom;
configure_width = calculate_width_with_margin (window, width);
configure_height = calculate_height_with_margin (window, height);
}
else
{
@@ -1635,9 +1736,16 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
}
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,
impl->unconfigured_width,
impl->unconfigured_height,
unconfigured_width,
unconfigured_height,
impl->scale);
}
@@ -1877,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)
{
@@ -1932,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);
@@ -2479,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,
@@ -2899,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 */
@@ -2987,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)
@@ -3239,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;
}
@@ -3252,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;
@@ -3391,6 +3535,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
{
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
@@ -3401,7 +3546,19 @@ gdk_window_wayland_move_resize (GdkWindow *window,
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);
{
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);
}
}
}
@@ -3841,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)
@@ -4527,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;
@@ -5262,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 */
@@ -5274,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
+39
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 *
@@ -1034,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)
{
@@ -1042,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 -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])
+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),
+34 -31
View File
@@ -510,7 +510,6 @@ gtk_private_h_sources = \
gtkiconviewprivate.h \
gtkimagedefinitionprivate.h \
gtkimageprivate.h \
gtkimcontextsimpleprivate.h \
gtkimmoduleprivate.h \
gtkimcontextsimpleseqs.h \
gtkintl.h \
@@ -1030,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
@@ -1421,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
@@ -1520,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
@@ -1546,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) \
@@ -1565,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 =
@@ -1573,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
@@ -1703,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
@@ -1752,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 \
@@ -1765,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 \
@@ -1779,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
{
+81
View File
@@ -0,0 +1,81 @@
/* GTK+ - accessibility implementations
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gtkplugaccessible.h"
#ifdef GTK_HAVE_ATK_PLUG_SET_CHILD
/* We can not make GtkPlugAccessible inherit both from GtkContainerAccessible
* and GtkPlug, so we make it the atk child of an AtkPlug */
struct _GtkPlugAccessiblePrivate
{
AtkObject *accessible_plug;
};
G_DEFINE_TYPE_WITH_CODE (GtkPlugAccessible, gtk_plug_accessible, GTK_TYPE_WINDOW_ACCESSIBLE,
G_ADD_PRIVATE (GtkPlugAccessible))
static void
gtk_plug_accessible_finalize (GObject *object)
{
GtkPlugAccessible *plug = GTK_PLUG_ACCESSIBLE (object);
GtkPlugAccessiblePrivate *priv = plug->priv;
g_clear_object (&priv->accessible_plug);
G_OBJECT_CLASS (gtk_plug_accessible_parent_class)->finalize (object);
}
static void
gtk_plug_accessible_initialize (AtkObject *plug, gpointer data)
{
AtkObject *atk_plug;
ATK_OBJECT_CLASS (gtk_plug_accessible_parent_class)->initialize (plug, data);
atk_plug = atk_plug_new ();
atk_plug_set_child (ATK_PLUG (atk_plug), plug);
GTK_PLUG_ACCESSIBLE (plug)->priv->accessible_plug = atk_plug;
}
static void
gtk_plug_accessible_class_init (GtkPlugAccessibleClass *klass) {
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
atk_class->initialize = gtk_plug_accessible_initialize;
gobject_class->finalize = gtk_plug_accessible_finalize;
}
static void
gtk_plug_accessible_init (GtkPlugAccessible *plug)
{
plug->priv = gtk_plug_accessible_get_instance_private (plug);
}
gchar *
gtk_plug_accessible_get_id (GtkPlugAccessible *plug)
{
return atk_plug_get_id (ATK_PLUG (plug->priv->accessible_plug));
}
#endif /* GTK_HAVE_ATK_PLUG_SET_CHILD */
+66
View File
@@ -0,0 +1,66 @@
/* GTK+ - accessibility implementations
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_PLUG_ACCESSIBLE_H__
#define __GTK_PLUG_ACCESSIBLE_H__
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk-a11y.h> can be included directly."
#endif
#include <gtk/a11y/gtkwindowaccessible.h>
#if ATK_CHECK_VERSION(2,35,1)
#define GTK_HAVE_ATK_PLUG_SET_CHILD
G_BEGIN_DECLS
#define GTK_TYPE_PLUG_ACCESSIBLE (gtk_plug_accessible_get_type ())
#define GTK_PLUG_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessible))
#define GTK_PLUG_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
#define GTK_IS_PLUG_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PLUG_ACCESSIBLE))
#define GTK_IS_PLUG_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLUG_ACCESSIBLE))
#define GTK_PLUG_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
typedef struct _GtkPlugAccessible GtkPlugAccessible;
typedef struct _GtkPlugAccessibleClass GtkPlugAccessibleClass;
typedef struct _GtkPlugAccessiblePrivate GtkPlugAccessiblePrivate;
struct _GtkPlugAccessible
{
GtkWindowAccessible parent;
GtkPlugAccessiblePrivate *priv;
};
struct _GtkPlugAccessibleClass
{
GtkWindowAccessibleClass parent_class;
};
GDK_AVAILABLE_IN_ALL
GType gtk_plug_accessible_get_type (void);
GDK_AVAILABLE_IN_ALL
gchar *gtk_plug_accessible_get_id (GtkPlugAccessible *plug);
G_END_DECLS
#endif /* ATK_CHECK_VERSION(2,35,1) */
#endif /* __GTK_PLUG_ACCESSIBLE_H__ */
+102
View File
@@ -0,0 +1,102 @@
/* GTK+ - accessibility implementations
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gtksocketaccessible.h"
/* We can not make GtkSocketAccessible inherit both from GtkContainerAccessible
* and GtkSocket, so we make it the atk parent of an AtkSocket */
struct _GtkSocketAccessiblePrivate
{
AtkObject *accessible_socket;
};
G_DEFINE_TYPE_WITH_CODE (GtkSocketAccessible, gtk_socket_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
G_ADD_PRIVATE (GtkSocketAccessible))
static AtkObject*
gtk_socket_accessible_ref_child (AtkObject *obj, int i)
{
GtkSocketAccessible *socket = GTK_SOCKET_ACCESSIBLE (obj);
if (i != 0)
return NULL;
return g_object_ref (socket->priv->accessible_socket);
}
static int
gtk_socket_accessible_get_n_children (AtkObject *obj)
{
return 1;
}
static void
gtk_socket_accessible_finalize (GObject *object)
{
GtkSocketAccessible *socket = GTK_SOCKET_ACCESSIBLE (object);
GtkSocketAccessiblePrivate *priv = socket->priv;
g_clear_object (&priv->accessible_socket);
G_OBJECT_CLASS (gtk_socket_accessible_parent_class)->finalize (object);
}
static void
gtk_socket_accessible_initialize (AtkObject *socket, gpointer data)
{
AtkObject *atk_socket;
ATK_OBJECT_CLASS (gtk_socket_accessible_parent_class)->initialize (socket, data);
atk_socket = atk_socket_new ();
GTK_SOCKET_ACCESSIBLE(socket)->priv->accessible_socket = atk_socket;
atk_object_set_parent (atk_socket, socket);
}
static void
gtk_socket_accessible_class_init (GtkSocketAccessibleClass *klass)
{
GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
container_class->add_gtk = NULL;
container_class->remove_gtk = NULL;
atk_class->initialize = gtk_socket_accessible_initialize;
atk_class->get_n_children = gtk_socket_accessible_get_n_children;
atk_class->ref_child = gtk_socket_accessible_ref_child;
gobject_class->finalize = gtk_socket_accessible_finalize;
}
static void
gtk_socket_accessible_init (GtkSocketAccessible *socket)
{
socket->priv = gtk_socket_accessible_get_instance_private (socket);
}
void
gtk_socket_accessible_embed (GtkSocketAccessible *socket, gchar *path)
{
atk_socket_embed (ATK_SOCKET (socket->priv->accessible_socket), path);
}
+60
View File
@@ -0,0 +1,60 @@
/* GTK+ - accessibility implementations
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_SOCKET_ACCESSIBLE_H__
#define __GTK_SOCKET_ACCESSIBLE_H__
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk-a11y.h> can be included directly."
#endif
#include <gtk/a11y/gtkcontaineraccessible.h>
G_BEGIN_DECLS
#define GTK_TYPE_SOCKET_ACCESSIBLE (gtk_socket_accessible_get_type ())
#define GTK_SOCKET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SOCKET_ACCESSIBLE, GtkSocketAccessible))
#define GTK_SOCKET_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOCKET_ACCESSIBLE, GtkSocketAccessibleClass))
#define GTK_IS_SOCKET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SOCKET_ACCESSIBLE))
#define GTK_IS_SOCKET_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOCKET_ACCESSIBLE))
#define GTK_SOCKET_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SOCKET_ACCESSIBLE, GtkSocketAccessibleClass))
typedef struct _GtkSocketAccessible GtkSocketAccessible;
typedef struct _GtkSocketAccessibleClass GtkSocketAccessibleClass;
typedef struct _GtkSocketAccessiblePrivate GtkSocketAccessiblePrivate;
struct _GtkSocketAccessible
{
GtkContainerAccessible parent;
GtkSocketAccessiblePrivate *priv;
};
struct _GtkSocketAccessibleClass
{
GtkContainerAccessibleClass parent_class;
};
GDK_AVAILABLE_IN_ALL
GType gtk_socket_accessible_get_type (void);
GDK_AVAILABLE_IN_ALL
void gtk_socket_accessible_embed (GtkSocketAccessible *socket, gchar *path);
G_END_DECLS
#endif /* __GTK_SOCKET_ACCESSIBLE_H__ */
+94
View File
@@ -1309,6 +1309,99 @@ gtk_text_view_accessible_set_selection (AtkText *text,
return FALSE;
}
static gboolean
gtk_text_view_accessible_scroll_substring_to(AtkText *text,
gint start_offset,
gint end_offset,
AtkScrollType type)
{
GtkTextView *view;
GtkWidget *widget;
GtkTextBuffer *buffer;
GtkTextIter iter;
gdouble xalign = -1.0, yalign = -1.0;
gboolean use_align = TRUE;
gint offset, rtl = 0;
if (end_offset < start_offset)
return FALSE;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
if (widget == NULL)
return FALSE;
view = GTK_TEXT_VIEW (widget);
buffer = gtk_text_view_get_buffer (view);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
rtl = 1;
/*
* Opportunistically pick which offset should be used to calculate
* the scrolling factor.
*
* Considering only an extremity of the substring is good enough when
* the selected string doesn't include line break and isn't larger than
* the visible rectangle.
*/
switch (type)
{
case ATK_SCROLL_TOP_LEFT:
offset = (rtl) ? end_offset : start_offset;
xalign = 0.0;
yalign = 0.0;
break;
case ATK_SCROLL_BOTTOM_RIGHT:
offset = (rtl) ? start_offset : end_offset;
xalign = 1.0;
yalign = 1.0;
break;
case ATK_SCROLL_TOP_EDGE:
offset = start_offset;
yalign = 0.0;
break;
case ATK_SCROLL_BOTTOM_EDGE:
offset = end_offset;
yalign = 1.0;
break;
case ATK_SCROLL_LEFT_EDGE:
offset = (rtl) ? end_offset : start_offset;
xalign = 0.0;
break;
case ATK_SCROLL_RIGHT_EDGE:
offset = (rtl) ? start_offset : end_offset;
xalign = 1.0;
break;
case ATK_SCROLL_ANYWHERE:
offset = start_offset;
use_align = FALSE;
xalign = yalign = 0.0;
break;
default:
return FALSE;
}
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
/* Get current iter location to be able to scroll in a single direction. */
if (use_align && (xalign == -1.0 || yalign == -1.0))
{
GdkRectangle rect, irect;
gtk_text_view_get_visible_rect (view, &rect);
gtk_text_view_get_iter_location (view, &iter, &irect);
if (xalign == -1.0)
xalign = ((gdouble) (irect.x - rect.x)) / (rect.width - 1);
if (yalign == -1.0)
yalign = ((gdouble) (irect.y - rect.y)) / (rect.height - 1);
}
gtk_text_view_scroll_to_iter (view, &iter, 0, use_align, xalign, yalign);
return TRUE;
}
static void
atk_text_interface_init (AtkTextIface *iface)
{
@@ -1329,6 +1422,7 @@ atk_text_interface_init (AtkTextIface *iface)
iface->set_selection = gtk_text_view_accessible_set_selection;
iface->get_run_attributes = gtk_text_view_accessible_get_run_attributes;
iface->get_default_attributes = gtk_text_view_accessible_get_default_attributes;
iface->scroll_substring_to = gtk_text_view_accessible_scroll_substring_to;
}
/* atkeditabletext.h */
+4
View File
@@ -34,6 +34,7 @@ a11y_sources = files(
'gtknotebookaccessible.c',
'gtknotebookpageaccessible.c',
'gtkpanedaccessible.c',
'gtkplugaccessible.c',
'gtkpopoveraccessible.c',
'gtkprogressbaraccessible.c',
'gtkradiobuttonaccessible.c',
@@ -43,6 +44,7 @@ a11y_sources = files(
'gtkscaleaccessible.c',
'gtkscalebuttonaccessible.c',
'gtkscrolledwindowaccessible.c',
'gtksocketaccessible.c',
'gtkspinbuttonaccessible.c',
'gtkspinneraccessible.c',
'gtkstatusbaraccessible.c',
@@ -90,6 +92,7 @@ a11y_headers = files(
'gtknotebookaccessible.h',
'gtknotebookpageaccessible.h',
'gtkpanedaccessible.h',
'gtkplugaccessible.h',
'gtkpopoveraccessible.h',
'gtkprogressbaraccessible.h',
'gtkradiobuttonaccessible.h',
@@ -99,6 +102,7 @@ a11y_headers = files(
'gtkscaleaccessible.h',
'gtkscalebuttonaccessible.h',
'gtkscrolledwindowaccessible.h',
'gtksocketaccessible.h',
'gtkspinbuttonaccessible.h',
'gtkspinneraccessible.h',
'gtkstatusbaraccessible.h',
-41
View File
@@ -55,35 +55,6 @@ parse_code (GVariantBuilder *b,
return TRUE;
}
static const char *blacklist[] = {
"child",
"adult",
"older adult",
"woman with headscarf",
"bearded person",
"breast-feeding",
"mage",
"fairy",
"vampire",
"merperson",
"merman",
"mermaid",
" elf", // avoid matching selfie
"genie",
"zombie",
"in steamy room",
"climbing",
"in lotus position",
"person in bed",
"man in suit levitating",
"horse racing",
"snowboarder",
"golfing",
"love-you gesture",
"palms up together",
NULL
};
int
main (int argc, char *argv[])
{
@@ -171,18 +142,6 @@ main (int argc, char *argv[])
name = json_object_get_string_member (obj, "name");
code = g_strdup (json_object_get_string_member (obj, "code"));
if (strcmp (name, "world map") == 0)
continue;
skip = FALSE;
for (j = 0; blacklist[j]; j++)
{
if (strstr (name, blacklist[j]) != 0)
skip = TRUE;
}
if (skip)
continue;
has_variations = FALSE;
while (i < length)
{
Binary file not shown.
+20
View File
@@ -114,3 +114,23 @@ trunc (double x)
return (x > 0 ? floor (x) : ceil (x));
}
#endif
#ifndef HAVE_DECL_ISNAN
/* it seems of the supported compilers only
* MSVC does not have isnan(), but it does
* have _isnan() which does the same as isnan()
*/
static inline gboolean
isnan (double x)
{
return _isnan (x);
}
#endif
#ifndef HAVE_FMIN
static inline double
fmin (double x, double y)
{
return x < y ? x : y;
}
#endif
+110
View File
@@ -0,0 +1,110 @@
#!/usr/bin/env python3
"""
This script generates a Windows manifest file and optionally a resource file to
determine whether a specified program requires UAC elevation
"""
import os
import argparse
DOMAIN_NAME='gnome'
def main():
parser = argparse.ArgumentParser(
description=__doc__)
parser.add_argument('-p', '--package', required=True,
help='package name of the executable')
parser.add_argument('-n', '--name', required=True,
help='name of executable')
parser.add_argument('--pkg-version', required=True, dest='version',
help='version of package')
parser.add_argument('--require-admin', action='store_true', dest='admin',
default=False,
help='require admin access to application')
parser.add_argument('--input-resource-file', dest='resource',
default=None,
help='existing .rc file to embed UAC manifest (do not generate a new .rc file), must have included winuser.h in it')
parser.add_argument('--output-dir', dest='outdir',
default=None,
help='directory to output resulting files')
args = parser.parse_args()
if args.resource is not None:
if not os.path.isfile(args.resource):
raise FileNotFoundError("Specified resource file '%s' does not exist" % args.resource)
generate_manifest(args.package, args.name, args.version, args.admin, args.outdir)
write_rc_file(args.name, args.resource, args.outdir)
def generate_manifest(package, name, version, admin, outdir):
if version.count('.') == 0:
manifest_package_version = version + '.0.0.0'
elif version.count('.') == 1:
manifest_package_version = version + '.0.0'
elif version.count('.') == 2:
manifest_package_version = version + '.0'
elif version.count('.') == 3:
manifest_package_version = version
else:
parts = version.split('.')
manifest_package_version = ''
for x in (0, 1, 2, 3):
if x == 0:
manifest_package_version += parts[x]
else:
manifest_package_version += '.' + parts[x]
if outdir is not None:
output_file_base_name = os.path.join(outdir, name)
else:
output_file_base_name = name
outfile = open(output_file_base_name + '.exe.manifest', 'w+')
outfile.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n')
outfile.write('<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">\n')
outfile.write(' <assemblyIdentity version="%s"\n' % manifest_package_version)
outfile.write(' processorArchitecture="*"\n')
outfile.write(' name="%s.%s.%s.exe"\n' % (DOMAIN_NAME, package, name))
outfile.write(' type="win32" />\n')
outfile.write(' <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">\n')
outfile.write(' <security>\n')
outfile.write(' <requestedPrivileges>\n')
outfile.write(' <requestedExecutionLevel\n')
if admin:
outfile.write(' level="requireAdministrator"\n')
else:
outfile.write(' level="asInvoker"\n')
outfile.write(' uiAccess="false" />\n')
outfile.write(' </requestedPrivileges>\n')
outfile.write(' </security>\n')
outfile.write(' </trustInfo>\n')
outfile.write('</assembly>\n')
outfile.close()
def write_rc_file(name, resource, outdir):
if outdir is not None:
output_file_base_name = os.path.join(outdir, name)
else:
output_file_base_name = name
if resource is None:
outfile = open(output_file_base_name + '.rc', 'w+')
outfile.write('#include <winuser.h>')
else:
if resource != output_file_base_name + '.rc':
outfile = open(output_file_base_name + '.rc', 'w+')
else:
outfile = open(output_file_base_name + '.final.rc', 'w+')
srcfile = open(resource, 'r')
outfile.write(srcfile.read())
srcfile.close()
outfile.write('\n')
outfile.write('CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "%s.exe.manifest"' % name)
outfile.close()
if __name__ == '__main__':
main()
+11 -11
View File
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
@@ -14,8 +12,8 @@
viewBox="0 0 64 64.000001"
id="svg6535"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="pinch.svg">
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="gesture-pinch-symbolic.svg">
<defs
id="defs6537" />
<sodipodi:namedview
@@ -26,8 +24,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="-28.712216"
inkscape:cy="21.555733"
inkscape:cx="52.173983"
inkscape:cy="33.196155"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
@@ -37,10 +35,10 @@
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="2560"
inkscape:window-width="5120"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
@@ -48,7 +46,8 @@
inkscape:snap-nodes="true"
inkscape:snap-bbox="false"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true">
inkscape:bbox-nodes="true"
inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid4193" />
@@ -72,9 +71,10 @@
transform="translate(180,-470.14793)">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="M 40 8 C 37.784003 8 36 9.8667876 36 12.185547 L 36 36 L 35 36 L 35 29.185547 C 35 29.022886 34.97217 28.868661 34.955078 28.710938 A 4.0004 4.0004 0 0 0 32.398438 24.994141 L 27.960938 23.253906 C 27.578317 18.647747 23.701182 15 19 15 C 14.04721 15 10 19.0472 10 24 C 10 25.418791 10.341256 26.758764 10.931641 27.955078 C 6.0103696 27.99252 2 32.021431 2 36.951172 C 2 41.903972 6.04721 45.951172 11 45.951172 C 11.65701 45.951172 12.296258 45.87534 12.914062 45.740234 L 22 57 L 31 57 L 33.097656 57 L 58 57 C 60.215997 57 62 55.133212 62 52.814453 L 62 40.185547 L 62 31.185547 C 62 28.866788 60.215997 27 58 27 C 55.784003 27 54 28.866788 54 31.185547 L 54 36 L 53 36 L 53 25.185547 C 53 22.866788 51.215997 21 49 21 C 46.784003 21 45 22.866788 45 25.185547 L 45 36 L 44 36 L 44 12.185547 C 44 9.8667876 42.215997 8 40 8 z M 19 18 C 21.608824 18 23.804048 19.639507 24.636719 21.949219 L 20.414062 20.291016 A 4.0004 4.0004 0 0 0 18.851562 19.994141 A 4.0004 4.0004 0 0 0 17.492188 27.738281 L 21.666016 29.376953 C 20.863524 29.772856 19.960933 30 19 30 C 15.66853 30 13 27.33148 13 24 C 13 20.66852 15.66853 18 19 18 z M 24.996094 30.683594 L 27 31.470703 L 27 40.185547 L 27 42.535156 L 22.605469 44.484375 L 19.25 40.533203 C 19.730663 39.433901 20 38.223149 20 36.951172 C 20 35.532014 19.659028 34.192639 19.068359 32.996094 C 21.343367 32.978785 23.41661 32.101557 24.996094 30.683594 z M 11 30.951172 C 14.33147 30.951172 17 33.619692 17 36.951172 C 17 37.24237 16.97303 37.526912 16.933594 37.806641 L 14.105469 34.478516 C 13.349589 33.519886 12.197352 32.958868 10.976562 32.955078 C 7.575713 32.943978 5.7130814 36.912434 7.8945312 39.521484 L 10.648438 42.933594 C 7.4835407 42.75281 5 40.164051 5 36.951172 C 5 33.619692 7.66853 30.951172 11 30.951172 z "
d="m 40,16 c -2.215997,0 -4,1.866788 -4,4.185547 V 36 h -1 v -6.814453 c 0,-0.162661 -0.02783,-0.316886 -0.04492,-0.474609 -0.0058,-1.647124 -1.020514,-3.12235 -2.55664,-3.716797 l -4.4375,-1.740235 C 27.578317,18.647747 23.701182,15 19,15 c -4.95279,0 -9,4.0472 -9,9 0,1.418791 0.341256,2.758764 0.931641,3.955078 C 6.0103696,27.99252 2,32.021431 2,36.951172 c 0,4.9528 4.04721,9 9,9 0.65701,0 1.296258,-0.07583 1.914062,-0.210938 L 22,57 H 31 33.097656 58 c 2.215997,0 4,-1.866788 4,-4.185547 v -12.628906 -11 C 62,26.866788 60.215997,25 58,25 c -2.215997,0 -4,1.866788 -4,4.185547 V 36 H 53 V 23.185547 C 53,20.866788 51.215997,19 49,19 c -2.215997,0 -4,1.866788 -4,4.185547 V 36 H 44 V 20.185547 C 44,17.866788 42.215997,16 40,16 Z m -21,2 c 2.608824,0 4.804048,1.639507 5.636719,3.949219 l -4.222657,-1.658203 c -0.495714,-0.202539 -1.027046,-0.303492 -1.5625,-0.296875 -4.422659,0.05488 -5.498941,6.186285 -1.359374,7.74414 l 4.173828,1.638672 C 20.863524,29.772856 19.960933,30 19,30 c -3.33147,0 -6,-2.66852 -6,-6 0,-3.33148 2.66853,-6 6,-6 z M 24.996094,30.683594 27,31.470703 v 8.714844 2.349609 L 22.605469,44.484375 19.25,40.533203 C 19.730663,39.433901 20,38.223149 20,36.951172 c 0,-1.419158 -0.340972,-2.758533 -0.931641,-3.955078 2.275008,-0.01731 4.348251,-0.894537 5.927735,-2.3125 z M 11,30.951172 c 3.33147,0 6,2.66852 6,6 0,0.291198 -0.02697,0.57574 -0.06641,0.855469 l -2.828125,-3.328125 c -0.75588,-0.95863 -1.908117,-1.519648 -3.128907,-1.523438 -3.400849,-0.0111 -5.2634806,3.957356 -3.0820308,6.566406 l 2.7539068,3.41211 C 7.4835407,42.75281 5,40.164051 5,36.951172 c 0,-3.33148 2.66853,-6 6,-6 z"
transform="translate(-180,470.14793)"
id="rect6515" />
id="rect6515"
sodipodi:nodetypes="ssccscccsscssccccsscsssccsssccssscccccsssccccccsccsscccccss" />
<rect
rx="3.999995"
ry="4.1854858"

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1008 B

+18 -12
View File
@@ -1,6 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
@@ -14,8 +12,8 @@
viewBox="0 0 64.000001 64.000001"
id="svg4317"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="stretch.svg">
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="gesture-stretch-symbolic.svg">
<defs
id="defs4319" />
<sodipodi:namedview
@@ -25,22 +23,29 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="8.9492826"
inkscape:cy="17.544631"
inkscape:zoom="5.6568542"
inkscape:cx="35.411191"
inkscape:cy="34.587503"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:showpageshadow="false"
inkscape:window-width="2560"
inkscape:window-width="5120"
inkscape:window-height="1376"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:document-rotation="0"
showguides="true"
inkscape:guide-bbox="true">
<inkscape:grid
type="xygrid"
id="grid9205" />
<sodipodi:guide
position="129.04699,44.731341"
orientation="0,-1"
id="guide848" />
</sodipodi:namedview>
<metadata
id="metadata4322">
@@ -61,9 +66,10 @@
transform="translate(0,-988.3622)">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="M 25 8 C 20.047207 8 16 12.0472 16 17 C 16 21.849398 19.882333 25.820253 24.693359 25.984375 L 27 30.894531 L 27 41.185547 L 27 43.494141 L 20.464844 44.285156 L 19.414062 43.158203 C 19.786753 42.17281 20 41.112337 20 40 C 20 35.0472 15.952793 31 11 31 C 6.0472067 31 2 35.0472 2 40 C 2 44.9528 6.0472067 49 11 49 C 11.857115 49 12.684113 48.870665 13.470703 48.644531 L 22 58 L 31 58 L 35 58 L 58 58 C 60.215997 58 62 56.133212 62 53.814453 L 62 41.185547 L 62 32.185547 C 62 29.866788 60.215997 28 58 28 C 55.784003 28 54 29.866788 54 32.185547 L 54 37 L 53 37 L 53 26.185547 C 53 23.866788 51.215997 22 49 22 C 46.784003 22 45 23.866788 45 26.185547 L 45 37 L 44 37 L 44 13.185547 C 44 10.866788 42.215997 9 40 9 C 37.784003 9 36 10.866788 36 13.185547 L 36 37 L 35 37 L 35 30.185547 C 35 30.18084 34.998062 30.176578 34.998047 30.171875 A 4.0004 4.0004 0 0 0 34.621094 28.300781 L 31.974609 22.667969 C 33.238019 21.117771 34 19.145357 34 17 C 34 12.0472 29.952793 8 25 8 z M 25 11 C 28.331471 11 31 13.6686 31 17 C 31 17.882507 30.807929 18.714615 30.470703 19.466797 L 29.060547 16.462891 A 4.1028752 3.9987371 0 0 0 25 13.001953 A 4.1028752 3.9987371 0 0 0 24.826172 13.007812 A 4.0004 4.0004 0 0 0 20.896484 16.998047 A 4.1028752 3.9987371 0 0 1 20.896484 17 A 4.1028752 3.9987371 0 0 0 20.898438 17.027344 A 4.0004 4.0004 0 0 0 21.298828 18.755859 L 23.15625 22.710938 C 20.73678 21.938685 19 19.686937 19 17 C 19 13.6686 21.668529 11 25 11 z M 11 34 C 14.331471 34 17 36.6686 17 40 C 17 40.182439 16.988332 40.36093 16.972656 40.539062 L 13.964844 37.3125 C 13.238574 36.5117 12.219112 36.038953 11.138672 36.001953 C 7.5520017 35.879253 5.6304813 40.176278 8.1132812 42.767578 L 11.056641 45.998047 C 11.037592 45.998222 11.019093 46 11 46 C 7.6685289 46 5 43.3315 5 40 C 5 36.6686 7.6685289 34 11 34 z "
d="m 25,8 c -4.952793,0 -9,4.0472 -9,9 0,4.849398 3.882333,8.820253 8.693359,8.984375 L 27,30.894531 v 10.291016 2.308594 l -6.535156,0.791015 -1.050782,-1.126953 C 19.786753,42.17281 20,41.112337 20,40 c 0,-4.9528 -4.047207,-9 -9,-9 -4.9527933,0 -9,4.0472 -9,9 0,4.9528 4.0472067,9 9,9 0.857115,0 1.684113,-0.129335 2.470703,-0.355469 L 22,58 h 9 4 23 c 2.215997,0 4,-1.866788 4,-4.185547 v -12.628906 -9 C 62,29.866788 60.215997,28 58,28 c -2.215997,0 -4,1.866788 -4,4.185547 V 37 H 53 V 23.301664 c 0,-2.318759 -1.784003,-4.185547 -4,-4.185547 -2.215997,0 -4,1.866788 -4,4.185547 V 37 H 44 V 19.185547 C 44,16.866788 42.215997,15 40,15 c -2.215997,0 -4,1.866788 -4,4.185547 V 37 h -1 v -6.814453 c 0,-0.0047 -0.0019,-0.009 -0.002,-0.01367 0.02716,-0.644977 -0.102172,-1.286946 -0.376953,-1.871094 L 31.974609,22.667969 C 33.238019,21.117771 34,19.145357 34,17 34,12.0472 29.952793,8 25,8 Z m 0,3 c 3.331471,0 6,2.6686 6,6 0,0.882507 -0.192071,1.714615 -0.529297,2.466797 L 29.060547,16.462891 C 28.784734,14.482317 27.050784,13.004414 25,13.001953 c -0.05798,7.56e-4 -0.115934,0.0027 -0.173828,0.0059 -2.177747,0.03849 -3.924494,1.812154 -3.929688,3.990235 V 17 c 6.19e-4,0.0091 0.0013,0.01823 0.002,0.02734 0.0024,0.598878 0.139225,1.189577 0.40039,1.728515 l 1.857422,3.955079 C 20.73678,21.938685 19,19.686937 19,17 c 0,-3.3314 2.668529,-6 6,-6 z M 11,34 c 3.331471,0 6,2.6686 6,6 0,0.182439 -0.01167,0.36093 -0.02734,0.539062 L 13.964844,37.3125 c -0.72627,-0.8008 -1.745732,-1.273547 -2.826172,-1.310547 -3.5866703,-0.1227 -5.5081907,4.174325 -3.0253908,6.765625 l 2.9433598,3.230469 C 11.037592,45.998222 11.019093,46 11,46 7.6685289,46 5,43.3315 5,40 5,36.6686 7.6685289,34 11,34 Z"
transform="translate(0,988.3622)"
id="rect4249" />
id="rect4249"
sodipodi:nodetypes="ssccccccssssccccsscsssccsssccsssccscccssssccccsccccsssscccccsss" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect7301"

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1019 B

+2
View File
@@ -57,6 +57,7 @@
#include <gtk/a11y/gtkmenushellaccessible.h>
#include <gtk/a11y/gtknotebookaccessible.h>
#include <gtk/a11y/gtknotebookpageaccessible.h>
#include <gtk/a11y/gtkplugaccessible.h>
#include <gtk/a11y/gtkpopoveraccessible.h>
#include <gtk/a11y/gtkpanedaccessible.h>
#include <gtk/a11y/gtkprogressbaraccessible.h>
@@ -67,6 +68,7 @@
#include <gtk/a11y/gtkscaleaccessible.h>
#include <gtk/a11y/gtkscalebuttonaccessible.h>
#include <gtk/a11y/gtkscrolledwindowaccessible.h>
#include <gtk/a11y/gtksocketaccessible.h>
#include <gtk/a11y/gtkspinbuttonaccessible.h>
#include <gtk/a11y/gtkspinneraccessible.h>
#include <gtk/a11y/gtkstackaccessible.h>
+21 -87
View File
@@ -59,95 +59,29 @@
unbind "<shift><ctrl>a";
}
@binding-set gtk-mac-file-chooser
@binding-set gtk-mac-cmd-arrows
{
bind "<meta>v" { "location-popup-on-paste" () };
unbind "<ctrl>v";
bind "<meta><shift>G" { "location-popup" () };
bind "<meta><shift>H" { "home-folder" () };
bind "<meta>Up" { "up-folder" () };
bind "<meta>Left" { "move-cursor" (paragraph-ends, -1, 0) };
bind "<meta>KP_Left" { "move-cursor" (paragraph-ends, -1, 0) };
bind "<shift><meta>Left" { "move-cursor" (paragraph-ends, -1, 1) };
bind "<shift><meta>KP_Left" { "move-cursor" (paragraph-ends, -1, 1) };
bind "<meta>Right" { "move-cursor" (paragraph-ends, 1, 0) };
bind "<meta>KP_Right" { "move-cursor" (paragraph-ends, 1, 0) };
bind "<shift><meta>Right" { "move-cursor" (paragraph-ends, 1, 1) };
bind "<shift><meta>KP_Right" { "move-cursor" (paragraph-ends, 1, 1) };
}
@binding-set gtk-mac-tree-view
@binding-set gtk-mac-emacs-like
{
bind "<meta>a" { "select-all" () };
bind "<shift><meta>a" { "unselect-all" () };
bind "<meta>f" { "start-interactive-search" () };
bind "<meta>F" { "start-interactive-search" () };
unbind "<ctrl>a";
unbind "<shift><ctrl>a";
unbind "<ctrl>f";
unbind "<ctrl>F";
}
bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) };
bind "<shift><ctrl>a" { "move-cursor" (paragraph-ends, -1, 1) };
bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) };
bind "<shift><ctrl>e" { "move-cursor" (paragraph-ends, 1, 1) };
@binding-set gtk-mac-icon-view
{
bind "<meta>a" { "select-all" () };
bind "<shift><meta>a" { "unselect-all" () };
unbind "<ctrl>a";
unbind "<shift><ctrl>a";
}
@binding-set gtk-mac-alt-arrows
{
bind "<alt>Right" { "move-cursor" (words, 1, 0) };
bind "<alt>KP_Right" { "move-cursor" (words, 1, 0) };
bind "<alt>Left" { "move-cursor" (words, -1, 0) };
bind "<alt>KP_Left" { "move-cursor" (words, -1, 0) };
bind "<shift><alt>Right" { "move-cursor" (words, 1, 1) };
bind "<shift><alt>KP_Right" { "move-cursor" (words, 1, 1) };
bind "<shift><alt>Left" { "move-cursor" (words, -1, 1) };
bind "<shift><alt>KP_Left" { "move-cursor" (words, -1, 1) };
}
@binding-set gtk-mac-alt-delete
{
bind "<alt>Delete" { "delete-from-cursor" (word-ends, 1) };
bind "<alt>KP_Delete" { "delete-from-cursor" (word-ends, 1) };
bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) };
}
@binding-set gtk-mac-cmd-c
{
bind "<meta>x" { "cut-clipboard" () };
bind "<meta>c" { "copy-clipboard" () };
bind "<meta>v" { "paste-clipboard" () };
unbind "<ctrl>x";
unbind "<ctrl>c";
unbind "<ctrl>v";
}
@binding-set gtk-mac-text-view
{
bind "<shift><meta>a" { "select-all" (0) };
bind "<meta>a" { "select-all" (1) };
unbind "<shift><ctrl>a";
unbind "<ctrl>a";
}
@binding-set gtk-mac-label
{
bind "<meta>a" {
"move-cursor" (paragraph-ends, -1, 0)
"move-cursor" (paragraph-ends, 1, 1)
};
bind "<shift><meta>a" { "move-cursor" (paragraph-ends, 0, 0) };
bind "<meta>c" { "copy-clipboard" () };
unbind "<ctrl>a";
unbind "<shift><ctrl>a";
unbind "<ctrl>c";
}
@binding-set gtk-mac-entry
{
bind "<meta>a" {
"move-cursor" (buffer-ends, -1, 0)
"move-cursor" (buffer-ends, 1, 1)
};
bind "<shift><meta>a" { "move-cursor" (visual-positions, 0, 0) };
unbind "<ctrl>a";
unbind "<shift><ctrl>a";
bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) };
bind "<shift><ctrl>b" { "move-cursor" (logical-positions, -1, 1) };
bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) };
bind "<shift><ctrl>f" { "move-cursor" (logical-positions, 1, 1) };
}
@binding-set gtk-mac-file-chooser
@@ -185,15 +119,15 @@ iconview {
}
textview {
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-text-view;
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-text-view;
}
entry {
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-entry;
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-entry;
}
label {
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-label;
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-label;
}
GtkFileChooserWidget {
+8 -2
View File
@@ -125,8 +125,14 @@ static const LicenseInfo gtk_license_info [] = {
{ N_("GNU Lesser General Public License, version 2.1 only"), "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" },
{ N_("GNU Lesser General Public License, version 3 only"), "https://www.gnu.org/licenses/lgpl-3.0.html" },
{ N_("GNU Affero General Public License, version 3 or later"), "https://www.gnu.org/licenses/agpl-3.0.html" },
{ N_("GNU Affero General Public License, version 3 only"), "https://www.gnu.org/licenses/agpl-3.0.html" }
{ N_("GNU Affero General Public License, version 3 only"), "https://www.gnu.org/licenses/agpl-3.0.html" },
{ N_("BSD 3-Clause License"), "https://opensource.org/licenses/BSD-3-Clause" },
{ N_("Apache License, Version 2.0"), "https://opensource.org/licenses/Apache-2.0" },
{ N_("Mozilla Public License 2.0"), "https://opensource.org/licenses/MPL-2.0" }
};
/* Keep this static assertion updated with the last element of the
* enumeration, and make sure it matches the last element of the array */
G_STATIC_ASSERT (G_N_ELEMENTS (gtk_license_info) - 1 == GTK_LICENSE_MPL_2_0);
typedef struct
{
@@ -2464,7 +2470,7 @@ gtk_about_dialog_set_license_type (GtkAboutDialog *about,
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
g_return_if_fail (license_type >= GTK_LICENSE_UNKNOWN &&
license_type <= GTK_LICENSE_AGPL_3_0_ONLY);
license_type < G_N_ELEMENTS (gtk_license_info));
priv = about->priv;
+8 -1
View File
@@ -60,6 +60,9 @@ typedef struct _GtkAboutDialogPrivate GtkAboutDialogPrivate;
* @GTK_LICENSE_LGPL_3_0_ONLY: The GNU Lesser General Public License, version 3.0 only. Since 3.12.
* @GTK_LICENSE_AGPL_3_0: The GNU Affero General Public License, version 3.0 or later. Since: 3.22.
* @GTK_LICENSE_AGPL_3_0_ONLY: The GNU Affero General Public License, version 3.0 only. Since: 3.22.27.
* @GTK_LICENSE_BSD_3: The 3-clause BSD licence. Since: 3.24.20.
* @GTK_LICENSE_APACHE_2_0: The Apache License, version 2.0. Since: 3.24.20.
* @GTK_LICENSE_MPL_2_0: The Mozilla Public License, version 2.0. Since: 3.24.20.
*
* The type of license for an application.
*
@@ -88,7 +91,11 @@ typedef enum {
GTK_LICENSE_LGPL_3_0_ONLY,
GTK_LICENSE_AGPL_3_0,
GTK_LICENSE_AGPL_3_0_ONLY
GTK_LICENSE_AGPL_3_0_ONLY,
GTK_LICENSE_BSD_3,
GTK_LICENSE_APACHE_2_0,
GTK_LICENSE_MPL_2_0
} GtkLicense;
/**
+5 -3
View File
@@ -199,16 +199,18 @@ set_dialog_properties (GtkAppChooserDialog *self)
unknown = g_content_type_is_unknown (self->priv->content_type);
}
title = g_strdup (_("Select Application"));
subtitle = NULL;
string = NULL;
if (name != NULL)
{
title = g_strdup (_("Select Application"));
/* Translators: %s is a filename */
subtitle = g_strdup_printf (_("Opening “%s”."), name);
string = g_strdup_printf (_("No applications found for “%s”"), name);
}
else
else if (self->priv->content_type)
{
title = g_strdup (_("Select Application"));
/* Translators: %s is a file type description */
subtitle = g_strdup_printf (_("Opening “%s” files."),
unknown ? self->priv->content_type : description);
+23
View File
@@ -329,8 +329,31 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
if (dbus->ss_proxy)
{
GVariant *active_var;
gboolean active;
g_signal_connect (dbus->ss_proxy, "g-signal",
G_CALLBACK (screensaver_signal_session), impl->application);
active_var = g_dbus_proxy_call_sync (dbus->ss_proxy,
"GetActive",
NULL,
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,
NULL,
&error);
if (!active_var)
{
g_debug ("Error calling GetActive on GNOME screensaver: %s",
error->message);
g_clear_error (&error);
}
else
{
g_variant_get (active_var, "(b)", &active);
g_variant_unref (active_var);
gtk_application_set_screensaver_active (dbus->impl.application, active);
}
}
g_debug ("Registering client '%s' '%s'", dbus->application_id, client_id);
+42 -2
View File
@@ -56,14 +56,18 @@ typedef struct
} GtkApplicationImplQuartz;
G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_APPLICATION_IMPL)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
@interface GtkApplicationQuartzDelegate : NSObject <NSApplicationDelegate>
#else
@interface GtkApplicationQuartzDelegate : NSObject
#endif
{
GtkApplicationImplQuartz *quartz;
}
- (id)initWithImpl:(GtkApplicationImplQuartz*)impl;
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender;
- (void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames;
@end
@implementation GtkApplicationQuartzDelegate
@@ -84,6 +88,35 @@ G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_A
*/
return quartz->quit_inhibit == 0 ? NSTerminateNow : NSTerminateCancel;
}
-(void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames
{
GFile **files;
gint i;
GApplicationFlags flags;
flags = g_application_get_flags (G_APPLICATION (quartz->impl.application));
if (~flags & G_APPLICATION_HANDLES_OPEN)
{
[theApplication replyToOpenOrPrint:NSApplicationDelegateReplyFailure];
return;
}
files = g_new (GFile *, [filenames count]);
for (i = 0; i < [filenames count]; i++)
files[i] = g_file_new_for_path ([(NSString *)[filenames objectAtIndex:i] UTF8String]);
g_application_open (G_APPLICATION (quartz->impl.application), files, [filenames count], "");
for (i = 0; i < [filenames count]; i++)
g_object_unref (files[i]);
g_free (files);
[theApplication replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
}
@end
/* these exist only for accel handling */
@@ -132,7 +165,7 @@ gtk_application_impl_quartz_startup (GtkApplicationImpl *impl,
if (register_session)
{
quartz->delegate = [[GtkApplicationQuartzDelegate alloc] initWithImpl:quartz];
[NSApp setDelegate: quartz->delegate];
[NSApp setDelegate: (id)(quartz->delegate)];
}
quartz->muxer = gtk_action_muxer_new ();
@@ -307,6 +340,13 @@ gtk_application_impl_quartz_is_inhibited (GtkApplicationImpl *impl,
static void
gtk_application_impl_quartz_init (GtkApplicationImplQuartz *quartz)
{
/* This is required so that Cocoa is not going to parse the
command line arguments by itself and generate OpenFile events.
We already parse the command line ourselves, so this is needed
to prevent opening files twice, etc. */
[[NSUserDefaults standardUserDefaults] setObject:@"NO"
forKey:@"NSTreatUnknownArgumentsAsOpen"];
quartz->combined = g_menu_new ();
}

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