Compare commits

..

89 Commits

Author SHA1 Message Date
Carlos Soriano 784242fd20 gtkicontheme: Provide safe thread sync load_icon
Although we have a thread safe async version since 7690846c3f, the sync
version cannot be run in a different thread than the main one without
explicitly copying the internal data. Having an async version leads to
believe that the sync version would be thread safe.

It would be good to provide that alternative to be able to run this
on custom thread workers, and at the same time avoid the confusion with
the async alternative.
2018-07-28 19:17:40 +02:00
Benjamin Otte e0807fcf54 gtk; Deprecate gtk_render_frame_gap()
Use gtk_render_frame() instead.
2018-07-24 20:32:26 +02:00
Benjamin Otte 8fd5b567dc gdk: Add GDK_DEPRECATED_IN_3_24() macros 2018-07-24 20:32:26 +02:00
Daniel Mustieles a6de3ed7b4 Updated Spanish translation 2018-07-24 10:13:50 +02:00
Daniel Mustieles 3658b8f709 Update Spanish translation 2018-07-23 10:07:23 +00:00
Daniel Mustieles c0b03564f5 Update Spanish translation 2018-07-23 10:02:39 +00:00
Matthias Clasen 8535610b19 Merge branch 'gtk-3-24-add-spinner-to-sidebar-row' into 'gtk-3-24'
gtkplacessidebar: Show busy spinner in sidebar row during mount ops

See merge request GNOME/gtk!260
2018-07-22 17:14:27 +00:00
segfault 0e7228b267 gtkplacessidebar: Show busy spinner in sidebar row during mount ops 2018-07-22 17:04:05 +02:00
Bastien Nocera 5b527d6910 test: Fix compile-time warnings
testsuite/gtk/notify.c: In function ‘test_type’:
testsuite/gtk/notify.c:434:14: warning: assignment to ‘GObject *’ {aka ‘struct _GObject *’} from incompatible pointer type ‘GtkSettings *’ {aka ‘struct _GtkSettings *’} [-Wincompatible-pointer-types]
     instance = g_object_ref (gtk_settings_get_default ());
              ^
testsuite/gtk/notify.c:443:16: warning: assignment to ‘GObject *’ {aka ‘struct _GObject *’} from incompatible pointer type ‘GdkWindow *’ {aka ‘struct _GdkWindow *’} [-Wincompatible-pointer-types]
       instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
                ^
2018-07-21 14:55:30 +02:00
Carlos Garnacho eb3fd5e941 gtksettings: Remove leftover code
The immodule variable is unused
2018-07-21 14:55:01 +02:00
Tim Sabsch ca192a87c2 Update German translation 2018-07-20 20:31:47 +00:00
Matthias Clasen fa77925da2 Merge branch 'gtk-3-24' into 'gtk-3-24'
Remove deprecated functions

See merge request GNOME/gtk!255
2018-07-20 14:07:44 +00:00
Benjamin Otte 172dc3e79a Merge branch 'wip/muktupavels/deprecate-gtk-css-provider-get-default' into 'gtk-3-24'
gtkcssprovider: deprecate gtk_css_provider_get_default

See merge request GNOME/gtk!257
2018-07-20 14:05:12 +00:00
Alberts Muktupāvels cb39169ba7 gtkcssprovider: deprecate gtk_css_provider_get_default
This function is unused since cdc6e82720 commit and does not
contain fallback style.

https://gitlab.gnome.org/GNOME/gtk/issues/1226
2018-07-20 14:55:27 +03:00
Emin Tufan Çetin 577dfb9e2f Update Turkish translation 2018-07-20 11:21:46 +00:00
Yi-Soo An db7f085315 tests/animated-resizing: Remove deprecated functions
The functions as below are deprecated
- gdk_screen_get_monitor_geometry
- gdk_screen_get_primary_monitor

Instead of them, use functions below
- gdk_monitor_get_geometry
- gdk_display_get_primary_monitor
2018-07-20 15:42:26 +09:00
Yi-Soo An de18859249 demos/gtk-demo/changedisplay: Remove deprecated gdk_flush
Use gdk_display_flush instead of it.
2018-07-20 15:40:37 +09:00
Yi-Soo An 5fb999010c modules/input/gtkimcontextthai: Remove deprecated gdk_beep
Use gdk_display_beep instead of it.
2018-07-20 15:39:49 +09:00
Timm Bäder 2c3a7c63ef Merge branch '628-text-view-width' into 'gtk-3-24'
Resolve #628: "TextView: spaces acting as non-breaking whitespace if :left- or :right-margin is set"

See merge request GNOME/gtk!236
2018-07-20 06:24:14 +00:00
Matthias Clasen 078870f604 Emoji chooser: Also check for hex boxes
We don't want to see those either.
2018-07-19 20:51:22 -04:00
Matthias Clasen c52d9cfc14 moji chooser: Try harder to avoid fallback
We don't want to see any fallback rendering.
The current check was still letting some fallback
combinations through.

Based on work by Julian Sparber.
2018-07-19 20:51:07 -04:00
Matthias Clasen e37e1dfcb0 Merge branch 'gtk-3-24-defaultvalues-ignore-more' into 'gtk-3-24'
defaultvalue: Ignore more style properties that Adwaita overrides

See merge request GNOME/gtk!253
2018-07-19 20:23:29 +00:00
Iain Lane 2e5307daea defaultvalue: Ignore more style properties that Adwaita overrides
These broke once we switched away from Raleigh
2018-07-19 16:29:14 +01:00
Daniel Boles cb4ea3fc65 NEWS: Remove an accidental tab 2018-07-18 23:09:12 +01:00
Timm Bäder 56033a8d27 gesturestylus: Clarify a documentation comment
Use the proper gtkdoc syntax for signals.
2018-07-18 23:05:06 +01:00
Matthias Clasen f7f3939b04 3.23.1 2018-07-18 16:58:17 -04:00
Piotr Drąg 13a36e81dc Update POTFILES.in 2018-07-18 17:00:11 +02:00
Matthias Clasen affb4ff5f4 Fix up version annotations
The new api here was introduced in 3.24.
2018-07-18 07:18:21 -04:00
Matthias Clasen ee22277f18 Add new API to the docs 2018-07-18 07:12:41 -04:00
Matthias Clasen cc73241c7b Merge branch 'wip/carlosg/controllers-backport' into 'gtk-3-24'
Wip/carlosg/controllers backport

See merge request GNOME/gtk!246
2018-07-18 00:23:37 +00:00
Balázs Meskó ac358d2507 Update Hungarian translation 2018-07-17 23:11:18 +00:00
Carlos Garnacho 9ee60777e7 sm scroll 2018-07-16 15:44:35 +02:00
Carlos Garnacho effdf3af74 demos: Add "Paint" demo 2018-07-16 15:43:43 +02:00
Carlos Garnacho a8463953a4 gtk: Add GtkGestureStylus
This is a GtkGesture done to deal with stylus events from drawing tablets.
Those have a special number of characteristics that extend a regular
pointer, so it makes sense to wrap that.
2018-07-16 15:43:43 +02:00
Carlos Garnacho 7793aab5f0 gtkeventcontrollerkey: Add ::focus-in/out signals
And handle GDK_FOCUS_CHANGE events in order to emit those.
2018-07-16 15:43:43 +02:00
Carlos Garnacho ecf9fa65b8 gtkeventcontrollerkey: Add get_group() call
Callers can use this function on a key-pressed/released signal
to find out the key event group, useful in a few places.
2018-07-16 15:43:43 +02:00
Carlos Garnacho a32933b056 eventcontrollerkey: Add function to forward stuff elsewhere 2018-07-16 15:43:43 +02:00
Carlos Garnacho e0f3e8a7e5 gtk: Add GtkEventControllerKey
This event controller is meant to replace usage from key-press/release-event
handlers all through. Optionally it can be set a GtkIMContext, so interaction
is carried by the controller.
2018-07-16 15:43:43 +02:00
Matthias Clasen 1f9de707f7 Add x/y to GtkEventControllerMotion::enter
We have this information available in enter events,
and having it in the controller signal as well makes
porting easier.

Update existing users.
2018-07-16 15:43:43 +02:00
Matthias Clasen 8b2c3a8c1a Add a simple motion eventcontroller
This can serve as a replacement for the legacy
event signals for enter/leave/motion notify.
2018-07-16 15:43:43 +02:00
Matthias Clasen e7af3410cf Avoid excess notification for GdkEventControllerScroll::flags
We have a test that checks this, and it is the right thing to do.
2018-07-16 15:43:43 +02:00
Carlos Garnacho 84d3bfb6fd gtk: Remove CONSTRUCT_ONLY flag from GtkEventControllerScroll::flags
There is a gtk_event_controller_scroll_set_flags() call that's meant
to be called after construction (eg. due to scrolledwindow relayouts
hiding/showing scrollbars). The property shouldn't be construct-only
for consistence.
2018-07-16 15:43:43 +02:00
Carlos Garnacho 448551f31c gtkeventcontrollerscroll: Add some docs 2018-07-16 15:43:43 +02:00
Timm Bäder 7b8c036f8f eventcontrollerscroll: Emit ::scroll for -1/+1 discrete steps
The > 1 meant it only emits the signal for -2/+2 steps.
2018-07-16 15:43:43 +02:00
Carlos Garnacho 747be0f499 gtk: Add GtkEventControllerScroll
This is a GtkEventController implementation to handle mouse
scrolling. It handles both smooth and discrete events and
offers a way for callers to tell their preference too, so
smooth events shall be accumulated and coalesced on request.

On capable devices, it can also emit ::scroll-begin and
::scroll-end enclosing all ::scroll events for a scroll
operation.

It also has builtin kinetic scrolling capabilities, reporting
the initial velocity for both axes after ::scroll-end if
requested.
2018-07-16 15:43:43 +02:00
Benjamin Otte 9008f7702d window: Update opaque region if background-color changes
The opaque region is only set when the background color is opaque. So
we need to do something about it when the background color changes.

However, in the case where a size allocation is going to happen, we
already do this update in size_allocate(), so in that case avoid doing
it twice.
2018-07-13 15:02:47 +02:00
Bruno Lopes da Silva df0454236c Update Brazilian Portuguese translation 2018-07-10 13:02:08 +00:00
Jakub Steiner 8373b906d4 Merge branch 'expander-size-3' into 'gtk-3-24'
HighContrast: Restore expander size

See merge request GNOME/gtk!210
2018-07-09 15:27:51 +00:00
Peter Bloomfield 4b4ae4464c text-view: Do not double-allocate borders
Reverts part of Commit 25b67af3

The 'width' part of the commit is the cause of #628: requisition->width
is first set to priv->layout->width, which already includes
priv->left_border + priv->right_border. It's a bit labyrinthine, but
essentially:

*  layout->width is set in update_layout_size() (gtktextlayout.c line 992)
   as the maximum line width, and
*  the line width is set to display->width in gtk_text_layout_real_wrap()
   (gtktextlayout.c line 1183), and
*  display->width is set to text_pixel_width + h_margin + h_padding in
   gtk_text_layout_get_line_display() (gtktextlayout.c line 2584), and
*  h_margin + h_padding is the same as priv->left_border +
   priv->right_border.

Adding it again leads to an increase in the size-request, which
results in wider lines; rinse and repeat.
2018-07-08 17:24:07 -04:00
Mario Blättermann 0bca6969d4 Update German translation 2018-07-07 19:48:26 +00:00
Samuel Thibault 660087db42 HighContrast: Restore expander size
Expanders used to be 16px high. With the move from the gtk2 rendering
to gtk3 rendering they shrunk to 12px, making them hard to see, because
it's now the icon which is 16px high and the icon contains transparent
borders.

This makes the HighContrast theme use 24px icons instead, to restore
16px expanders. This may expander some containers a bit.

Closes #1046
2018-07-03 19:27:15 +02:00
Jonas Ådahl 927004178f Merge branch 'fix_wayland_csd_announce' into 'gtk-3-24'
Fix gdk_wayland_window_announce_csd

See merge request GNOME/gtk!221
2018-07-03 10:14:57 +00:00
Daniel Boles 1b8de2d5fa Adwaita: Drop some unneeded overrides
The pseudoclasses work fine on the subnodes without having to also apply
`parent:class subnode`.
2018-07-02 21:45:06 +01:00
Daniel Boles 483d25f418 ModelButton: Add Since annotation on new prop 2018-07-02 20:31:45 +01:00
Daniel Boles 1d30ada735 ScrolledWindow: a couple of spelling/grammar fixes
(A) Put a space in "scrolled window" like the other doc comments
(B) Say "i.e." rather than "ie."
(C) Fix grammar from "makes [...] exactly reaches" to "exactly reach"
2018-07-02 20:11:12 +01:00
Daniel Boles 8a00551871 ScrolledWindow: Fix/improve doc of key bindings
Saying 'key + modifiers' is really weird, so reverse that, and explain
why there are 2 cited and what the difference between them is.
2018-07-02 20:09:37 +01:00
Daniel Boles 0ed3a77d29 ScrolledWindow: Add missing apostrophes 2018-07-02 20:07:23 +01:00
Matthias Clasen 29b61176bb Merge branch 'wip/gtk324.win.egl' into 'gtk-3-24'
Add an EGL renderer for GDK-Win32 for GTK+-3.24 (was: merge request !126)

See merge request GNOME/gtk!191
2018-07-02 17:18:26 +00:00
Matthias Clasen 174c4fa7ee Merge branch 'wip/aplazas/modelbutton-markup' into 'gtk-3-24'
ModelButton: Add 'use-markup' property

See merge request GNOME/gtk!219
2018-07-02 17:16:59 +00:00
Daniel Boles 08adcb6318 PlacesSidebar: Fix warning about signal parameters
@open_flags was not documented, and so:

jhbuild/checkout/gnome/gtk+-3/gtk/gtkplacessidebar.c:4743: Warning: Gtk:
incorrect number of parameters in comment block, parameter annotations
will be ignored.
2018-07-01 16:08:06 +01:00
Adrien Plazas 504eb89155 ModelButton: Add 'use-markup' property
Binds this property to the button's label, allowing a model button to
have text with markup.

This will be convenient for buttons like 'Online Accounts <sup>↗</sup>'.
2018-06-29 23:02:21 +02:00
Daniel Boles b75b5e900a themes: Remove Raleigh
It has been extremely broken since the move to CSS gadgets/nodes, so
clearly no one is depending on it; nor does anyone seem to want to
resurrect it, and writing a Raleigh-inspired theme from scratch would be
faster if they did. So let's drop the dead weight from the build and lib

Now that we don't have Raleigh, the defaultvalue test has to be changed
to set Adwaita before checking the default values of style properties -
some of which Adwaita overrides in its CSS, meaning those would fail.
Not that it passed before anyway! But it does now after my other commit.

Note that I leave the last reference in gtk-zip.sh.in alone since that
hasn't been touched in 8 years and probably has plenty other problems...

Close https://gitlab.gnome.org/GNOME/gtk/issues/1187
2018-06-29 20:12:19 +01:00
Daniel Boles ca4ec52c54 defaultvalue: Fix some very broken indentation
and while here, use the more typical : to separate the type and property
2018-06-29 19:57:06 +01:00
Daniel Boles 908d4f1d1f defaultvalue: Ignore property to actually pass
GtkFontChooserWidget:tweak-action gets set in init(), so we have to skip
testing that it is the default NULL for a GObject, or the test fails.
2018-06-29 18:57:43 +01:00
Daniel Boles 62573f299c defaultvalue: Stop warnings via new g_object_ref()
Now that it can propagate the type, we must explicitly cast to GObject*
to assign it, otherwise gcc shouts.
2018-06-29 18:46:09 +01:00
Daniel Boles c0bf48c8ab defaultvalue test: Remove obsolete properties 2018-06-29 18:46:09 +01:00
Matthias Clasen 26f35fb941 Merge branch 'wip/cursor-output-scale-changes-3-24' into 'gtk-3-24'
wayland: Update cursor surface scale when output scale changes

See merge request GNOME/gtk!223
2018-06-29 14:30:51 +00:00
David Edmundson d49335c59a wayland: Use correct enums in server_decoration_request_mode
The enum is duplicated in the spec for the manager and the decoration
object. We should be using the right ones. In practice they have the
same value, so this bug didn't cause any issues.
2018-06-28 18:51:12 +01:00
David Edmundson f62c92783a wayland: Respond to server_decoration.mode events 2018-06-28 18:51:12 +01:00
David Edmundson f3f4d40b89 wayland: Fix memory leak in server decoration object
The server decoration object becomes invaid when the wl_surface is
deleted. We should tidy it up then.
2018-06-28 18:51:12 +01:00
David Edmundson b0bfe606aa wayland: Reset server decoration interface on window mapping
The wl_surface is destroyed and recreated when the window is
mapped/unmapped. As we have a new wl_surface we need to create a new
server_decoration object for that surface.
2018-06-28 18:50:50 +01:00
David Edmundson 32ae97f13a wayland: Explicitly request mode for both CSD and SSD modes
According to the spec compositors were to assume surfaces are CSD until
told otherwise. This means we need to send
org_kde_kwin_server_decoration_request_mode in both cases.

This fixes libreoffice under kwin, which would remove it's own headers
as per the manager's request but not inform kwin leaving it in the even
more broken state of having none.
2018-06-28 18:50:50 +01:00
Jonas Ådahl 3354d91090 wayland: Update cursor surface scale when output scale changes
Cursor surfaces didn't listen for output scale changes, meaning they
didn't adapt their scale when an output changed scale, which could
happen for example when changing the monitor scale via Settings.
2018-06-28 12:01:48 +02:00
Chun-wei Fan b6db96cd1a GDK/Win32: Cleanup and further fix OpenGL/ES glitches
We also need to invalidate the OpenGL/ES window when we resize the
window via a mouse drag operation, so that we don't get glitches in such
situations, because they are not covered in GdkWindow's
impl_class->move_resize().

Make sure that we only force the invalidation when necessary (as it is
expensive), and clean up the gdkevents-win32.c code so that we include
gdkglcontext-win32.h in the right place instead of using an extern, as
we need to invalidate the window accordingly.
2018-06-28 15:33:42 +08:00
Chun-wei Fan b2ea707614 GDK-Win32: Fix glitches when using EGL/ANGLE
We need to force redraws of the whole window when we are using EGL/ANGLE
during maximize, restore and Aerosnap ops so that we do not get glitches
in the resulting window.
2018-06-28 15:33:42 +08:00
Chun-wei Fan af66faf604 Add a EGL renderer (via ANGLE) for Windows
This is for adding a EGL-based renderer which is done via the ANGLE
project, which translate EGL calls to Direct3D 9/11.  This is done as a
possible solution to issue #105, especially for cases where the needed
full GL extensions to map OpenGL to Direc3D is unavailable or
unreliable, or when the OpenGL implementation from the graphics drivers
are problematic.

To enable this, do the following:
-Build ANGLE and ensure the ANGLE libEGL.dll and libGLESv2.dll are
 available.  A sufficiently-recent ANGLE is needed for things to
 work correctly--note that the copy of ANGLE that is included in
 qtbase-5.10.1 is sufficient.  ANGLE is licensed under a BSD 3-clause
 license.  Note also that Visual Studio 2013 or later is required to
 build ANGLE from QT-5.10.1, but the 2013-built ANGLE DLLs can work
 without without problems for GTK+ that is built with Visual Studio
 2008 or later.
-Build libepoxy on Windows with EGL support enabled.
-Define GDK_WIN32_ENABLE_EGL when building gdk-win32.lib when building
 with Visual Studio, or pass in --enable-win32-gles during configure
 when building with MinGW/mingw-w64.
-Prior to running GTK+ programs, the GDK_GL envvar needs to contain
 gles.

Known issues:
-Only OpenGL ES 3 is supported, ANGLE's ES 2 does not support the needed
 extensions, notably GL_OES_vertex_array_object, but its ES 3 support is
 sufficient.
-There is no autodetection or fallback mechanism to enable using
 EGL/Angle automatically yet.  There is no plans to do this in this
 commit.

Thanks to LRN for pointing out that we should #include
"win32/gdkwin32.h" instead of #include "gdkwin32.h" for gdkgl.c.  LRN
also did the autotools portion of this patch.

Further notes about the autotools --enable-win32-gles option, fom LRN:

This adds --enable-win32-gles option, which enables the
code for GLES renderer.  This commit also adds tests for WGL and
EGL in epoxy.  The absence of WGL is highly unlikely (it's enabled
by default), but checking for EGL when GLES is enabled is necessary,
as EGL is disabled in Windows builds of epoxy by default.
2018-06-28 15:33:42 +08:00
Emmanuele Bassi 5afc01d995 Merge branch '324.win32.build' into 'gtk-3-24'
GTK+: Fix dist and build on Windows

See merge request GNOME/gtk!207
2018-06-27 18:26:02 +00:00
Chun-wei Fan f353ba3acb demos/gtk-demo/gtkfishbowl.c: Include gtk/fallback-c89.c
...in place of math.h, as we are using round(), which is possibly not
provided by the compiler since we don't require a C99 compiler in
GTK+-3.x and gtk/fallback-c89.c does include math.h anyways.
2018-06-26 16:40:18 +08:00
Chun-wei Fan eebf151f2a gtk/: Fix build without PangoFT2 and HarfBuzz
On Windows HarfBuzz and PangoFT2 are optional, so we need to ensure that
we only build the bits that require HarfBuzz and PangoFT2 when needed.
We may need to see later whether we can get the needed functionality in
gtkfontchooserwidget.c with the Windows APIs without the need of
HarfBuzz nor PangoFT2 (and starting programs on Windows using FontConfig
is very slow).
2018-06-26 16:40:18 +08:00
Chun-wei Fan e8d3899461 gtk/Makefile.am: Dist the newly-added private headers
We need to dist language-names.h and script-names.h so that we won't
be missing headers in a dist tarball.
2018-06-26 16:40:11 +08:00
Benjamin Otte e7bb83988f progressbar: Never stop never stopping
Reinstate code that was accidentally deleted during the port to
GtkProgressTracker in commit d57ebe2de7.

Without that code, pulsing the progressbar will stop doing anything
after 3 iterations.
2018-06-26 04:14:25 +02:00
Matthias Clasen b9b62fca0c Don't forget to dist open-type-layout.h
This is a private header, but it still needs to end up in the tarball.
2018-06-25 18:51:45 -04:00
Matthias Clasen 03c1c604dd Merge branch 'issue1170' into 'gtk-3-24'
modules: fix gtk-2.0 paths to gtk-3.0

See merge request GNOME/gtk!211
2018-06-25 21:13:24 +00:00
Matthias Clasen 504574b6be Merge branch 'mcatanzaro/#1174' into 'gtk-3-24'
imwayland: Fix a small leak

See merge request GNOME/gtk!218
2018-06-25 18:57:52 +00:00
Michael Catanzaro efb934c07f imwayland: Fix a small leak
If the parent get_preedit_string implementation returns a nonnull
zero-length string, then we ignore it, which is almost fine. We have to
free it, though.

Fixes #1174
2018-06-24 15:49:46 -05:00
Timm Bäder 69adcc46c9 Merge branch 'wip/chergert/no-compressed-ui' into 'gtk-3-24'
build: use xml-stripblanks with .ui resources

See merge request GNOME/gtk!216
2018-06-24 06:26:13 +00:00
Jehan 593edacb48 gtk: also recolor circle and ellipse in symbolic SVG icons. 2018-06-23 16:14:01 -04:00
Christian Hergert f05865ad3a build: use xml-stripblanks with .ui resources
This adds a preprocess step to the .ui files to strip them of blank
characters. It also removes the compressed='true' from the .ui files since
that involves creating lots of decompressor objects when creating widgets.
Doing so has runtime overhead and slows down the creation of initial
application windows.

The .ui files are left compressed for the Inspector, since that is not in
the core performance path of application startup.
2018-06-23 12:42:25 -07:00
Matthias Clasen 0997ffbc5b Update NEWS 2018-06-21 18:56:00 -04:00
78 changed files with 9935 additions and 3202 deletions
+45
View File
@@ -1,3 +1,31 @@
Overview of Changes in GTK+ 3.23.1
==================================
* Backported event controllers from GTK+ 4:
- GtkEventControllerScroll
- GtkEventControllerMotion
- GtkEventControllerKey
- GtkGestureStylus
* Support markup in GtkModelButtons
* Themes
- The Raleigh theme has been removed
- Expander size in HighContrast has been increased
* Wayland
- Update cursor scale when needed
- Decoration negotiation protocol fixes
* Windows
- Add an EGL renderer based on ANGLE
* Translation updates:
- Brazilian Portuguese
- German
- Hungarian
Overview of Changes in GTK+ 3.23.0
==================================
@@ -15,6 +43,12 @@ Overview of Changes in GTK+ 3.23.0
- Support a completion popup for Emoji
- Drop Ctrl-Shift-e shortcut
* Other new apis:
- gdk_window_move_to_rect
* Wayland:
- Use anonymous shared memory on FreeBSD
* Bugs fixed:
#85 widgetDragDestFindTarget introspection data does not show nullable...
#154 Documentation: Lifecycle of Editables inside GtkCellRenderers is no...
@@ -24,15 +58,26 @@ Overview of Changes in GTK+ 3.23.0
#450 Menu navigation triangle doesn't work anymore
#792 Focus events are not always matched
#898 emoji-chooser: search for flags doesn't work
#997 gdk: Make gdk_window_move_to_rect public
#1053 Scroll cursor gets left behind if a child widget steals the scroll
#1059 -Wparentheses warnings in GTK+ headers when compiling C++ code with...
#1065 GtkScrollbar horizontal mouse wheel scroll direction is wrong
#1069 Thread 1 "glade" received signal SIGFPE, Arithmetic exception.
#1088 CssGadget: Round px values up for min-width|height
#1115 gtk icon theme searches system dirs before user dirs
#1134 x11: Always set None pixmap for no background
#1160 a11y/entry: Fix copy-pasteo re 2ndary icon tooltip
#1165 InfoBar: Fix wrong type in copy-pasted param doc
#1166 EmojiCompletion: Use Box:spacing instead of CSS
!125 HC: Avoid same BG/FG colors in flat treeview entry
!157 wayland: Implement 'gtk-fontconfig-timestamp' & 'gtk-modules'
!181 W32: Don't forget to check VK_MENU and set MK_ALT
!206 searchenginetracker: Don't leak the hits' GFiles
407242 GtkScale: Up/Down keys decrease/increase value, which is opposite...
686109 gtk_print_context_get_hard_margins should return page size specif...
765327 GtkPlug scaled to half the expected size on HiDPI screens
772817 File Chooser: Path arrow button frames are reversed and detached ...
773299 gtk/language-names.c: Fix build on non-GCC/CLang
775279 early calls to libepoxy cause all gtk3 programs to abort when the...
786524 ocument GTK_OVERLAY_SCROLLING environment variable
787867 OSX macports pango text size appears to vary between version 1.40...
+1
View File
@@ -42,6 +42,7 @@ EXTRA_DIST += \
replace.py \
pc_base.py \
gtkpc.py \
README_EGL_MSVC.txt \
$(GENERATED_ITEMS)
-include $(top_srcdir)/git.mk
+29
View File
@@ -0,0 +1,29 @@
Notes on enabling EGL (ANGLE/D3D support) for Windows/Visual Studio builds
==========================================================================
There is now support in the GL context creation code for Windows in GDK for
creating and using EGL (OpenGL ES 3) contexts, which can be used instead of
the existing OpenGL (Desktop) support, especially when the graphics drivers
do not support OpenGL adequately.
This support is not enabled by default in the project files. In order to do
so, please do the following:
-Obtain or compile a build of recent version of ANGLE. The one that comes
with QT 5.10.x is sufficiently recent, but not the one that comes with QT-
5.6.x. Note that Visual Studio 2013 or later is required for building
ANGLE from QT-5.10.x, but the Visual Studio 2013-built ANGLE DLLs does work
without problems with GTK+ built with Visual Studio 2008~2013. You may
need to obtain D3Dcompiler_[47|43|42].dll if it does not come with the
system (which is part of the DirectX runtimes). Its headers and .lib
needs to be set to be found by the compiler and linker respectively before
building libepoxy.
-Build libepoxy with EGL support, which has to be enabled explicitly on
Windows builds. Pass in -Degl=yes when building libepoxy using Meson.
Build and install, making sure the headers and .lib can be located by the
compiler and linker respectively.
-Open the vsX/gtk+.sln, and open the project properties in the "gdk3-win32"
project. Under "C/C++", add GDK_WIN32_ENABLE_EGL in the "Preprocessor
Definitions" to the existing definitions in there for the configuration
that is being built. Then build the solution.
-To force the use of the EGL code, set the envvar GDK_GL=(...,)gles , where (...,)
are the other GDK_GL options desired.
+38 -1
View File
@@ -10,7 +10,7 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [23])
m4_define([gtk_micro_version], [0])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [0])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
@@ -1434,6 +1434,43 @@ else
X11_PREFIX="$ac_default_prefix"
fi
AC_ARG_ENABLE(win32-gles,
[AS_HELP_STRING([--enable-win32-gles],
[enable OpenGL ES rendering in Win32 backend, disabled by default])],
[win32_gles=yes],
[win32_gles=no])
if test x"$enable_win32_backend" = xyes; then
AC_MSG_CHECKING(WGL support in epoxy)
WGL_SUPPORT="`$PKG_CONFIG --variable=epoxy_has_wgl epoxy`"
if test x"$WGL_SUPPORT" = x1; then
AC_MSG_RESULT([supported])
else
AC_MSG_ERROR([
*** epoxy was not built with WGL support or epoxy version is too old.
*** WGL support in epoxy is enabled by default for all Windows builds,
*** and is used by GTK+ uncondititonally. If it is not there, then
*** something is very wrong.
])
fi
if test x"$win32_gles" = xyes; then
AC_MSG_CHECKING(EGL support in epoxy)
EGL_SUPPORT="`$PKG_CONFIG --variable=epoxy_has_egl epoxy`"
if test x"$EGL_SUPPORT" = x1; then
AC_MSG_RESULT([supported])
else
AC_MSG_ERROR([
*** epoxy was not built with EGL support or epoxy version is too old.
*** EGL support in epoxy is disabled by default in Windows builds,
*** you might need to rebuild epoxy with explicit --enable-egl=yes.
*** EGL support is needed for OpenGL ES rendering.
])
fi
fi
fi
AM_CONDITIONAL(WIN32_GLES, test x"$platform_win32" = xyes -a x"$win32_gles" = xyes)
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
+1
View File
@@ -48,6 +48,7 @@ demos_base = \
offscreen_window2.c \
overlay.c \
overlay2.c \
paint.c \
panes.c \
pickers.c \
pixbufs.c \
+1 -1
View File
@@ -151,7 +151,7 @@ query_for_toplevel (GdkScreen *screen,
g_object_unref (cursor);
gtk_widget_destroy (popup);
gdk_flush (); /* Really release the grab */
gdk_display_flush (display); /* Really release the grab */
return toplevel;
}
+1
View File
@@ -177,6 +177,7 @@
<file>offscreen_window2.c</file>
<file>overlay.c</file>
<file>overlay2.c</file>
<file>paint.c</file>
<file>pagesetup.c</file>
<file>panes.c</file>
<file>pickers.c</file>
+1 -1
View File
@@ -19,7 +19,7 @@
#include "gtkfishbowl.h"
#include <math.h>
#include "gtk/fallback-c89.c"
typedef struct _GtkFishbowlPrivate GtkFishbowlPrivate;
typedef struct _GtkFishbowlChild GtkFishbowlChild;
+255
View File
@@ -0,0 +1,255 @@
/* Paint
*
* Demonstrates practical handling of drawing tablets in a real world
* usecase.
*/
#include <gtk/gtk.h>
typedef struct
{
GtkEventBox parent_instance;
cairo_surface_t *surface;
cairo_t *cr;
GdkRGBA draw_color;
GtkGesture *stylus_gesture;
} DrawingArea;
typedef struct
{
GtkEventBoxClass parent_class;
} DrawingAreaClass;
G_DEFINE_TYPE (DrawingArea, drawing_area, GTK_TYPE_EVENT_BOX)
static void
drawing_area_ensure_surface (DrawingArea *area,
gint width,
gint height)
{
if (!area->surface ||
cairo_image_surface_get_width (area->surface) != width ||
cairo_image_surface_get_height (area->surface) != height)
{
cairo_surface_t *surface;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
width, height);
if (area->surface)
{
cairo_t *cr;
cr = cairo_create (surface);
cairo_set_source_surface (cr, area->surface, 0, 0);
cairo_paint (cr);
cairo_surface_destroy (area->surface);
cairo_destroy (area->cr);
cairo_destroy (cr);
}
area->surface = surface;
area->cr = cairo_create (surface);
}
}
static void
drawing_area_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
DrawingArea *area = (DrawingArea *) widget;
drawing_area_ensure_surface (area, allocation->width, allocation->height);
GTK_WIDGET_CLASS (drawing_area_parent_class)->size_allocate (widget, allocation);
}
static void
drawing_area_map (GtkWidget *widget)
{
GtkAllocation allocation;
GTK_WIDGET_CLASS (drawing_area_parent_class)->map (widget);
gdk_window_set_event_compression (gtk_widget_get_window (widget), TRUE);
gtk_widget_get_allocation (widget, &allocation);
drawing_area_ensure_surface ((DrawingArea *) widget,
allocation.width, allocation.height);
}
static void
drawing_area_unmap (GtkWidget *widget)
{
DrawingArea *area = (DrawingArea *) widget;
g_clear_pointer (&area->cr, cairo_destroy);
g_clear_pointer (&area->surface, cairo_surface_destroy);
GTK_WIDGET_CLASS (drawing_area_parent_class)->unmap (widget);
}
static gboolean
drawing_area_draw (GtkWidget *widget,
cairo_t *cr)
{
DrawingArea *area = (DrawingArea *) widget;
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
cairo_set_source_surface (cr, area->surface, 0, 0);
cairo_paint (cr);
cairo_set_source_rgb (cr, 0.6, 0.6, 0.6);
cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
cairo_stroke (cr);
return TRUE;
}
static void
drawing_area_class_init (DrawingAreaClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
widget_class->size_allocate = drawing_area_size_allocate;
widget_class->draw = drawing_area_draw;
widget_class->map = drawing_area_map;
widget_class->unmap = drawing_area_unmap;
}
static void
drawing_area_apply_stroke (DrawingArea *area,
GdkDeviceTool *tool,
gdouble x,
gdouble y,
gdouble pressure)
{
if (gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
{
cairo_set_line_width (area->cr, 10 * pressure);
cairo_set_operator (area->cr, CAIRO_OPERATOR_DEST_OUT);
}
else
{
cairo_set_line_width (area->cr, 4 * pressure);
cairo_set_operator (area->cr, CAIRO_OPERATOR_SATURATE);
}
cairo_set_source_rgba (area->cr, area->draw_color.red,
area->draw_color.green, area->draw_color.blue,
area->draw_color.alpha * pressure);
//cairo_set_source_rgba (area->cr, 0, 0, 0, pressure);
cairo_line_to (area->cr, x, y);
cairo_stroke (area->cr);
cairo_move_to (area->cr, x, y);
}
static void
stylus_gesture_down (GtkGestureStylus *gesture,
gdouble x,
gdouble y,
DrawingArea *area)
{
cairo_new_path (area->cr);
}
static void
stylus_gesture_motion (GtkGestureStylus *gesture,
gdouble x,
gdouble y,
DrawingArea *area)
{
GdkDeviceTool *tool;
gdouble pressure;
tool = gtk_gesture_stylus_get_device_tool (gesture);
if (!gtk_gesture_stylus_get_axis (gesture, GDK_AXIS_PRESSURE, &pressure))
pressure = 1;
drawing_area_apply_stroke (area, tool, x, y, pressure);
gtk_widget_queue_draw (GTK_WIDGET (area));
}
static void
drawing_area_init (DrawingArea *area)
{
gtk_event_box_set_visible_window (GTK_EVENT_BOX (area), TRUE);
area->stylus_gesture = gtk_gesture_stylus_new (GTK_WIDGET (area));
g_signal_connect (area->stylus_gesture, "down",
G_CALLBACK (stylus_gesture_down), area);
g_signal_connect (area->stylus_gesture, "motion",
G_CALLBACK (stylus_gesture_motion), area);
area->draw_color = (GdkRGBA) { 0, 0, 0, 1 };
}
GtkWidget *
drawing_area_new (void)
{
return g_object_new (drawing_area_get_type (), NULL);
}
void
drawing_area_set_color (DrawingArea *area,
GdkRGBA *color)
{
area->draw_color = *color;
}
static void
color_button_color_set (GtkColorButton *button,
DrawingArea *draw_area)
{
GdkRGBA color;
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
drawing_area_set_color (draw_area, &color);
}
GtkWidget *
do_paint (GtkWidget *toplevel)
{
static GtkWidget *window = NULL;
if (!window)
{
GtkWidget *draw_area, *headerbar, *colorbutton;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
draw_area = drawing_area_new ();
gtk_container_add (GTK_CONTAINER (window), draw_area);
headerbar = gtk_header_bar_new ();
gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar), "Paint");
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
colorbutton = gtk_color_button_new ();
g_signal_connect (colorbutton, "color-set",
G_CALLBACK (color_button_color_set), draw_area);
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (colorbutton),
&(GdkRGBA) { 0, 0, 0, 1 });
gtk_header_bar_pack_end (GTK_HEADER_BAR (headerbar), colorbutton);
gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
}
if (!gtk_widget_get_visible (window))
gtk_widget_show_all (window);
else
gtk_widget_destroy (window);
return window;
}
+4
View File
@@ -301,6 +301,9 @@
<chapter id="Gestures">
<title>Gestures and event handling</title>
<xi:include href="xml/gtkeventcontroller.xml" />
<xi:include href="xml/gtkeventcontrollerkey.xml" />
<xi:include href="xml/gtkeventcontrollerscroll.xml" />
<xi:include href="xml/gtkeventcontrollermotion.xml" />
<xi:include href="xml/gtkgesture.xml" />
<xi:include href="xml/gtkgesturesingle.xml" />
<xi:include href="xml/gtkgesturedrag.xml" />
@@ -310,6 +313,7 @@
<xi:include href="xml/gtkgestureswipe.xml" />
<xi:include href="xml/gtkgesturerotate.xml" />
<xi:include href="xml/gtkgesturezoom.xml" />
<xi:include href="xml/gtkgesturestylus.xml" />
<xi:include href="xml/gtkpadcontroller.xml" />
</chapter>
+81
View File
@@ -8266,6 +8266,63 @@ GtkEventControllerPriv
gtk_event_controller_get_type
</SECTION>
<SECTION>
<FILE>gtkeventcontrollerscroll</FILE>
<TITLE>GtkEventControllerScroll</TITLE>
GtkEventControllerScroll
GtkEventControllerScrollFlags
gtk_event_controller_scroll_new
gtk_event_controller_scroll_set_flags
gtk_event_controller_scroll_get_flags
<SUBSECTION Standard>
GTK_TYPE_EVENT_CONTROLLER_SCROLL
GTK_EVENT_CONTROLLER_SCROLL
GTK_EVENT_CONTROLLER_SCROLL_CLASS
GTK_IS_EVENT_CONTROLLER_SCROLL
GTK_IS_EVENT_CONTROLLER_SCROLL_CLASS
GTK_EVENT_CONTROLLER_SCROLL_GET_CLASS
<SUBSECTION Private>
gtk_event_controller_scroll_get_type
</SECTION>
<SECTION>
<FILE>gtkeventcontrollermotion</FILE>
<TITLE>GtkEventControllerMotion</TITLE>
GtkEventControllerMotion
gtk_event_controller_motion_new
<SUBSECTION Standard>
GTK_TYPE_EVENT_CONTROLLER_MOTION
GTK_EVENT_CONTROLLER_MOTION
GTK_EVENT_CONTROLLER_MOTION_CLASS
GTK_IS_EVENT_CONTROLLER_MOTION
GTK_IS_EVENT_CONTROLLER_MOTION_CLASS
GTK_EVENT_CONTROLLER_MOTION_GET_CLASS
<SUBSECTION Private>
gtk_event_controller_motion_get_type
</SECTION>
<SECTION>
<FILE>gtkeventcontrollerkey</FILE>
<TITLE>GtkEventControllerKey</TITLE>
GtkEventControllerKey
gtk_event_controller_key_new
<SUBSECTION Standard>
GTK_TYPE_EVENT_CONTROLLER_KEY
GTK_EVENT_CONTROLLER_KEY
GTK_EVENT_CONTROLLER_KEY_CLASS
GTK_IS_EVENT_CONTROLLER_KEY
GTK_IS_EVENT_CONTROLLER_KEY_CLASS
GTK_EVENT_CONTROLLER_KEY_GET_CLASS
<SUBSECTION Private>
gtk_event_controller_key_get_type
</SECTION>
<SECTION>
<FILE>gtkgesture</FILE>
<TITLE>GtkGesture</TITLE>
@@ -8490,6 +8547,30 @@ GTK_PAD_CONTROLLER_GET_CLASS
gtk_pad_controller_get_type
</SECTION>
<SECTION>
<FILE>gtkgesturestylus</FILE>
<TITLE>GtkGestureStylus</TITLE>
GtkGestureStylus
gtk_gesture_stylus_new
gtk_gesture_stylus_get_axis
gtk_gesture_stylus_get_axes
gtk_gesture_stylus_get_backlog
gtk_gesture_stylus_get_device_tool
<SUBSECTION Standard>
GTK_TYPE_GESTURE_STYLUS
GTK_GESTURE_STYLUS
GTK_GESTURE_STYLUS_CLASS
GTK_IS_GESTURE_STYLUS
GTK_IS_GESTURE_STYLUS_CLASS
GTK_GESTURE_STYLUS_GET_CLASS
GtkGestureStylusClass
<SUBSECTION Private>
gtk_gesture_stylus_get_type
</SECTION>
<SECTION>
<FILE>gtkstacksidebar</FILE>
GtkStackSidebar
+4
View File
@@ -65,6 +65,9 @@ gtk_entry_completion_get_type
gtk_entry_get_type
gtk_event_box_get_type
gtk_event_controller_get_type
gtk_event_controller_key_get_type
gtk_event_controller_motion_get_type
gtk_event_controller_scroll_get_type
gtk_expander_get_type
gtk_file_chooser_button_get_type
gtk_file_chooser_dialog_get_type
@@ -88,6 +91,7 @@ gtk_gesture_multi_press_get_type
gtk_gesture_pan_get_type
gtk_gesture_rotate_get_type
gtk_gesture_single_get_type
gtk_gesture_stylus_get_type
gtk_gesture_swipe_get_type
gtk_gesture_zoom_get_type
gtk_gl_area_get_type
+12 -1
View File
@@ -22,6 +22,10 @@
#include "gdkinternals.h"
#ifdef GDK_WINDOWING_WIN32
# include "win32/gdkwin32.h"
#endif
#include <epoxy/gl.h>
#include <math.h>
#include <string.h>
@@ -641,6 +645,13 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
{
/* Software fallback */
int major, minor, version;
gboolean es_read_bgra = FALSE;
#ifdef GDK_WINDOWING_WIN32
/* on ANGLE GLES, we need to set the glReadPixel() format as GL_BGRA instead */
if (GDK_WIN32_IS_GL_CONTEXT(paint_context))
es_read_bgra = TRUE;
#endif
gdk_gl_context_get_version (paint_context, &major, &minor);
version = major * 100 + minor;
@@ -683,7 +694,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
cairo_image_surface_get_data (image));
else
glReadPixels (x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE,
glReadPixels (x, y, width, height, es_read_bgra ? GL_BGRA : GL_RGBA, GL_UNSIGNED_BYTE,
cairo_image_surface_get_data (image));
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
+8 -2
View File
@@ -793,11 +793,17 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
has_npot = priv->gl_version >= 20;
has_texture_rectangle = FALSE;
/* This should check for GL_NV_framebuffer_blit - see extension at:
/* This should check for GL_NV_framebuffer_blit as well - see extension at:
*
* https://www.khronos.org/registry/gles/extensions/NV/NV_framebuffer_blit.txt
*
* for ANGLE, we can enable bit blitting if we have the
* GL_ANGLE_framebuffer_blit extension
*/
priv->has_gl_framebuffer_blit = FALSE;
if (epoxy_has_gl_extension ("GL_ANGLE_framebuffer_blit"))
priv->has_gl_framebuffer_blit = TRUE;
else
priv->has_gl_framebuffer_blit = FALSE;
/* No OES version */
priv->has_frame_terminator = FALSE;
+8
View File
@@ -422,6 +422,14 @@
# define GDK_AVAILABLE_IN_3_22 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_24
# define GDK_DEPRECATED_IN_3_24 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_3_24_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_3_24 _GDK_EXTERN
# define GDK_DEPRECATED_IN_3_24_FOR(f) _GDK_EXTERN
#endif
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_24
# define GDK_AVAILABLE_IN_3_24 GDK_UNAVAILABLE(3, 24)
#else
+14
View File
@@ -310,6 +310,9 @@ struct _GdkWaylandDeviceManagerClass
GdkDeviceManagerClass parent_class;
};
static void
pointer_surface_update_scale (GdkDevice *device);
static void deliver_key_event (GdkWaylandSeat *seat,
uint32_t time_,
uint32_t key,
@@ -4501,10 +4504,18 @@ static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = {
tablet_seat_handle_pad_added,
};
static void
on_monitors_changed (GdkScreen *screen,
GdkWaylandSeat *seat)
{
pointer_surface_update_scale (seat->master_pointer);
}
static void
init_devices (GdkWaylandSeat *seat)
{
GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
/* pointer */
seat->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
@@ -4524,6 +4535,9 @@ init_devices (GdkWaylandSeat *seat)
g_list_prepend (device_manager->devices, seat->master_pointer);
g_signal_emit_by_name (device_manager, "device-added", seat->master_pointer);
g_signal_connect (display->screen, "monitors-changed",
G_CALLBACK (on_monitors_changed), seat);
/* keyboard */
seat->master_keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Core Keyboard",
+3
View File
@@ -80,6 +80,9 @@ gboolean gdk_wayland_window_set_transient_for_exported (GdkWindo
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);
G_END_DECLS
#endif /* __GDK_WAYLAND_WINDOW_H__ */
+69 -7
View File
@@ -145,6 +145,7 @@ struct _GdkWindowImplWayland
unsigned int pending_buffer_attached : 1;
unsigned int pending_commit : 1;
unsigned int awaiting_frame : 1;
unsigned int using_csd : 1;
GdkWindowTypeHint hint;
GdkWindow *transient_for;
GdkWindow *popup_parent;
@@ -258,6 +259,7 @@ static void calculate_moved_to_rect_result (GdkWindow *window,
static gboolean gdk_wayland_window_is_exported (GdkWindow *window);
static void gdk_wayland_window_unexport (GdkWindow *window);
static void gdk_wayland_window_announce_decoration_mode (GdkWindow *window);
GType _gdk_window_impl_wayland_get_type (void);
@@ -388,6 +390,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
G_GNUC_END_IGNORE_DEPRECATIONS
impl->using_csd = TRUE;
/* logical 1x1 fake buffer */
impl->staging_cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
impl->scale,
@@ -691,6 +695,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
window->impl = GDK_WINDOW_IMPL (impl);
impl->wrapper = GDK_WINDOW (window);
impl->shortcuts_inhibitors = g_hash_table_new (NULL, NULL);
impl->using_csd = TRUE;
if (window->width > 65535)
{
@@ -2064,19 +2069,68 @@ window_anchor_to_gravity_legacy (GdkGravity rect_anchor)
}
}
void
gdk_wayland_window_announce_csd (GdkWindow *window)
static void
kwin_server_decoration_mode_set (void *data, struct org_kde_kwin_server_decoration *org_kde_kwin_server_decoration, uint32_t mode)
{
GdkWindow *window = GDK_WINDOW (data);
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if ((mode == ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER && impl->using_csd) ||
(mode == ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT && !impl->using_csd))
gdk_wayland_window_announce_decoration_mode (window);
}
static const struct org_kde_kwin_server_decoration_listener kwin_server_decoration_listener = {
kwin_server_decoration_mode_set
};
static void
gdk_wayland_window_announce_decoration_mode (GdkWindow *window)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (!display_wayland->server_decoration_manager)
return;
impl->display_server.server_decoration =
org_kde_kwin_server_decoration_manager_create (display_wayland->server_decoration_manager,
impl->display_server.wl_surface);
if (!impl->display_server.server_decoration)
{
impl->display_server.server_decoration =
org_kde_kwin_server_decoration_manager_create (display_wayland->server_decoration_manager,
impl->display_server.wl_surface);
org_kde_kwin_server_decoration_add_listener (impl->display_server.server_decoration,
&kwin_server_decoration_listener,
window);
}
if (impl->display_server.server_decoration)
org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT);
{
if (impl->using_csd)
org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
ORG_KDE_KWIN_SERVER_DECORATION_MODE_CLIENT);
else
org_kde_kwin_server_decoration_request_mode (impl->display_server.server_decoration,
ORG_KDE_KWIN_SERVER_DECORATION_MODE_SERVER);
}
}
void
gdk_wayland_window_announce_csd (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->using_csd = TRUE;
if (impl->mapped)
gdk_wayland_window_announce_decoration_mode (window);
}
void
gdk_wayland_window_announce_ssd (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->using_csd = FALSE;
if (impl->mapped)
gdk_wayland_window_announce_decoration_mode (window);
}
static GdkWindow *
@@ -2906,11 +2960,13 @@ gdk_wayland_window_map (GdkWindow *window)
else
{
gdk_wayland_window_create_xdg_toplevel (window);
gdk_wayland_window_announce_decoration_mode (window);
}
}
else
{
gdk_wayland_window_create_xdg_toplevel (window);
gdk_wayland_window_announce_decoration_mode (window);
}
impl->mapped = TRUE;
@@ -3074,6 +3130,12 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
impl->application.was_set = FALSE;
}
if (impl->display_server.server_decoration)
{
org_kde_kwin_server_decoration_release (impl->display_server.server_decoration);
impl->display_server.server_decoration = NULL;
}
wl_surface_destroy (impl->display_server.wl_surface);
impl->display_server.wl_surface = NULL;
+4
View File
@@ -17,6 +17,10 @@ AM_CPPFLAGS = \
$(GDK_WIN32_EXTRA_CFLAGS) \
-DGDK_COMPILATION
if WIN32_GLES
AM_CPPFLAGS += "-DGDK_WIN32_ENABLE_EGL=1"
endif #WIN32_GLES
LDADDS = $(GDK_DEP_LIBS)
noinst_LTLIBRARIES = libgdk-win32.la
+12
View File
@@ -31,6 +31,10 @@
#include "gdkmonitor-win32.h"
#include "gdkwin32.h"
#ifdef GDK_WIN32_ENABLE_EGL
# include <epoxy/egl.h>
#endif
static int debug_indent = 0;
static GdkMonitor *
@@ -825,6 +829,14 @@ gdk_win32_display_dispose (GObject *object)
_gdk_screen_close (display_win32->screen);
#ifdef GDK_WIN32_ENABLE_EGL
if (display_win32->egl_disp != EGL_NO_DISPLAY)
{
eglTerminate (display_win32->egl_disp);
display_win32->egl_disp = EGL_NO_DISPLAY;
}
#endif
if (display_win32->hwnd != NULL)
{
DestroyWindow (display_win32->hwnd);
+18
View File
@@ -19,6 +19,10 @@
#include "gdkdisplayprivate.h"
#ifdef GDK_WIN32_ENABLE_EGL
# include <epoxy/egl.h>
#endif
#ifndef __GDK_DISPLAY__WIN32_H__
#define __GDK_DISPLAY__WIN32_H__
@@ -75,6 +79,14 @@ struct _GdkWin32Display
guint gl_version;
HWND gl_hwnd;
#ifdef GDK_WIN32_ENABLE_EGL
/* EGL (Angle) Items */
guint have_egl : 1;
guint egl_version;
EGLDisplay egl_disp;
HDC hdc_egl_temp;
#endif
GPtrArray *monitors;
guint hasWglARBCreateContext : 1;
@@ -83,6 +95,12 @@ struct _GdkWin32Display
guint hasWglARBPixelFormat : 1;
guint hasWglARBmultisample : 1;
#ifdef GDK_WIN32_ENABLE_EGL
guint hasEglKHRCreateContext : 1;
guint hasEglSurfacelessContext : 1;
EGLint egl_min_swap_interval;
#endif
/* HiDPI Items */
guint have_at_least_win81 : 1;
GdkWin32ProcessDpiAwareness dpi_aware_type;
+6
View File
@@ -51,6 +51,7 @@
#include "gdkmonitorprivate.h"
#include "gdkwin32.h"
#include "gdkkeysyms.h"
#include "gdkglcontext-win32.h"
#include "gdkdevicemanager-win32.h"
#include "gdkdeviceprivate.h"
#include "gdkdevice-wintab.h"
@@ -3248,6 +3249,9 @@ gdk_event_translate (MSG *msg,
case SC_MINIMIZE:
case SC_RESTORE:
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
if (msg->wParam == SC_RESTORE)
_gdk_win32_window_invalidate_egl_framebuffer (window);
break;
case SC_MAXIMIZE:
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
@@ -3337,6 +3341,8 @@ gdk_event_translate (MSG *msg,
{
MINMAXINFO our_mmi;
_gdk_win32_window_invalidate_egl_framebuffer (window);
if (_gdk_win32_window_fill_min_max_info (window, &our_mmi))
{
windowpos = (WINDOWPOS *) msg->lParam;
+594 -142
View File
@@ -41,6 +41,10 @@
#include <cairo.h>
#include <epoxy/wgl.h>
#ifdef GDK_WIN32_ENABLE_EGL
# include <epoxy/egl.h>
#endif
G_DEFINE_TYPE (GdkWin32GLContext, gdk_win32_gl_context, GDK_TYPE_GL_CONTEXT)
static void
@@ -50,6 +54,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (gobject);
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context));
GdkWindow *window = gdk_gl_context_get_window (context);
GdkWindowImplWin32 *impl = NULL;
if (context_win32->hglrc != NULL)
{
@@ -64,9 +69,28 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
ReleaseDC (display_win32->gl_hwnd, context_win32->gl_hdc);
}
#ifdef GDK_WIN32_ENABLE_EGL
if (context_win32->egl_context != EGL_NO_CONTEXT)
{
if (eglGetCurrentContext () == context_win32->egl_context)
eglMakeCurrent(display_win32->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
GDK_NOTE (OPENGL, g_message ("Destroying EGL (ANGLE) context"));
eglDestroyContext (display_win32->egl_disp,
context_win32->egl_context);
context_win32->egl_context = EGL_NO_CONTEXT;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
ReleaseDC (display_win32->gl_hwnd, context_win32->gl_hdc);
}
#endif
if (window != NULL && window->impl != NULL)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->suppress_layered > 0)
impl->suppress_layered--;
@@ -117,6 +141,35 @@ gdk_gl_blit_region (GdkWindow *window, cairo_region_t *region)
}
}
static gboolean
_get_is_egl_force_redraw (GdkWindow *window)
{
/* We only need to call gdk_window_invalidate_rect () if necessary */
#ifdef GDK_WIN32_ENABLE_EGL
if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
return impl->egl_force_redraw_all;
}
#endif
return FALSE;
}
static void
_reset_egl_force_redraw (GdkWindow *window)
{
#ifdef GDK_WIN32_ENABLE_EGL
if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->egl_force_redraw_all)
impl->egl_force_redraw_all = FALSE;
}
#endif
}
void
_gdk_win32_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
@@ -126,11 +179,12 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
GdkWindow *window = gdk_gl_context_get_window (context);
GdkWin32Display *display = (GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context)));
gboolean can_wait = display->hasWglOMLSyncControl;
gdk_gl_context_make_current (context);
if (context_win32->do_frame_sync)
if (!gdk_gl_context_get_use_es (context))
{
gboolean can_wait = display->hasWglOMLSyncControl;
if (context_win32->do_frame_sync)
{
glFinish ();
@@ -147,21 +201,44 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
&ust, &msc, &sbc);
}
}
if (context_win32->do_blit_swap)
{
glDrawBuffer(GL_FRONT);
glReadBuffer(GL_BACK);
gdk_gl_blit_region (window, painted);
glDrawBuffer(GL_BACK);
glFlush();
if (gdk_gl_context_has_frame_terminator (context))
glFrameTerminatorGREMEDY ();
}
else
SwapBuffers (context_win32->gl_hdc);
}
if (context_win32->do_blit_swap)
{
glDrawBuffer(GL_FRONT);
glReadBuffer(GL_BACK);
gdk_gl_blit_region (window, painted);
glDrawBuffer(GL_BACK);
glFlush();
if (gdk_gl_context_has_frame_terminator (context))
glFrameTerminatorGREMEDY ();
}
#ifdef GDK_WIN32_ENABLE_EGL
else
SwapBuffers (context_win32->gl_hdc);
{
EGLSurface egl_surface = _gdk_win32_window_get_egl_surface (window, context_win32->egl_config, FALSE);
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);
else if (force_egl_redraw_all)
{
GdkRectangle rect = {0, 0, gdk_window_get_width (window), gdk_window_get_height (window)};
/* We need to do gdk_window_invalidate_rect() so that we don't get glitches after maximizing or
* restoring or using aerosnap
*/
gdk_window_invalidate_rect (window, &rect, TRUE);
_reset_egl_force_redraw (window);
}
eglSwapBuffers (display->egl_disp, egl_surface);
}
#endif
}
void
@@ -453,64 +530,152 @@ _gdk_init_dummy_context (GdkWGLDummy *dummy,
return best_idx;
}
#ifdef GDK_WIN32_ENABLE_EGL
#ifndef EGL_PLATFORM_ANGLE_ANGLE
#define EGL_PLATFORM_ANGLE_ANGLE 0x3202
#endif
#ifndef EGL_PLATFORM_ANGLE_TYPE_ANGLE
#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203
#endif
#ifndef EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
#endif
static EGLDisplay
_gdk_win32_get_egl_display (GdkWin32Display *display)
{
EGLDisplay disp;
gboolean success = FALSE;
if (epoxy_has_egl_extension (NULL, "EGL_EXT_platform_base"))
{
PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplay = (void *) eglGetProcAddress ("eglGetPlatformDisplayEXT");
if (getPlatformDisplay)
{
EGLint disp_attr[] = {EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_NONE};
disp = getPlatformDisplay (EGL_PLATFORM_ANGLE_ANGLE, display->hdc_egl_temp, disp_attr);
if (disp != EGL_NO_DISPLAY)
return disp;
}
}
return eglGetDisplay (display->hdc_egl_temp);
}
#endif
static gboolean
_gdk_win32_display_init_gl (GdkDisplay *display,
const gboolean need_alpha_bits)
{
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
gint best_idx = 0;
GdkWGLDummy dummy;
gboolean disable_wgl = FALSE;
if (display_win32->have_wgl)
#ifdef GDK_WIN32_ENABLE_EGL
EGLDisplay egl_disp;
disable_wgl = (_gdk_gl_flags & GDK_GL_GLES) != 0;
#endif
if (display_win32->have_wgl
#ifdef GDK_WIN32_ENABLE_EGL
|| display_win32->have_egl
#endif
)
return TRUE;
memset (&dummy, 0, sizeof (GdkWGLDummy));
if (!disable_wgl)
{
/* acquire and cache dummy Window (HWND & HDC) and
* dummy GL Context, it is used to query functions
* and used for other stuff as well
*/
GdkWGLDummy dummy;
memset (&dummy, 0, sizeof (GdkWGLDummy));
/* acquire and cache dummy Window (HWND & HDC) and
* dummy GL Context, it is used to query functions
* and used for other stuff as well
*/
best_idx = _gdk_init_dummy_context (&dummy, need_alpha_bits);
best_idx = _gdk_init_dummy_context (&dummy, need_alpha_bits);
if (best_idx == 0 || !wglMakeCurrent (dummy.hdc, dummy.hglrc))
return FALSE;
if (best_idx == 0 || !wglMakeCurrent (dummy.hdc, dummy.hglrc))
return FALSE;
display_win32->have_wgl = TRUE;
display_win32->gl_version = epoxy_gl_version ();
display_win32->have_wgl = TRUE;
display_win32->gl_version = epoxy_gl_version ();
display_win32->hasWglARBCreateContext =
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_create_context");
display_win32->hasWglEXTSwapControl =
epoxy_has_wgl_extension (dummy.hdc, "WGL_EXT_swap_control");
display_win32->hasWglOMLSyncControl =
epoxy_has_wgl_extension (dummy.hdc, "WGL_OML_sync_control");
display_win32->hasWglARBPixelFormat =
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_pixel_format");
display_win32->hasWglARBmultisample =
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_multisample");
GDK_NOTE (OPENGL,
g_print ("WGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Checked extensions:\n"
"\t* WGL_ARB_pixel_format: %s\n"
"\t* WGL_ARB_create_context: %s\n"
"\t* WGL_EXT_swap_control: %s\n"
"\t* WGL_OML_sync_control: %s\n"
"\t* WGL_ARB_multisample: %s\n",
display_win32->gl_version / 10,
display_win32->gl_version % 10,
glGetString (GL_VENDOR),
display_win32->hasWglARBPixelFormat ? "yes" : "no",
display_win32->hasWglARBCreateContext ? "yes" : "no",
display_win32->hasWglEXTSwapControl ? "yes" : "no",
display_win32->hasWglOMLSyncControl ? "yes" : "no",
display_win32->hasWglARBmultisample ? "yes" : "no"));
wglMakeCurrent (NULL, NULL);
_destroy_dummy_gl_context (dummy);
return TRUE;
}
#ifdef GDK_WIN32_ENABLE_EGL
egl_disp = _gdk_win32_get_egl_display (display_win32);
if (egl_disp == EGL_NO_DISPLAY ||
!eglInitialize (egl_disp, NULL, NULL))
{
if (egl_disp != EGL_NO_DISPLAY)
{
eglTerminate (egl_disp);
egl_disp = EGL_NO_DISPLAY;
}
return FALSE;
}
display_win32->egl_disp = egl_disp;
display_win32->have_egl = TRUE;
display_win32->egl_version = epoxy_egl_version (egl_disp);
eglBindAPI(EGL_OPENGL_ES_API);
display_win32->hasEglSurfacelessContext =
epoxy_has_egl_extension (egl_disp, "EGL_KHR_surfaceless_context");
display_win32->hasWglARBCreateContext =
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_create_context");
display_win32->hasWglEXTSwapControl =
epoxy_has_wgl_extension (dummy.hdc, "WGL_EXT_swap_control");
display_win32->hasWglOMLSyncControl =
epoxy_has_wgl_extension (dummy.hdc, "WGL_OML_sync_control");
display_win32->hasWglARBPixelFormat =
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_pixel_format");
display_win32->hasWglARBmultisample =
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_multisample");
GDK_NOTE (OPENGL,
g_print ("WGL API version %d.%d found\n"
g_print ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Checked extensions:\n"
"\t* WGL_ARB_pixel_format: %s\n"
"\t* WGL_ARB_create_context: %s\n"
"\t* WGL_EXT_swap_control: %s\n"
"\t* WGL_OML_sync_control: %s\n"
"\t* WGL_ARB_multisample: %s\n",
display_win32->gl_version / 10,
display_win32->gl_version % 10,
glGetString (GL_VENDOR),
display_win32->hasWglARBPixelFormat ? "yes" : "no",
display_win32->hasWglARBCreateContext ? "yes" : "no",
display_win32->hasWglEXTSwapControl ? "yes" : "no",
display_win32->hasWglOMLSyncControl ? "yes" : "no",
display_win32->hasWglARBmultisample ? "yes" : "no"));
wglMakeCurrent (NULL, NULL);
_destroy_dummy_gl_context (dummy);
"\t* EGL_KHR_surfaceless_context: %s\n",
display_win32->egl_version / 10,
display_win32->egl_version % 10,
eglQueryString (display_win32->egl_disp, EGL_VENDOR),
display_win32->hasEglSurfacelessContext ? "yes" : "no"));
return TRUE;
#endif
}
/* Setup the legacy context after creating it */
@@ -688,6 +853,132 @@ _set_pixformat_for_hdc (HDC hdc,
return TRUE;
}
#ifdef GDK_WIN32_ENABLE_EGL
#define MAX_EGL_ATTRS 30
static gboolean
find_eglconfig_for_window (GdkWin32Display *display,
EGLConfig *egl_config_out,
EGLint *min_swap_interval_out,
gboolean need_alpha_bits,
GError **error)
{
EGLint attrs[MAX_EGL_ATTRS];
EGLint count;
EGLConfig *configs, chosen_config;
int i = 0;
EGLDisplay egl_disp = display->egl_disp;
attrs[i++] = EGL_CONFORMANT;
attrs[i++] = EGL_OPENGL_ES2_BIT;
attrs[i++] = EGL_SURFACE_TYPE;
attrs[i++] = EGL_WINDOW_BIT;
attrs[i++] = EGL_COLOR_BUFFER_TYPE;
attrs[i++] = EGL_RGB_BUFFER;
attrs[i++] = EGL_RED_SIZE;
attrs[i++] = 1;
attrs[i++] = EGL_GREEN_SIZE;
attrs[i++] = 1;
attrs[i++] = EGL_BLUE_SIZE;
attrs[i++] = 1;
if (need_alpha_bits)
{
attrs[i++] = EGL_ALPHA_SIZE;
attrs[i++] = 1;
}
else
{
attrs[i++] = EGL_ALPHA_SIZE;
attrs[i++] = EGL_DONT_CARE;
}
attrs[i++] = EGL_NONE;
g_assert (i < MAX_EGL_ATTRS);
if (!eglChooseConfig (display->egl_disp, attrs, NULL, 0, &count) || count < 1)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
_("No available configurations for the given pixel format"));
return FALSE;
}
configs = g_new (EGLConfig, count);
if (!eglChooseConfig (display->egl_disp, attrs, configs, count, &count) || count < 1)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
_("No available configurations for the given pixel format"));
return FALSE;
}
/* Pick first valid configuration i guess? */
chosen_config = configs[0];
if (!eglGetConfigAttrib (display->egl_disp, chosen_config,
EGL_MIN_SWAP_INTERVAL, min_swap_interval_out))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
"Could not retrieve the minimum swap interval");
g_free (configs);
return FALSE;
}
if (egl_config_out != NULL)
*egl_config_out = chosen_config;
g_free (configs);
return TRUE;
}
#define N_EGL_ATTRS 16
static EGLContext
_create_egl_context (EGLDisplay display,
EGLConfig config,
GdkGLContext *share,
int flags,
int major,
int minor,
gboolean *is_legacy)
{
EGLContext ctx;
EGLint context_attribs[N_EGL_ATTRS];
int i = 0;
/* ANGLE does not support the GL_OES_vertex_array_object extension, so we need to use ES3 directly */
context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
context_attribs[i++] = 3;
/* Specify the flags */
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
context_attribs[i++] = flags;
context_attribs[i++] = EGL_NONE;
g_assert (i < N_EGL_ATTRS);
ctx = eglCreateContext (display,
config,
share != NULL ? GDK_WIN32_GL_CONTEXT (share)->egl_context
: EGL_NO_CONTEXT,
context_attribs);
if (ctx != EGL_NO_CONTEXT)
GDK_NOTE (OPENGL, g_message ("Created EGL context[%p]", ctx));
return ctx;
}
#endif /* GDK_WIN32_ENABLE_EGL */
gboolean
_gdk_win32_gl_context_realize (GdkGLContext *context,
GError **error)
@@ -695,83 +986,143 @@ _gdk_win32_gl_context_realize (GdkGLContext *context,
GdkGLContext *share = gdk_gl_context_get_shared_context (context);
GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context);
/* These are the real WGL/EGL context items that we will want to use later */
gboolean debug_bit, compat_bit, legacy_bit;
/* These are the real WGL context items that we will want to use later */
HGLRC hglrc;
gint pixel_format;
gboolean debug_bit, compat_bit, legacy_bit;
gboolean use_es = FALSE;
/* request flags and specific versions for core (3.2+) WGL context */
gint flags = 0;
gint glver_major = 0;
gint glver_minor = 0;
gint major = 0;
gint minor = 0;
#ifdef GDK_WIN32_ENABLE_EGL
EGLContext egl_context;
#endif
GdkWindow *window = gdk_gl_context_get_window (context);
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
if (!_set_pixformat_for_hdc (context_win32->gl_hdc,
&pixel_format,
context_win32->need_alpha_bits,
win32_display))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
_("No available configurations for the given pixel format"));
return FALSE;
}
gdk_gl_context_get_required_version (context, &glver_major, &glver_minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
compat_bit = gdk_gl_context_get_forward_compatible (context);
/* if there isn't wglCreateContextAttribsARB(), or if GDK_GL_LEGACY is set, we default to a legacy context */
legacy_bit = !win32_display->hasWglARBCreateContext ||
g_getenv ("GDK_GL_LEGACY") != NULL;
/*
* A legacy context cannot be shared with core profile ones, so this means we
* must stick to a legacy context if the shared context is a legacy context
*/
if (share != NULL && gdk_gl_context_is_legacy (share))
if ((_gdk_gl_flags & GDK_GL_LEGACY) != 0 ||
share != NULL && gdk_gl_context_is_legacy (share))
legacy_bit = TRUE;
if (debug_bit)
flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
if (compat_bit)
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
if ((_gdk_gl_flags & GDK_GL_GLES) != 0 ||
(share != NULL && gdk_gl_context_get_use_es (share)))
use_es = TRUE;
GDK_NOTE (OPENGL,
g_print ("Creating %s WGL context (version:%d.%d, debug:%s, forward:%s, legacy: %s)\n",
compat_bit ? "core" : "compat",
glver_major,
glver_minor,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy_bit ? "yes" : "no"));
gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
compat_bit = gdk_gl_context_get_forward_compatible (context);
hglrc = _create_gl_context (context_win32->gl_hdc,
share,
flags,
glver_major,
glver_minor,
&legacy_bit,
win32_display->hasWglARBCreateContext);
if (hglrc == NULL)
if (win32_display->have_wgl)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return FALSE;
if (!_set_pixformat_for_hdc (context_win32->gl_hdc,
&pixel_format,
context_win32->need_alpha_bits,
win32_display))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_FORMAT,
_("No available configurations for the given pixel format"));
return FALSE;
}
/* if there isn't wglCreateContextAttribsARB(), or if GDK_GL_LEGACY is set, we default to a legacy context */
legacy_bit = !win32_display->hasWglARBCreateContext ||
g_getenv ("GDK_GL_LEGACY") != NULL;
if (debug_bit)
flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
if (compat_bit)
flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
GDK_NOTE (OPENGL,
g_print ("Creating %s WGL context (version:%d.%d, debug:%s, forward:%s, legacy: %s)\n",
compat_bit ? "core" : "compat",
major,
minor,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy_bit ? "yes" : "no"));
hglrc = _create_gl_context (context_win32->gl_hdc,
share,
flags,
major,
minor,
&legacy_bit,
win32_display->hasWglARBCreateContext);
if (hglrc == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return FALSE;
}
GDK_NOTE (OPENGL,
g_print ("Created WGL context[%p], pixel_format=%d\n",
hglrc,
pixel_format));
context_win32->hglrc = hglrc;
}
GDK_NOTE (OPENGL,
g_print ("Created WGL context[%p], pixel_format=%d\n",
hglrc,
pixel_format));
#ifdef GDK_WIN32_ENABLE_EGL
if (win32_display->have_egl)
{
EGLContext ctx;
context_win32->hglrc = hglrc;
if (debug_bit)
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
if (compat_bit)
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
GDK_NOTE (OPENGL, g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s)",
major, minor,
debug_bit ? "yes" : "no",
compat_bit ? "yes" : "no",
legacy_bit ? "yes" : "no"));
ctx = _create_egl_context (win32_display->egl_disp,
context_win32->egl_config,
share,
flags,
major,
minor,
&legacy_bit);
if (ctx == EGL_NO_CONTEXT)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("Unable to create a GL context"));
return FALSE;
}
GDK_NOTE (OPENGL,
g_print ("Created EGL context[%p]\n",
ctx));
context_win32->egl_context = ctx;
use_es = TRUE;
}
#endif
/* set whether we are using GLES */
gdk_gl_context_set_use_es(context, use_es);
/* OpenGL does not work with WS_EX_LAYERED enabled, so we need to
* disable WS_EX_LAYERED when we acquire a valid HGLRC
@@ -804,9 +1155,21 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
gboolean need_alpha_bits = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
/* Acquire and store up the Windows-specific HWND and HDC */
HWND hwnd;
HDC hdc;
#ifdef GDK_WIN32_ENABLE_EGL
EGLContext egl_context;
EGLConfig config;
#endif
display_win32->gl_hwnd = GDK_WINDOW_HWND (window);
hdc = GetDC (display_win32->gl_hwnd);
#ifdef GDK_WIN32_ENABLE_EGL
/* display_win32->hdc_egl_temp should *not* be destroyed here! It is destroyed at dispose()! */
display_win32->hdc_egl_temp = hdc;
#endif
if (!_gdk_win32_display_init_gl (display, need_alpha_bits))
{
g_set_error_literal (error, GDK_GL_ERROR,
@@ -815,10 +1178,12 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
return NULL;
}
hwnd = GDK_WINDOW_HWND (window);
hdc = GetDC (hwnd);
display_win32->gl_hwnd = hwnd;
#ifdef GDK_WIN32_ENABLE_EGL
if (display_win32->have_egl && !find_eglconfig_for_window (display_win32, &config,
&display_win32->egl_min_swap_interval, need_alpha_bits,
error))
return NULL;
#endif
context = g_object_new (GDK_TYPE_WIN32_GL_CONTEXT,
"display", display,
@@ -828,6 +1193,12 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
context->need_alpha_bits = need_alpha_bits;
context->gl_hdc = hdc;
#ifdef GDK_WIN32_ENABLE_EGL
if (display_win32->have_egl)
context->egl_config = config;
#endif
context->is_attached = attached;
return GDK_GL_CONTEXT (context);
@@ -842,45 +1213,89 @@ _gdk_win32_display_make_gl_context_current (GdkDisplay *display,
GdkWindow *window;
GdkScreen *screen;
#if GDK_WIN32_ENABLE_EGL
EGLSurface egl_surface;
#endif
gboolean do_frame_sync = FALSE;
if (context == NULL)
{
wglMakeCurrent(NULL, NULL);
if (display_win32->have_wgl)
wglMakeCurrent(NULL, NULL);
#ifdef GDK_WIN32_ENABLE_EGL
else if (display_win32->have_egl)
eglMakeCurrent (display_win32->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
#endif
return TRUE;
}
context_win32 = GDK_WIN32_GL_CONTEXT (context);
window = gdk_gl_context_get_window (context);
if (!wglMakeCurrent (context_win32->gl_hdc, context_win32->hglrc))
if (!gdk_gl_context_get_use_es (context))
{
GDK_NOTE (OPENGL,
g_print ("Making WGL context current failed\n"));
return FALSE;
}
if (context_win32->is_attached && display_win32->hasWglEXTSwapControl)
{
window = gdk_gl_context_get_window (context);
/* If there is compositing there is no particular need to delay
* the swap when drawing on the offscreen, rendering to the screen
* happens later anyway, and its up to the compositor to sync that
* to the vblank. */
screen = gdk_window_get_screen (window);
do_frame_sync = ! gdk_screen_is_composited (screen);
if (do_frame_sync != context_win32->do_frame_sync)
if (!wglMakeCurrent (context_win32->gl_hdc, context_win32->hglrc))
{
context_win32->do_frame_sync = do_frame_sync;
GDK_NOTE (OPENGL,
g_print ("Making WGL context current failed\n"));
return FALSE;
}
if (do_frame_sync)
wglSwapIntervalEXT (1);
else
wglSwapIntervalEXT (0);
if (context_win32->is_attached)
{
if (display_win32->hasWglEXTSwapControl)
{
/* If there is compositing there is no particular need to delay
* the swap when drawing on the offscreen, rendering to the screen
* happens later anyway, and its up to the compositor to sync that
* to the vblank. */
screen = gdk_window_get_screen (window);
do_frame_sync = ! gdk_screen_is_composited (screen);
if (do_frame_sync != context_win32->do_frame_sync)
{
context_win32->do_frame_sync = do_frame_sync;
if (do_frame_sync)
wglSwapIntervalEXT (1);
else
wglSwapIntervalEXT (0);
}
}
}
}
#ifdef GDK_WIN32_ENABLE_EGL
else
{
if (context_win32->is_attached)
egl_surface = _gdk_win32_window_get_egl_surface (window, context_win32->egl_config, FALSE);
else
{
if (display_win32->hasEglSurfacelessContext)
egl_surface = EGL_NO_SURFACE;
else
egl_surface = _gdk_win32_window_get_egl_surface (window, context_win32->egl_config, TRUE);
}
if (!eglMakeCurrent (display_win32->egl_disp,
egl_surface,
egl_surface,
context_win32->egl_context))
{
g_warning ("eglMakeCurrent failed");
return FALSE;
}
if (display_win32->egl_min_swap_interval == 0)
eglSwapInterval (display_win32->egl_disp, 0);
else
g_debug ("Can't disable GL swap interval");
}
#endif
return TRUE;
}
@@ -901,18 +1316,55 @@ gdk_win32_display_get_wgl_version (GdkDisplay *display,
gint *major,
gint *minor)
{
GdkWin32Display *display_win32 = NULL;
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
if (!GDK_IS_WIN32_DISPLAY (display))
return FALSE;
if (!_gdk_win32_display_init_gl (display, FALSE))
display_win32 = GDK_WIN32_DISPLAY (display);
if (!_gdk_win32_display_init_gl (display, FALSE) || !display_win32->have_wgl
#ifdef GDK_WIN32_ENABLE_EGL
|| !display_win32->have_egl
#endif
)
return FALSE;
if (major != NULL)
*major = GDK_WIN32_DISPLAY (display)->gl_version / 10;
if (minor != NULL)
*minor = GDK_WIN32_DISPLAY (display)->gl_version % 10;
if (display_win32->have_wgl)
{
if (major != NULL)
*major = GDK_WIN32_DISPLAY (display)->gl_version / 10;
if (minor != NULL)
*minor = GDK_WIN32_DISPLAY (display)->gl_version % 10;
}
#ifdef GDK_WIN32_ENABLE_EGL
else if (display_win32->have_egl)
{
if (major != NULL)
*major = GDK_WIN32_DISPLAY (display)->egl_version / 10;
if (minor != NULL)
*minor = GDK_WIN32_DISPLAY (display)->egl_version % 10;
}
#endif
return TRUE;
}
void
_gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window)
{
/* If we are using ANGLE, we need to force redraw of the whole Window and its child windows
* as we need to re-acquire the EGL surfaces that we rendered to upload to Cairo explicitly,
* using gdk_window_invalidate_rect (), when we maximize or restore or use aerosnap
*/
#ifdef GDK_WIN32_ENABLE_EGL
if (window->gl_paint_context != NULL && gdk_gl_context_get_use_es (window->gl_paint_context))
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
impl->egl_force_redraw_all = TRUE;
}
#endif
}
+13
View File
@@ -24,6 +24,10 @@
#include <epoxy/gl.h>
#include <epoxy/wgl.h>
#ifdef GDK_WIN32_ENABLE_EGL
# include <epoxy/egl.h>
#endif
#include "gdkglcontextprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkvisual.h"
@@ -46,6 +50,12 @@ struct _GdkWin32GLContext
guint is_attached : 1;
guint do_frame_sync : 1;
guint do_blit_swap : 1;
#ifdef GDK_WIN32_ENABLE_EGL
/* EGL (Angle) Context Items */
EGLContext egl_context;
EGLConfig egl_config;
#endif
};
struct _GdkWin32GLContextClass
@@ -76,6 +86,9 @@ gboolean
_gdk_win32_gl_context_realize (GdkGLContext *context,
GError **error);
void
_gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
G_END_DECLS
#endif /* __GDK_WIN32_GL_CONTEXT__ */
+56
View File
@@ -1074,6 +1074,7 @@ gdk_win32_window_destroy (GdkWindow *window,
{
GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
GSList *tmp;
GdkWin32Display *display = NULL;
g_return_if_fail (GDK_IS_WINDOW (window));
@@ -1096,6 +1097,22 @@ gdk_win32_window_destroy (GdkWindow *window,
g_slist_free (window_impl->transient_children);
window_impl->transient_children = NULL;
#ifdef GDK_WIN32_ENABLE_EGL
display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
/* Get rid of any EGLSurfaces that we might have created */
if (window_impl->egl_surface != EGL_NO_SURFACE)
{
eglDestroySurface (display->egl_disp, window_impl->egl_surface);
window_impl->egl_surface = EGL_NO_SURFACE;
}
if (window_impl->egl_dummy_surface != EGL_NO_SURFACE)
{
eglDestroySurface (display->egl_disp, window_impl->egl_dummy_surface);
window_impl->egl_dummy_surface = EGL_NO_SURFACE;
}
#endif
/* Remove ourself from our transient owner */
if (window_impl->transient_owner != NULL)
{
@@ -1695,6 +1712,7 @@ gdk_win32_window_move_resize (GdkWindow *window,
}
else
{
_gdk_win32_window_invalidate_egl_framebuffer (window);
if (with_move)
{
gdk_win32_window_move_resize_internal (window, x, y, width, height);
@@ -4759,6 +4777,9 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window)
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
GdkW32DragMoveResizeContext *context = &impl->drag_move_resize_context;
if (context->op == GDK_WIN32_DRAGOP_RESIZE)
_gdk_win32_window_invalidate_egl_framebuffer (window);
context->op = GDK_WIN32_DRAGOP_NONE;
gdk_device_ungrab (context->device, GDK_CURRENT_TIME);
@@ -5278,6 +5299,8 @@ gdk_win32_window_unmaximize (GdkWindow *window)
GDK_WINDOW_HWND (window),
_gdk_win32_window_state_to_string (window->state)));
_gdk_win32_window_invalidate_egl_framebuffer (window);
if (GDK_WINDOW_IS_MAPPED (window))
GtkShowWindow (window, SW_RESTORE);
else
@@ -6017,6 +6040,7 @@ GtkShowWindow (GdkWindow *window,
case SW_SHOWNA:
case SW_SHOWNOACTIVATE:
case SW_SHOWNORMAL:
if (IsWindowVisible (hwnd))
break;
@@ -6276,3 +6300,35 @@ gdk_win32_window_get_handle (GdkWindow *window)
return GDK_WINDOW_HWND (window);
}
#ifdef GDK_WIN32_ENABLE_EGL
EGLSurface
_gdk_win32_window_get_egl_surface (GdkWindow *window,
EGLConfig config,
gboolean is_dummy)
{
EGLSurface surface;
GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (is_dummy)
{
if (impl->egl_dummy_surface == EGL_NO_SURFACE)
{
EGLint attribs[] = {EGL_WIDTH, 1, EGL_WIDTH, 1, EGL_NONE};
impl->egl_dummy_surface = eglCreatePbufferSurface (display->egl_disp,
config,
attribs);
}
return impl->egl_dummy_surface;
}
else
{
if (impl->egl_surface == EGL_NO_SURFACE)
impl->egl_surface = eglCreateWindowSurface (display->egl_disp, config, display->gl_hwnd, NULL);
return impl->egl_surface;
}
}
#endif
+16
View File
@@ -31,6 +31,10 @@
#include <windows.h>
#ifdef GDK_WIN32_ENABLE_EGL
#include <epoxy/egl.h>
#endif
G_BEGIN_DECLS
/* Window implementation for Win32
@@ -352,6 +356,12 @@ struct _GdkWindowImplWin32
gint window_scale;
gint unscaled_width;
gint unscaled_height;
#ifdef GDK_WIN32_ENABLE_EGL
EGLSurface egl_surface;
EGLSurface egl_dummy_surface;
guint egl_force_redraw_all : 1;
#endif
};
struct _GdkWindowImplWin32Class
@@ -373,6 +383,12 @@ void _gdk_win32_window_update_style_bits (GdkWindow *window);
gint _gdk_win32_window_get_scale_factor (GdkWindow *window);
#ifdef GDK_WIN32_ENABLE_EGL
EGLSurface _gdk_win32_window_get_egl_surface (GdkWindow *window,
EGLConfig config,
gboolean is_dummy);
#endif
G_END_DECLS
#endif /* __GDK_WINDOW_WIN32_H__ */
+16 -9
View File
@@ -192,6 +192,9 @@ gtk_public_h_sources = \
gtkenums.h \
gtkeventbox.h \
gtkeventcontroller.h \
gtkeventcontrollerkey.h \
gtkeventcontrollermotion.h \
gtkeventcontrollerscroll.h \
gtkexpander.h \
gtkfilechooser.h \
gtkfilechooserbutton.h \
@@ -213,6 +216,7 @@ gtk_public_h_sources = \
gtkgesturepan.h \
gtkgesturerotate.h \
gtkgesturesingle.h \
gtkgesturestylus.h \
gtkgestureswipe.h \
gtkgesturezoom.h \
gtkglarea.h \
@@ -491,6 +495,7 @@ gtk_private_h_sources = \
gtkgesturepanprivate.h \
gtkgesturerotateprivate.h \
gtkgesturesingleprivate.h \
gtkgesturestylusprivate.h \
gtkgestureswipeprivate.h \
gtkgesturezoomprivate.h \
gtkheaderbarprivate.h \
@@ -592,7 +597,10 @@ gtk_private_h_sources = \
gtkwin32themeprivate.h \
gtkwindowprivate.h \
gtktreemenu.h \
gdkpixbufutilsprivate.h
gdkpixbufutilsprivate.h \
open-type-layout.h \
language-names.h \
script-names.h
# GTK+ C sources to build the library from
gtk_base_c_sources = \
@@ -754,6 +762,9 @@ gtk_base_c_sources = \
gtkentrycompletion.c \
gtkeventbox.c \
gtkeventcontroller.c \
gtkeventcontrollerkey.c \
gtkeventcontrollermotion.c \
gtkeventcontrollerscroll.c \
gtkexpander.c \
gtkfilechooser.c \
gtkfilechooserbutton.c \
@@ -783,6 +794,7 @@ gtk_base_c_sources = \
gtkgesturepan.c \
gtkgesturerotate.c \
gtkgesturesingle.c \
gtkgesturestylus.c \
gtkgestureswipe.c \
gtkgesturezoom.c \
gtkglarea.c \
@@ -1269,10 +1281,6 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
$(AM_V_GEN) echo "<?xml version='1.0' encoding='UTF-8'?>" > $@; \
echo "<gresources>" >> $@; \
echo " <gresource prefix='/org/gtk/libgtk'>" >> $@; \
for f in $(srcdir)/theme/Raleigh/*.css; do \
n=`basename $$f`; \
echo " <file alias='theme/Raleigh/gtk.css'>theme/Raleigh/$$n</file>" >> $@; \
done; \
echo " <file>theme/Adwaita/gtk.css</file>" >> $@; \
echo " <file>theme/Adwaita/gtk-dark.css</file>" >> $@; \
echo " <file>theme/Adwaita/gtk-contained.css</file>" >> $@; \
@@ -1309,7 +1317,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
done; \
for f in $(srcdir)/ui/*.ui; do \
n=`basename $$f`; \
echo " <file compressed='true'>ui/$$n</file>" >> $@; \
echo " <file preprocess='xml-stripblanks'>ui/$$n</file>" >> $@; \
done; \
for s in 16x16 22x22 24x24 32x32 48x48; do \
for c in actions status; do \
@@ -1322,7 +1330,7 @@ gtk.gresource.xml: Makefile.am inspector/Makefile.inc
done; \
for f in $(srcdir)/inspector/*.ui; do \
n=`basename $$f`; \
echo " <file compressed='true'>inspector/$$n</file>" >> $@; \
echo " <file compressed='true' preprocess='xml-stripblanks'>inspector/$$n</file>" >> $@; \
done; \
echo " <file>inspector/logo.png</file>" >> $@; \
echo " <file>emoji/emoji.data</file>" >> $@; \
@@ -1393,8 +1401,7 @@ theme_sources = \
theme/HighContrast/gtk-contained.css \
theme/HighContrast/gtk-contained-inverse.css \
theme/HighContrast/gtk.css \
theme/HighContrast/gtk-inverse.css \
theme/Raleigh/gtk-default.css
theme/HighContrast/gtk-inverse.css
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(builddir)/gtk.gresource.xml)
+4
View File
@@ -94,6 +94,9 @@
#include <gtk/gtkenums.h>
#include <gtk/gtkeventbox.h>
#include <gtk/gtkeventcontroller.h>
#include <gtk/gtkeventcontrollerkey.h>
#include <gtk/gtkeventcontrollermotion.h>
#include <gtk/gtkeventcontrollerscroll.h>
#include <gtk/gtkexpander.h>
#include <gtk/gtkfixed.h>
#include <gtk/gtkfilechooser.h>
@@ -115,6 +118,7 @@
#include <gtk/gtkgesturepan.h>
#include <gtk/gtkgesturerotate.h>
#include <gtk/gtkgesturesingle.h>
#include <gtk/gtkgesturestylus.h>
#include <gtk/gtkgestureswipe.h>
#include <gtk/gtkgesturezoom.h>
#include <gtk/gtkglarea.h>
+2
View File
@@ -1972,6 +1972,8 @@ gtk_css_provider_load_from_resource (GtkCssProvider *css_provider,
*
* Returns: (transfer none): The provider used for fallback styling.
* This memory is owned by GTK+, and you must not free it.
*
* Deprecated: 3.24: Use gtk_css_provider_new() instead.
**/
GtkCssProvider *
gtk_css_provider_get_default (void)
+1 -1
View File
@@ -112,7 +112,7 @@ GDK_AVAILABLE_IN_3_16
void gtk_css_provider_load_from_resource (GtkCssProvider *css_provider,
const gchar *resource_path);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_FOR(gtk_css_provider_new)
GtkCssProvider * gtk_css_provider_get_default (void);
GDK_AVAILABLE_IN_ALL
+4 -2
View File
@@ -404,7 +404,8 @@ add_emoji (GtkWidget *box,
pango_layout_get_extents (layout, &rect, NULL);
/* Check for fallback rendering that generates too wide items */
if (rect.width >= 2 * chooser->emoji_max_width)
if (pango_layout_get_unknown_glyphs_count (layout) > 0 ||
rect.width >= 1.5 * chooser->emoji_max_width)
{
gtk_widget_destroy (label);
return;
@@ -654,7 +655,8 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser)
/* Get a reasonable maximum width for an emoji. We do this to
* skip overly wide fallback rendering for certain emojis the
* font does not contain and therefore end up being rendered
* as multiply glyphs. */
* as multiply glyphs.
*/
{
PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (chooser), "🙂");
PangoAttrList *attrs;
+271
View File
@@ -0,0 +1,271 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#include "config.h"
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkeventcontrollerprivate.h"
#include "gtkeventcontrollerkey.h"
#include "gtkbindings.h"
#include <gdk/gdk.h>
struct _GtkEventControllerKey
{
GtkEventController parent_instance;
GtkIMContext *im_context;
GHashTable *pressed_keys;
const GdkEvent *current_event;
};
struct _GtkEventControllerKeyClass
{
GtkEventControllerClass parent_class;
};
enum {
KEY_PRESSED,
KEY_RELEASED,
MODIFIERS,
IM_UPDATE,
FOCUS_IN,
FOCUS_OUT,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0 };
G_DEFINE_TYPE (GtkEventControllerKey, gtk_event_controller_key,
GTK_TYPE_EVENT_CONTROLLER)
static void
gtk_event_controller_finalize (GObject *object)
{
GtkEventControllerKey *key = GTK_EVENT_CONTROLLER_KEY (object);
g_hash_table_destroy (key->pressed_keys);
g_clear_object (&key->im_context);
G_OBJECT_CLASS (gtk_event_controller_key_parent_class)->finalize (object);
}
static gboolean
gtk_event_controller_key_handle_event (GtkEventController *controller,
const GdkEvent *event)
{
GtkEventControllerKey *key = GTK_EVENT_CONTROLLER_KEY (controller);
GdkEventType event_type = gdk_event_get_event_type (event);
gboolean handled;
GdkModifierType state;
guint16 keycode;
guint keyval;
if (event_type == GDK_FOCUS_CHANGE)
{
if (event->focus_change.in)
g_signal_emit (controller, signals[FOCUS_IN], 0);
else
g_signal_emit (controller, signals[FOCUS_OUT], 0);
return FALSE;
}
if (event_type != GDK_KEY_PRESS && event_type != GDK_KEY_RELEASE)
return FALSE;
if (key->im_context &&
gtk_im_context_filter_keypress (key->im_context, (GdkEventKey *) event))
{
g_signal_emit (controller, signals[IM_UPDATE], 0);
return TRUE;
}
if (!gdk_event_get_state (event, &state) || !event->key.is_modifier)
return FALSE;
key->current_event = event;
if (event->key.is_modifier)
{
if (event_type == GDK_KEY_PRESS)
g_signal_emit (controller, signals[MODIFIERS], 0, state, &handled);
else
handled = TRUE;
if (handled == TRUE)
{
key->current_event = NULL;
return TRUE;
}
}
gdk_event_get_keycode (event, &keycode);
gdk_event_get_keyval (event, &keyval);
if (event_type == GDK_KEY_PRESS)
{
g_signal_emit (controller, signals[KEY_PRESSED], 0,
keyval, keycode, state, &handled);
if (handled)
g_hash_table_add (key->pressed_keys, GUINT_TO_POINTER (keyval));
}
else if (event_type == GDK_KEY_RELEASE)
{
g_signal_emit (controller, signals[KEY_RELEASED], 0,
keyval, keycode, state);
handled = g_hash_table_lookup (key->pressed_keys, GUINT_TO_POINTER (keyval)) != NULL;
g_hash_table_remove (key->pressed_keys, GUINT_TO_POINTER (keyval));
}
else
handled = FALSE;
key->current_event = NULL;
return handled;
}
static void
gtk_event_controller_key_class_init (GtkEventControllerKeyClass *klass)
{
GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_event_controller_finalize;
controller_class->handle_event = gtk_event_controller_key_handle_event;
signals[KEY_PRESSED] =
g_signal_new (I_("key-pressed"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, _gtk_boolean_handled_accumulator, NULL, NULL,
G_TYPE_BOOLEAN, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
signals[KEY_RELEASED] =
g_signal_new (I_("key-released"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
signals[MODIFIERS] =
g_signal_new (I_("modifiers"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
g_cclosure_marshal_BOOLEAN__FLAGS,
G_TYPE_BOOLEAN, 1, GDK_TYPE_MODIFIER_TYPE);
signals[IM_UPDATE] =
g_signal_new (I_("im-update"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[FOCUS_IN] =
g_signal_new (I_("focus-in"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
signals[FOCUS_OUT] =
g_signal_new (I_("focus-out"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
static void
gtk_event_controller_key_init (GtkEventControllerKey *controller)
{
controller->pressed_keys = g_hash_table_new (NULL, NULL);
}
GtkEventController *
gtk_event_controller_key_new (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
return g_object_new (GTK_TYPE_EVENT_CONTROLLER_KEY,
"widget", widget,
NULL);
}
void
gtk_event_controller_key_set_im_context (GtkEventControllerKey *controller,
GtkIMContext *im_context)
{
g_return_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller));
g_return_if_fail (!im_context || GTK_IS_IM_CONTEXT (im_context));
if (controller->im_context)
gtk_im_context_reset (controller->im_context);
g_set_object (&controller->im_context, im_context);
}
/**
* gtk_event_controller_key_get_im_context:
* @controller: a #GtkEventControllerKey
*
* Gets the IM context of a key controller.
*
* Returns: (transfer none): the IM context
*
* Since: 3.24
**/
GtkIMContext *
gtk_event_controller_key_get_im_context (GtkEventControllerKey *controller)
{
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller), NULL);
return controller->im_context;
}
gboolean
gtk_event_controller_key_forward (GtkEventControllerKey *controller,
GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (controller->current_event != NULL, FALSE);
if (!gtk_widget_get_realized (widget))
gtk_widget_realize (widget);
if (_gtk_widget_captured_event (widget, (GdkEvent *) controller->current_event))
return TRUE;
if (gtk_widget_event (widget, (GdkEvent *) controller->current_event))
return TRUE;
return FALSE;
}
guint
gtk_event_controller_key_get_group (GtkEventControllerKey *controller)
{
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller), FALSE);
g_return_val_if_fail (controller->current_event != NULL, FALSE);
return controller->current_event->key.group;
}
+63
View File
@@ -0,0 +1,63 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_EVENT_CONTROLLER_KEY_H__
#define __GTK_EVENT_CONTROLLER_KEY_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gdk/gdk.h>
#include <gtk/gtkeventcontroller.h>
#include <gtk/gtkimcontext.h>
G_BEGIN_DECLS
#define GTK_TYPE_EVENT_CONTROLLER_KEY (gtk_event_controller_key_get_type ())
#define GTK_EVENT_CONTROLLER_KEY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKey))
#define GTK_EVENT_CONTROLLER_KEY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKeyClass))
#define GTK_IS_EVENT_CONTROLLER_KEY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_EVENT_CONTROLLER_KEY))
#define GTK_IS_EVENT_CONTROLLER_KEY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER_KEY))
#define GTK_EVENT_CONTROLLER_KEY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER_KEY, GtkEventControllerKeyClass))
typedef struct _GtkEventControllerKey GtkEventControllerKey;
typedef struct _GtkEventControllerKeyClass GtkEventControllerKeyClass;
GDK_AVAILABLE_IN_3_24
GType gtk_event_controller_key_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_24
GtkEventController *gtk_event_controller_key_new (GtkWidget *widget);
GDK_AVAILABLE_IN_3_24
void gtk_event_controller_key_set_im_context (GtkEventControllerKey *controller,
GtkIMContext *im_context);
GDK_AVAILABLE_IN_3_24
GtkIMContext * gtk_event_controller_key_get_im_context (GtkEventControllerKey *controller);
GDK_AVAILABLE_IN_3_24
gboolean gtk_event_controller_key_forward (GtkEventControllerKey *controller,
GtkWidget *widget);
GDK_AVAILABLE_IN_3_24
guint gtk_event_controller_key_get_group (GtkEventControllerKey *controller);
G_END_DECLS
#endif /* __GTK_EVENT_CONTROLLER_KEY_H__ */
+169
View File
@@ -0,0 +1,169 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Matthias Clasen <mclasen@redhat.com>
*/
/**
* SECTION:gtkeventcontrollermotion
* @Short_description: Event controller for motion events
* @Title: GtkEventControllerMotion
* @See_also: #GtkEventController
*
* #GtkEventControllerMotion is an event controller meant for situations
* where you need to track the position of the pointer.
*
* This object was added in 3.24.
**/
#include "config.h"
#include "gtkintl.h"
#include "gtkwidget.h"
#include "gtkeventcontrollerprivate.h"
#include "gtkeventcontrollermotion.h"
#include "gtktypebuiltins.h"
#include "gtkmarshalers.h"
struct _GtkEventControllerMotion
{
GtkEventController parent_instance;
};
struct _GtkEventControllerMotionClass
{
GtkEventControllerClass parent_class;
};
enum {
ENTER,
LEAVE,
MOTION,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0 };
G_DEFINE_TYPE (GtkEventControllerMotion, gtk_event_controller_motion, GTK_TYPE_EVENT_CONTROLLER)
static gboolean
gtk_event_controller_motion_handle_event (GtkEventController *controller,
const GdkEvent *event)
{
GtkEventControllerClass *parent_class;
GdkEventType type;
type = gdk_event_get_event_type (event);
if (type == GDK_ENTER_NOTIFY)
{
double x, y;
gdk_event_get_coords (event, &x, &y);
g_signal_emit (controller, signals[ENTER], 0, x, y);
}
else if (type == GDK_LEAVE_NOTIFY)
{
g_signal_emit (controller, signals[LEAVE], 0);
}
else if (type == GDK_MOTION_NOTIFY)
{
double x, y;
gdk_event_get_coords (event, &x, &y);
g_signal_emit (controller, signals[MOTION], 0, x, y);
}
parent_class = GTK_EVENT_CONTROLLER_CLASS (gtk_event_controller_motion_parent_class);
return parent_class->handle_event (controller, event);
}
static void
gtk_event_controller_motion_class_init (GtkEventControllerMotionClass *klass)
{
GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
controller_class->handle_event = gtk_event_controller_motion_handle_event;
/**
* GtkEventControllerMotion::enter:
* @controller: The object that received the signal
* @x: the x coordinate
* @y: the y coordinate
*
* Signals that the pointer has entered the widget.
*/
signals[ENTER] =
g_signal_new (I_("enter"),
GTK_TYPE_EVENT_CONTROLLER_MOTION,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
/**
* GtkEventControllerMotion::leave:
* @controller: The object that received the signal
*
* Signals that pointer has left the widget.
*/
signals[LEAVE] =
g_signal_new (I_("leave"),
GTK_TYPE_EVENT_CONTROLLER_MOTION,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
G_TYPE_NONE, 0);
/**
* GtkEventControllerMotion::motion:
* @controller: The object that received the signal
* @x: the x coordinate
* @y: the y coordinate
*
* Emitted when the pointer moves inside the widget.
*/
signals[MOTION] =
g_signal_new (I_("motion"),
GTK_TYPE_EVENT_CONTROLLER_MOTION,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
}
static void
gtk_event_controller_motion_init (GtkEventControllerMotion *motion)
{
}
/**
* gtk_event_controller_motion_new:
* @widget: a #GtkWidget
*
* Creates a new event controller that will handle motion events
* for the given @widget.
*
* Returns: a new #GtkEventControllerMotion
*
* Since: 3.24
**/
GtkEventController *
gtk_event_controller_motion_new (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
return g_object_new (GTK_TYPE_EVENT_CONTROLLER_MOTION,
"widget", widget,
NULL);
}
+50
View File
@@ -0,0 +1,50 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Matthias Clasen <mclasen@redhat.com>
*/
#ifndef __GTK_EVENT_CONTROLLER_MOTION_H__
#define __GTK_EVENT_CONTROLLER_MOTION_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gdk/gdk.h>
#include <gtk/gtkeventcontroller.h>
G_BEGIN_DECLS
#define GTK_TYPE_EVENT_CONTROLLER_MOTION (gtk_event_controller_motion_get_type ())
#define GTK_EVENT_CONTROLLER_MOTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotion))
#define GTK_EVENT_CONTROLLER_MOTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotionClass))
#define GTK_IS_EVENT_CONTROLLER_MOTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_EVENT_CONTROLLER_MOTION))
#define GTK_IS_EVENT_CONTROLLER_MOTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER_MOTION))
#define GTK_EVENT_CONTROLLER_MOTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER_MOTION, GtkEventControllerMotionClass))
typedef struct _GtkEventControllerMotion GtkEventControllerMotion;
typedef struct _GtkEventControllerMotionClass GtkEventControllerMotionClass;
GDK_AVAILABLE_IN_3_24
GType gtk_event_controller_motion_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_24
GtkEventController *gtk_event_controller_motion_new (GtkWidget *widget);
G_END_DECLS
#endif /* __GTK_EVENT_CONTROLLER_MOTION_H__ */
+517
View File
@@ -0,0 +1,517 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
/**
* SECTION:gtkeventcontrollerscroll
* @Short_description: Event controller for scroll events
* @Title: GtkEventControllerScroll
* @See_also: #GtkEventController
*
* #GtkEventControllerScroll is an event controller meant to handle
* scroll events from mice and touchpads. It is capable of handling
* both discrete and continuous scroll events, abstracting them both
* on the #GtkEventControllerScroll::scroll signal (deltas in the
* discrete case are multiples of 1).
*
* In the case of continuous scroll events, #GtkEventControllerScroll
* encloses all #GtkEventControllerScroll::scroll events between two
* #GtkEventControllerScroll::scroll-begin and #GtkEventControllerScroll::scroll-end
* signals.
*
* The behavior of the event controller can be modified by the
* flags given at creation time, or modified at a later point through
* gtk_event_controller_scroll_set_flags() (e.g. because the scrolling
* conditions of the widget changed).
*
* The controller can be set up to emit motion for either/both vertical
* and horizontal scroll events through #GTK_EVENT_CONTROLLER_SCROLL_VERTICAL,
* #GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL and #GTK_EVENT_CONTROLLER_SCROLL_BOTH.
* If any axis is disabled, the respective #GtkEventControllerScroll::scroll
* delta will be 0. Vertical scroll events will be translated to horizontal
* motion for the devices incapable of horizontal scrolling.
*
* The event controller can also be forced to emit discrete events on all devices
* through #GTK_EVENT_CONTROLLER_SCROLL_DISCRETE. This can be used to implement
* discrete actions triggered through scroll events (e.g. switching across
* combobox options).
*
* The #GTK_EVENT_CONTROLLER_SCROLL_KINETIC flag toggles the emission of the
* #GtkEventControllerScroll::decelerate signal, emitted at the end of scrolling
* with two X/Y velocity arguments that are consistent with the motion that
* was received.
*
* This object was added in 3.24.
**/
#include "config.h"
#include "math.h"
#include "gtkintl.h"
#include "gtkwidget.h"
#include "gtkeventcontrollerprivate.h"
#include "gtkeventcontrollerscroll.h"
#include "gtktypebuiltins.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
#define SCROLL_CAPTURE_THRESHOLD_MS 150
typedef struct
{
gdouble dx;
gdouble dy;
guint32 evtime;
} ScrollHistoryElem;
struct _GtkEventControllerScroll
{
GtkEventController parent_instance;
GtkEventControllerScrollFlags flags;
GArray *scroll_history;
/* For discrete event coalescing */
gdouble cur_dx;
gdouble cur_dy;
guint active : 1;
};
struct _GtkEventControllerScrollClass
{
GtkEventControllerClass parent_class;
};
enum {
SCROLL_BEGIN,
SCROLL,
SCROLL_END,
DECELERATE,
N_SIGNALS
};
enum {
PROP_0,
PROP_FLAGS,
N_PROPS
};
static GParamSpec *pspecs[N_PROPS] = { NULL };
static guint signals[N_SIGNALS] = { 0 };
G_DEFINE_TYPE (GtkEventControllerScroll, gtk_event_controller_scroll,
GTK_TYPE_EVENT_CONTROLLER)
static void
scroll_history_push (GtkEventControllerScroll *scroll,
gdouble delta_x,
gdouble delta_y,
guint32 evtime)
{
ScrollHistoryElem new_item;
guint i;
for (i = 0; i < scroll->scroll_history->len; i++)
{
ScrollHistoryElem *elem;
elem = &g_array_index (scroll->scroll_history, ScrollHistoryElem, i);
if (elem->evtime >= evtime - SCROLL_CAPTURE_THRESHOLD_MS)
break;
}
if (i > 0)
g_array_remove_range (scroll->scroll_history, 0, i);
new_item.dx = delta_x;
new_item.dy = delta_y;
new_item.evtime = evtime;
g_array_append_val (scroll->scroll_history, new_item);
}
static void
scroll_history_reset (GtkEventControllerScroll *scroll)
{
if (scroll->scroll_history->len == 0)
return;
g_array_remove_range (scroll->scroll_history, 0,
scroll->scroll_history->len);
}
static void
scroll_history_finish (GtkEventControllerScroll *scroll,
gdouble *velocity_x,
gdouble *velocity_y)
{
gdouble accum_dx = 0, accum_dy = 0;
guint32 first = 0, last = 0;
guint i;
*velocity_x = 0;
*velocity_y = 0;
if (scroll->scroll_history->len == 0)
return;
for (i = 0; i < scroll->scroll_history->len; i++)
{
ScrollHistoryElem *elem;
elem = &g_array_index (scroll->scroll_history, ScrollHistoryElem, i);
accum_dx += elem->dx;
accum_dy += elem->dy;
last = elem->evtime;
if (i == 0)
first = elem->evtime;
}
if (last != first)
{
*velocity_x = (accum_dx * 1000) / (last - first);
*velocity_y = (accum_dy * 1000) / (last - first);
}
scroll_history_reset (scroll);
}
static void
gtk_event_controller_scroll_finalize (GObject *object)
{
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (object);
g_array_unref (scroll->scroll_history);
G_OBJECT_CLASS (gtk_event_controller_scroll_parent_class)->finalize (object);
}
static void
gtk_event_controller_scroll_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (object);
switch (prop_id)
{
case PROP_FLAGS:
gtk_event_controller_scroll_set_flags (scroll, g_value_get_flags (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_event_controller_scroll_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (object);
switch (prop_id)
{
case PROP_FLAGS:
g_value_set_flags (value, scroll->flags);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static gboolean
gtk_event_controller_scroll_handle_event (GtkEventController *controller,
const GdkEvent *event)
{
GtkEventControllerScroll *scroll = GTK_EVENT_CONTROLLER_SCROLL (controller);
GdkScrollDirection direction = GDK_SCROLL_SMOOTH;
gdouble dx = 0, dy = 0;
if (gdk_event_get_event_type (event) != GDK_SCROLL)
return FALSE;
if ((scroll->flags & (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL |
GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL)) == 0)
return FALSE;
/* FIXME: Handle device changes */
if (gdk_event_get_scroll_deltas (event, &dx, &dy))
{
GdkDevice *device = gdk_event_get_source_device (event);
GdkInputSource input_source = gdk_device_get_source (device);
if (!scroll->active &&
(input_source == GDK_SOURCE_TRACKPOINT ||
input_source == GDK_SOURCE_TOUCHPAD))
{
g_signal_emit (controller, signals[SCROLL_BEGIN], 0);
scroll_history_reset (scroll);
scroll->active = TRUE;
}
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_VERTICAL) == 0)
dy = 0;
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL) == 0)
dx = 0;
if (scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_DISCRETE)
{
gint steps;
scroll->cur_dx += dx;
scroll->cur_dy += dy;
dx = dy = 0;
if (ABS (scroll->cur_dx) >= 1)
{
steps = trunc (scroll->cur_dx);
scroll->cur_dx -= steps;
dx = steps;
}
if (ABS (scroll->cur_dy) >= 1)
{
steps = trunc (scroll->cur_dy);
scroll->cur_dy -= steps;
dy = steps;
}
}
}
else if (gdk_event_get_scroll_direction (event, &direction))
{
switch (direction)
{
case GDK_SCROLL_UP:
dy -= 1;
break;
case GDK_SCROLL_DOWN:
dy += 1;
break;
case GDK_SCROLL_LEFT:
dx -= 1;
break;
case GDK_SCROLL_RIGHT:
dx += 1;
break;
default:
g_assert_not_reached ();
break;
}
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_VERTICAL) == 0)
dy = 0;
if ((scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL) == 0)
dx = 0;
}
if (dx != 0 || dy != 0)
{
g_signal_emit (controller, signals[SCROLL], 0, dx, dy);
if (scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_KINETIC)
scroll_history_push (scroll, dx, dy, gdk_event_get_time (event));
}
if (scroll->active && gdk_event_is_scroll_stop_event (event))
{
g_signal_emit (controller, signals[SCROLL_END], 0);
scroll->active = FALSE;
if (scroll->flags & GTK_EVENT_CONTROLLER_SCROLL_KINETIC)
{
gdouble vel_x, vel_y;
scroll_history_finish (scroll, &vel_x, &vel_y);
g_signal_emit (controller, signals[DECELERATE], 0, vel_x, vel_y);
}
}
return TRUE;
}
static void
gtk_event_controller_scroll_class_init (GtkEventControllerScrollClass *klass)
{
GtkEventControllerClass *controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_event_controller_scroll_finalize;
object_class->set_property = gtk_event_controller_scroll_set_property;
object_class->get_property = gtk_event_controller_scroll_get_property;
controller_class->handle_event = gtk_event_controller_scroll_handle_event;
/**
* GtkEventControllerScroll:flags:
*
* The flags affecting event controller behavior
*
* Since: 3.24
**/
pspecs[PROP_FLAGS] =
g_param_spec_flags ("flags",
P_("Flags"),
P_("Flags"),
GTK_TYPE_EVENT_CONTROLLER_SCROLL_FLAGS,
GTK_EVENT_CONTROLLER_SCROLL_NONE,
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkEventControllerScroll::scroll-begin:
* @controller: The object that received the signal
*
* Signals that a new scrolling operation has begun. It will
* only be emitted on devices capable of it.
**/
signals[SCROLL_BEGIN] =
g_signal_new (I_("scroll-begin"),
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* GtkEventControllerScroll::scroll:
* @controller: The object that received the signal
* @dx: X delta
* @dy: Y delta
*
* Signals that the widget should scroll by the
* amount specified by @dx and @dy.
**/
signals[SCROLL] =
g_signal_new (I_("scroll"),
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
/**
* GtkEventControllerScroll::scroll-end:
* @controller: The object that received the signal
*
* Signals that a new scrolling operation has finished. It will
* only be emitted on devices capable of it.
**/
signals[SCROLL_END] =
g_signal_new (I_("scroll-end"),
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* GtkEventControllerScroll::decelerate:
* @controller: The object that received the signal
* @vel_x: X velocity
* @vel_y: Y velocity
*
* Emitted after scroll is finished if the #GTK_EVENT_CONTROLLER_SCROLL_KINETIC
* flag is set. @vel_x and @vel_y express the initial velocity that was
* imprinted by the scroll events. @vel_x and @vel_y are expressed in
* pixels/ms.
**/
signals[DECELERATE] =
g_signal_new (I_("decelerate"),
GTK_TYPE_EVENT_CONTROLLER_SCROLL,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_object_class_install_properties (object_class, N_PROPS, pspecs);
}
static void
gtk_event_controller_scroll_init (GtkEventControllerScroll *scroll)
{
scroll->scroll_history = g_array_new (FALSE, FALSE,
sizeof (ScrollHistoryElem));
}
/**
* gtk_event_controller_scroll_new:
* @widget: a #GtkWidget
* @flags: behavior flags
*
* Creates a new event controller that will handle scroll events
* for the given @widget.
*
* Returns: a new #GtkEventControllerScroll
*
* Since: 3.24
**/
GtkEventController *
gtk_event_controller_scroll_new (GtkWidget *widget,
GtkEventControllerScrollFlags flags)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
return g_object_new (GTK_TYPE_EVENT_CONTROLLER_SCROLL,
"widget", widget,
"flags", flags,
NULL);
}
/**
* gtk_event_controller_scroll_set_flags:
* @scroll: a #GtkEventControllerScroll
* @flags: behavior flags
*
* Sets the flags conditioning scroll controller behavior.
*
* Since: 3.24
**/
void
gtk_event_controller_scroll_set_flags (GtkEventControllerScroll *scroll,
GtkEventControllerScrollFlags flags)
{
g_return_if_fail (GTK_IS_EVENT_CONTROLLER_SCROLL (scroll));
if (scroll->flags == flags)
return;
scroll->flags = flags;
g_object_notify_by_pspec (G_OBJECT (scroll), pspecs[PROP_FLAGS]);
}
/**
* gtk_event_controller_scroll_get_flags:
* @scroll: a #GtkEventControllerScroll
*
* Gets the flags conditioning the scroll controller behavior.
*
* Returns: the controller flags.
*
* Since: 3.24
**/
GtkEventControllerScrollFlags
gtk_event_controller_scroll_get_flags (GtkEventControllerScroll *scroll)
{
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_SCROLL (scroll),
GTK_EVENT_CONTROLLER_SCROLL_NONE);
return scroll->flags;
}
+80
View File
@@ -0,0 +1,80 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_EVENT_CONTROLLER_SCROLL_H__
#define __GTK_EVENT_CONTROLLER_SCROLL_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gdk/gdk.h>
#include <gtk/gtkeventcontroller.h>
G_BEGIN_DECLS
#define GTK_TYPE_EVENT_CONTROLLER_SCROLL (gtk_event_controller_scroll_get_type ())
#define GTK_EVENT_CONTROLLER_SCROLL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScroll))
#define GTK_EVENT_CONTROLLER_SCROLL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScrollClass))
#define GTK_IS_EVENT_CONTROLLER_SCROLL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_EVENT_CONTROLLER_SCROLL))
#define GTK_IS_EVENT_CONTROLLER_SCROLL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_EVENT_CONTROLLER_SCROLL))
#define GTK_EVENT_CONTROLLER_SCROLL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_EVENT_CONTROLLER_SCROLL, GtkEventControllerScrollClass))
typedef struct _GtkEventControllerScroll GtkEventControllerScroll;
typedef struct _GtkEventControllerScrollClass GtkEventControllerScrollClass;
/**
* GtkEventControllerScrollFlags:
* @GTK_EVENT_CONTROLLER_SCROLL_NONE: Don't emit scroll.
* @GTK_EVENT_CONTROLLER_SCROLL_VERTICAL: Emit scroll with vertical deltas.
* @GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL: Emit scroll with horizontal deltas.
* @GTK_EVENT_CONTROLLER_SCROLL_DISCRETE: Only emit deltas that are multiples of 1.
* @GTK_EVENT_CONTROLLER_SCROLL_KINETIC: Emit #GtkEventControllerScroll::decelerate
* after continuous scroll finishes.
* @GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES: Emit scroll on both axes.
*
* Describes the behavior of a #GtkEventControllerScroll.
*
* Since: 3.24
**/
typedef enum {
GTK_EVENT_CONTROLLER_SCROLL_NONE = 0,
GTK_EVENT_CONTROLLER_SCROLL_VERTICAL = 1 << 0,
GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL = 1 << 1,
GTK_EVENT_CONTROLLER_SCROLL_DISCRETE = 1 << 2,
GTK_EVENT_CONTROLLER_SCROLL_KINETIC = 1 << 3,
GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES = (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL | GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL),
} GtkEventControllerScrollFlags;
GDK_AVAILABLE_IN_3_24
GType gtk_event_controller_scroll_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_24
GtkEventController *gtk_event_controller_scroll_new (GtkWidget *widget,
GtkEventControllerScrollFlags flags);
GDK_AVAILABLE_IN_3_24
void gtk_event_controller_scroll_set_flags (GtkEventControllerScroll *controller,
GtkEventControllerScrollFlags flags);
GDK_AVAILABLE_IN_3_24
GtkEventControllerScrollFlags
gtk_event_controller_scroll_get_flags (GtkEventControllerScroll *controller);
G_END_DECLS
#endif /* __GTK_EVENT_CONTROLLER_SCROLL_H__ */
+2
View File
@@ -862,7 +862,9 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
/* Load data and set initial style-dependent parameters */
gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
gtk_font_chooser_widget_populate_features (fontchooser);
#endif
gtk_font_chooser_widget_set_cell_size (fontchooser);
gtk_font_chooser_widget_take_font_desc (fontchooser, NULL);
}
+273
View File
@@ -0,0 +1,273 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017-2018, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
/**
* SECTION:gtkgesturestylus
* @Short_description: Gesture for stylus input
* @Title: GtkGestureStylus
* @See_also: #GtkGesture, #GtkGestureSingle
*
* #GtkGestureStylus is a #GtkGesture implementation specific to stylus
* input. The provided signals just provide the basic information
*/
#include "config.h"
#include "gtkgesturestylus.h"
#include "gtkgesturestylusprivate.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmain.h"
G_DEFINE_TYPE (GtkGestureStylus, gtk_gesture_stylus, GTK_TYPE_GESTURE_SINGLE)
enum {
PROXIMITY,
DOWN,
MOTION,
UP,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0, };
static gboolean
gtk_gesture_stylus_handle_event (GtkEventController *controller,
const GdkEvent *event)
{
GdkModifierType modifiers;
guint n_signal;
gdouble x, y;
GTK_EVENT_CONTROLLER_CLASS (gtk_gesture_stylus_parent_class)->handle_event (controller, event);
if (!gdk_event_get_device_tool (event))
return FALSE;
if (!gdk_event_get_coords (event, &x, &y))
return FALSE;
switch ((guint) gdk_event_get_event_type (event))
{
case GDK_BUTTON_PRESS:
n_signal = DOWN;
break;
case GDK_BUTTON_RELEASE:
n_signal = UP;
break;
case GDK_MOTION_NOTIFY:
gdk_event_get_state (event, &modifiers);
if (modifiers & GDK_BUTTON1_MASK)
n_signal = MOTION;
else
n_signal = PROXIMITY;
break;
default:
return FALSE;
}
g_signal_emit (controller, signals[n_signal], 0, x, y);
return TRUE;
}
static void
gtk_gesture_stylus_class_init (GtkGestureStylusClass *klass)
{
GtkEventControllerClass *event_controller_class;
event_controller_class = GTK_EVENT_CONTROLLER_CLASS (klass);
event_controller_class->handle_event = gtk_gesture_stylus_handle_event;
signals[PROXIMITY] =
g_signal_new (I_("proximity"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, proximity),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
signals[DOWN] =
g_signal_new (I_("down"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, down),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
signals[MOTION] =
g_signal_new (I_("motion"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, motion),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
signals[UP] =
g_signal_new (I_("up"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, up),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
}
static void
gtk_gesture_stylus_init (GtkGestureStylus *gesture)
{
}
/**
* gtk_gesture_stylus_new:
* @widget: a #GtkWidget
*
* Creates a new #GtkGestureStylus.
*
* Returns: a newly created stylus gesture
*
* Since: 3.24
**/
GtkGesture *
gtk_gesture_stylus_new (GtkWidget *widget)
{
return g_object_new (GTK_TYPE_GESTURE_STYLUS,
"widget", widget,
NULL);
}
static const GdkEvent *
gesture_get_current_event (GtkGestureStylus *gesture)
{
GdkEventSequence *sequence;
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
return gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
}
/**
* gtk_gesture_stylus_get_axis:
* @gesture: a #GtkGestureStylus
* @axis: requested device axis
* @value: (out): return location for the axis value
*
* Returns the current value for the requested @axis. This function
* must be called from either the #GtkGestureStylus:down,
* #GtkGestureStylus:motion, #GtkGestureStylus:up or #GtkGestureStylus:proximity
* signals.
*
* Returns: #TRUE if there is a current value for the axis
*
* Since: 3.24
**/
gboolean
gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture,
GdkAxisUse axis,
gdouble *value)
{
const GdkEvent *event;
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
g_return_val_if_fail (axis < GDK_AXIS_LAST, FALSE);
g_return_val_if_fail (value != NULL, FALSE);
event = gesture_get_current_event (gesture);
if (!event)
return FALSE;
return gdk_event_get_axis (event, axis, value);
}
/**
* gtk_gesture_stylus_get_axes:
* @gesture: a GtkGestureStylus
* @axes: array of requested axes, terminated with #GDK_AXIS_IGNORE
* @values: (out): return location for the axis values
*
* Returns the current values for the requested @axes. This function
* must be called from either the #GtkGestureStylus:down,
* #GtkGestureStylus:motion, #GtkGestureStylus:up or #GtkGestureStylus:proximity
* signals.
*
* Returns: #TRUE if there is a current value for the axes
*
* Since: 3.24
**/
gboolean
gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture,
GdkAxisUse axes[],
gdouble **values)
{
const GdkEvent *event;
GArray *array;
gint i = 0;
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
g_return_val_if_fail (values != NULL, FALSE);
event = gesture_get_current_event (gesture);
if (!event)
return FALSE;
array = g_array_new (TRUE, FALSE, sizeof (gdouble));
while (axes[i] != GDK_AXIS_IGNORE)
{
gdouble value;
if (axes[i] >= GDK_AXIS_LAST)
{
g_warning ("Requesting unknown axis %d, did you "
"forget to add a last GDK_AXIS_IGNORE axis?",
axes[i]);
g_array_free (array, TRUE);
return FALSE;
}
gdk_event_get_axis (event, axes[i], &value);
g_array_append_val (array, value);
i++;
}
*values = (gdouble *) g_array_free (array, FALSE);
return TRUE;
}
/**
* gtk_gesture_stylus_get_device_tool:
* @gesture: a #GtkGestureStylus
*
* Returns the #GdkDeviceTool currently driving input through this gesture.
* This function must be called from either the #GtkGestureStylus::down,
* #GtkGestureStylus::motion, #GtkGestureStylus::up or #GtkGestureStylus::proximity
* signal handlers.
*
* Returns: (nullable) (transfer none): The current stylus tool
*
* Since: 3.24
**/
GdkDeviceTool *
gtk_gesture_stylus_get_device_tool (GtkGestureStylus *gesture)
{
const GdkEvent *event;
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
event = gesture_get_current_event (gesture);
if (!event)
return NULL;
return gdk_event_get_device_tool (event);
}
+59
View File
@@ -0,0 +1,59 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017-2018, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_STYLUS_H__
#define __GTK_GESTURE_STYLUS_H__
#include <gtk/gtkgesture.h>
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
G_BEGIN_DECLS
#define GTK_TYPE_GESTURE_STYLUS (gtk_gesture_stylus_get_type ())
#define GTK_GESTURE_STYLUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_GESTURE_STYLUS, GtkGestureStylus))
#define GTK_GESTURE_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GTK_TYPE_GESTURE_STYLUS, GtkGestureStylusClass))
#define GTK_IS_GESTURE_STYLUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_GESTURE_STYLUS))
#define GTK_IS_GESTURE_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GTK_TYPE_GESTURE_STYLUS))
#define GTK_GESTURE_STYLUS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_GESTURE_STYLUS, GtkGestureStylusClass))
typedef struct _GtkGestureStylus GtkGestureStylus;
typedef struct _GtkGestureStylusClass GtkGestureStylusClass;
GDK_AVAILABLE_IN_3_24
GType gtk_gesture_stylus_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_24
GtkGesture * gtk_gesture_stylus_new (GtkWidget *widget);
GDK_AVAILABLE_IN_3_24
gboolean gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture,
GdkAxisUse axis,
gdouble *value);
GDK_AVAILABLE_IN_3_24
gboolean gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture,
GdkAxisUse axes[],
gdouble **values);
GDK_AVAILABLE_IN_3_24
GdkDeviceTool * gtk_gesture_stylus_get_device_tool (GtkGestureStylus *gesture);
G_END_DECLS
#endif /* __GTK_GESTURE_STYLUS_H__ */
+51
View File
@@ -0,0 +1,51 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2017-2018, Red Hat, Inc.
*
* 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/>.
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GTK_GESTURE_STYLUS_PRIVATE_H__
#define __GTK_GESTURE_STYLUS_PRIVATE_H__
#include "gtkgesturesingleprivate.h"
#include "gtkgesturestylus.h"
struct _GtkGestureStylus
{
GtkGestureSingle parent_instance;
};
struct _GtkGestureStylusClass
{
GtkGestureSingleClass parent_class;
void (*proximity) (GtkGestureStylus *gesture,
gdouble x,
gdouble y);
void (*down) (GtkGestureStylus *gesture,
gdouble x,
gdouble y);
void (*motion) (GtkGestureStylus *gesture,
gdouble x,
gdouble y);
void (*up) (GtkGestureStylus *gesture,
gdouble x,
gdouble y);
/*< private >*/
gpointer padding[10];
};
#endif /* __GTK_GESTURE_STYLUS_PRIVATE_H__ */
+19 -1
View File
@@ -4106,6 +4106,24 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info,
return icon_info->proxy_pixbuf;
}
GdkPixbuf *
gtk_icon_info_load_icon_thread_safe (GtkIconInfo *icon_info,
GError **error)
{
GtkIconInfo *dup;
GdkPixbuf *pixbuf;
g_return_val_if_fail (icon_info != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
dup = icon_info_dup (icon_info);
pixbuf = gtk_icon_info_load_icon (dup, error);
g_object_unref (dup);
return pixbuf;
}
/**
* gtk_icon_info_load_surface:
* @icon_info: a #GtkIconInfo from gtk_icon_theme_lookup_icon()
@@ -4567,7 +4585,7 @@ gtk_icon_info_load_symbolic_svg (GtkIconInfo *icon_info,
" width=\"", width, "\"\n"
" height=\"", height, "\">\n"
" <style type=\"text/css\">\n"
" rect,path {\n"
" rect,path,ellipse,circle {\n"
" fill: ", css_fg," !important;\n"
" }\n"
" .warning {\n"
+3
View File
@@ -300,6 +300,9 @@ gboolean gtk_icon_info_is_symbolic (GtkIconInfo *icon_info
GDK_AVAILABLE_IN_ALL
GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info,
GError **error);
GDK_AVAILABLE_IN_3_24
GdkPixbuf * gtk_icon_info_load_icon_thread_safe (GtkIconInfo *icon_info,
GError **error);
GDK_AVAILABLE_IN_3_10
cairo_surface_t * gtk_icon_info_load_surface (GtkIconInfo *icon_info,
GdkWindow *for_window,
+38
View File
@@ -174,6 +174,7 @@ enum
PROP_ROLE,
PROP_ICON,
PROP_TEXT,
PROP_USE_MARKUP,
PROP_ACTIVE,
PROP_MENU_NAME,
PROP_INVERTED,
@@ -396,6 +397,19 @@ gtk_model_button_set_text (GtkModelButton *button,
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_TEXT]);
}
static void
gtk_model_button_set_use_markup (GtkModelButton *button,
gboolean use_markup)
{
use_markup = !!use_markup;
if (gtk_label_get_use_markup (GTK_LABEL (button->label)) == use_markup)
return;
gtk_label_set_use_markup (GTK_LABEL (button->label), use_markup);
update_visibility (button);
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_USE_MARKUP]);
}
static void
gtk_model_button_set_active (GtkModelButton *button,
gboolean active)
@@ -518,6 +532,10 @@ gtk_model_button_get_property (GObject *object,
g_value_set_string (value, gtk_label_get_text (GTK_LABEL (button->label)));
break;
case PROP_USE_MARKUP:
g_value_set_boolean (value, gtk_label_get_use_markup (GTK_LABEL (button->label)));
break;
case PROP_ACTIVE:
g_value_set_boolean (value, button->active);
break;
@@ -566,6 +584,10 @@ gtk_model_button_set_property (GObject *object,
gtk_model_button_set_text (button, g_value_get_string (value));
break;
case PROP_USE_MARKUP:
gtk_model_button_set_use_markup (button, g_value_get_boolean (value));
break;
case PROP_ACTIVE:
gtk_model_button_set_active (button, g_value_get_boolean (value));
break;
@@ -1138,6 +1160,22 @@ gtk_model_button_class_init (GtkModelButtonClass *class)
"",
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* GtkModelButton:use-markup:
*
* If %TRUE, XML tags in the text of the button are interpreted as by
* pango_parse_markup() to format the enclosed spans of text. If %FALSE, the
* text will be displayed verbatim.
*
* Since: 3.24
*/
properties[PROP_USE_MARKUP] =
g_param_spec_boolean ("use-markup",
P_("Use markup"),
P_("The text of the button includes XML markup. See pango_parse_markup()"),
FALSE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* GtkModelButton:active:
*
+30 -10
View File
@@ -2398,7 +2398,8 @@ volume_mount_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);
GtkSidebarRow *row = GTK_SIDEBAR_ROW (user_data);
GtkPlacesSidebar *sidebar;
GVolume *volume;
GError *error;
gchar *primary;
@@ -2406,6 +2407,7 @@ volume_mount_cb (GObject *source_object,
GMount *mount;
volume = G_VOLUME (source_object);
g_object_get (row, "sidebar", &sidebar, NULL);
error = NULL;
if (!g_volume_mount_finish (volume, result, &error))
@@ -2423,6 +2425,7 @@ volume_mount_cb (GObject *source_object,
}
sidebar->mounting = FALSE;
gtk_sidebar_row_set_busy (row, FALSE);
mount = g_volume_get_mount (volume);
if (mount != NULL)
@@ -2436,32 +2439,42 @@ volume_mount_cb (GObject *source_object,
g_object_unref (G_OBJECT (mount));
}
g_object_unref (row);
g_object_unref (sidebar);
}
static void
mount_volume (GtkPlacesSidebar *sidebar,
GVolume *volume)
mount_volume (GtkSidebarRow *row,
GVolume *volume)
{
GtkPlacesSidebar *sidebar;
GMountOperation *mount_op;
g_object_get (row, "sidebar", &sidebar, NULL);
mount_op = get_mount_operation (sidebar);
g_mount_operation_set_password_save (mount_op, G_PASSWORD_SAVE_FOR_SESSION);
g_object_ref (row);
g_object_ref (sidebar);
g_volume_mount (volume, 0, mount_op, NULL, volume_mount_cb, sidebar);
g_volume_mount (volume, 0, mount_op, NULL, volume_mount_cb, row);
}
static void
open_drive (GtkPlacesSidebar *sidebar,
open_drive (GtkSidebarRow *row,
GDrive *drive,
GtkPlacesOpenFlags open_flags)
{
GtkPlacesSidebar *sidebar;
g_object_get (row, "sidebar", &sidebar, NULL);
if (drive != NULL &&
(g_drive_can_start (drive) || g_drive_can_start_degraded (drive)))
{
GMountOperation *mount_op;
gtk_sidebar_row_set_busy (row, TRUE);
mount_op = get_mount_operation (sidebar);
g_drive_start (drive, G_DRIVE_START_NONE, mount_op, NULL, drive_start_from_bookmark_cb, NULL);
g_object_unref (mount_op);
@@ -2469,15 +2482,20 @@ open_drive (GtkPlacesSidebar *sidebar,
}
static void
open_volume (GtkPlacesSidebar *sidebar,
open_volume (GtkSidebarRow *row,
GVolume *volume,
GtkPlacesOpenFlags open_flags)
{
GtkPlacesSidebar *sidebar;
g_object_get (row, "sidebar", &sidebar, NULL);
if (volume != NULL && !sidebar->mounting)
{
sidebar->mounting = TRUE;
sidebar->go_to_after_mount_open_flags = open_flags;
mount_volume (sidebar, volume);
gtk_sidebar_row_set_busy (row, TRUE);
mount_volume (row, volume);
}
}
@@ -2534,11 +2552,11 @@ open_row (GtkSidebarRow *row,
}
else if (volume != NULL)
{
open_volume (sidebar, volume, open_flags);
open_volume (row, volume, open_flags);
}
else if (drive != NULL)
{
open_drive (sidebar, drive, open_flags);
open_drive (row, drive, open_flags);
}
g_object_unref (sidebar);
@@ -2875,7 +2893,7 @@ mount_shortcut_cb (GSimpleAction *action,
NULL);
if (volume != NULL)
mount_volume (sidebar, volume);
mount_volume (sidebar->context_row, volume);
g_object_unref (volume);
}
@@ -4743,6 +4761,8 @@ gtk_places_sidebar_class_init (GtkPlacesSidebarClass *class)
/**
* GtkPlacesSidebar::show-starred-location:
* @sidebar: the object which received the signal.
* @open_flags: a single value from #GtkPlacesOpenFlags specifying how the
* starred file should be opened.
*
* The places sidebar emits this signal when it needs the calling
* application to present a way to show the starred files. In GNOME,
+4 -1
View File
@@ -1226,7 +1226,10 @@ tick_cb (GtkWidget *widget,
priv->last_iteration = iteration;
if (current_iterations > 3 * pulse_iterations)
return G_SOURCE_CONTINUE;
{
priv->pulse1 = 0;
return G_SOURCE_CONTINUE;
}
/* advance the block */
if (priv->activity_dir == 0)
+3
View File
@@ -757,6 +757,9 @@ gtk_css_style_render_frame_gap (GtkCssStyle *style,
* ![](frame-gap.png)
*
* Since: 3.0
*
* Deprecated: 3.24: Use gtk_render_frame() instead. Themes can create gaps
* by omitting borders via CSS.
**/
void
gtk_render_frame_gap (GtkStyleContext *context,
+1 -1
View File
@@ -110,7 +110,7 @@ void gtk_render_slider (GtkStyleContext *context,
gdouble width,
gdouble height,
GtkOrientation orientation);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_24_FOR(gtk_render_frame)
void gtk_render_frame_gap (GtkStyleContext *context,
cairo_t *cr,
gdouble x,
+11 -11
View File
@@ -745,7 +745,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
* GtkScrolledWindow:propagate-natural-width:
*
* Whether the natural width of the child should be calculated and propagated
* through the scrolled windows requested natural width.
* through the scrolled windows requested natural width.
*
* This is useful in cases where an attempt should be made to allocate exactly
* enough space for the natural size of the child.
@@ -763,7 +763,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
* GtkScrolledWindow:propagate-natural-height:
*
* Whether the natural height of the child should be calculated and propagated
* through the scrolled windows requested natural height.
* through the scrolled windows requested natural height.
*
* This is useful in cases where an attempt should be made to allocate exactly
* enough space for the natural size of the child.
@@ -790,7 +790,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
* [keybinding signal][GtkBindingSignal]
* which gets emitted when a keybinding that scrolls is pressed.
* The horizontal or vertical adjustment is updated which triggers a
* signal that the scrolled windows child may listen to and scroll itself.
* signal that the scrolled windows child may listen to and scroll itself.
*/
signals[SCROLL_CHILD] =
g_signal_new (I_("scroll-child"),
@@ -813,9 +813,9 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
* [keybinding signal][GtkBindingSignal] which gets
* emitted when focus is moved away from the scrolled window by a
* keybinding. The #GtkWidget::move-focus signal is emitted with
* @direction_type on this scrolled windows toplevel parent in the
* @direction_type on this scrolled windows toplevel parent in the
* container hierarchy. The default bindings for this signal are
* `Tab + Ctrl` and `Tab + Ctrl + Shift`.
* `Ctrl + Tab` to move forward and `Ctrl + Shift + Tab` to move backward.
*/
signals[MOVE_FOCUS_OUT] =
g_signal_new (I_("move-focus-out"),
@@ -833,7 +833,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
* @pos: edge side that was hit
*
* The ::edge-overshot signal is emitted whenever user initiated scrolling
* makes the scrolledwindow firmly surpass (ie. with some edge resistance)
* makes the scrolled window firmly surpass (i.e. with some edge resistance)
* the lower or upper limits defined by the adjustment in that orientation.
*
* A similar behavior without edge resistance is provided by the
@@ -858,7 +858,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
* @pos: edge side that was reached
*
* The ::edge-reached signal is emitted whenever user-initiated scrolling
* makes the scrolledwindow exactly reaches the lower or upper limits
* makes the scrolled window exactly reach the lower or upper limits
* defined by the adjustment in that orientation.
*
* A similar behavior with edge resistance is provided by the
@@ -4822,7 +4822,7 @@ gtk_scrolled_window_get_max_content_height (GtkScrolledWindow *scrolled_window)
* @propagate: whether to propagate natural width
*
* Sets whether the natural width of the child should be calculated and propagated
* through the scrolled windows requested natural width.
* through the scrolled windows requested natural width.
*
* Since: 3.22
*/
@@ -4851,7 +4851,7 @@ gtk_scrolled_window_set_propagate_natural_width (GtkScrolledWindow *scrolled_win
* @scrolled_window: a #GtkScrolledWindow
*
* Reports whether the natural width of the child will be calculated and propagated
* through the scrolled windows requested natural width.
* through the scrolled windows requested natural width.
*
* Returns: whether natural width propagation is enabled.
*
@@ -4871,7 +4871,7 @@ gtk_scrolled_window_get_propagate_natural_width (GtkScrolledWindow *scrolled_win
* @propagate: whether to propagate natural height
*
* Sets whether the natural height of the child should be calculated and propagated
* through the scrolled windows requested natural height.
* through the scrolled windows requested natural height.
*
* Since: 3.22
*/
@@ -4900,7 +4900,7 @@ gtk_scrolled_window_set_propagate_natural_height (GtkScrolledWindow *scrolled_wi
* @scrolled_window: a #GtkScrolledWindow
*
* Reports whether the natural height of the child will be calculated and propagated
* through the scrolled windows requested natural height.
* through the scrolled windows requested natural height.
*
* Returns: whether natural height propagation is enabled.
*
-5
View File
@@ -1906,8 +1906,6 @@ gtk_settings_create_for_display (GdkDisplay *display)
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (display))
{
const gchar *immodule = NULL;
if (gdk_wayland_display_query_registry (display,
"gtk_text_input_manager"))
{
@@ -1922,9 +1920,6 @@ gtk_settings_create_for_display (GdkDisplay *display)
*/
settings = g_object_new (GTK_TYPE_SETTINGS, NULL);
}
immodule = "wayland";
}
else
#endif
+12
View File
@@ -28,6 +28,7 @@
#include "gtkstylecontext.h"
#include "gtkrevealer.h"
#include "gtkselection.h"
#include "gtkspinner.h"
#ifdef HAVE_CLOUDPROVIDERS
#include <cloudproviders/cloudprovidersaccount.h>
@@ -57,6 +58,7 @@ struct _GtkSidebarRow
GtkPlacesSidebar *sidebar;
GtkWidget *event_box;
GtkWidget *revealer;
GtkWidget *busy_spinner;
};
G_DEFINE_TYPE (GtkSidebarRow, gtk_sidebar_row, GTK_TYPE_LIST_BOX_ROW)
@@ -621,6 +623,7 @@ gtk_sidebar_row_class_init (GtkSidebarRowClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, eject_button);
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, event_box);
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, revealer);
gtk_widget_class_bind_template_child (widget_class, GtkSidebarRow, busy_spinner);
gtk_widget_class_bind_template_callback (widget_class, on_child_revealed);
gtk_widget_class_set_css_name (widget_class, "row");
@@ -658,3 +661,12 @@ gtk_sidebar_row_get_event_box (GtkSidebarRow *self)
{
return self->event_box;
}
void
gtk_sidebar_row_set_busy (GtkSidebarRow *row,
gboolean is_busy)
{
g_return_if_fail (GTK_IS_SIDEBAR_ROW (row));
gtk_widget_set_visible (row->busy_spinner, is_busy);
}
+2
View File
@@ -54,6 +54,8 @@ void gtk_sidebar_row_set_start_icon (GtkSidebarRow *self,
GIcon *icon);
void gtk_sidebar_row_set_end_icon (GtkSidebarRow *self,
GIcon *icon);
void gtk_sidebar_row_set_busy (GtkSidebarRow *row,
gboolean is_busy);
G_END_DECLS
-1
View File
@@ -4042,7 +4042,6 @@ gtk_text_view_size_request (GtkWidget *widget,
requisition->height += border_width * 2;
requisition->height += priv->top_border + priv->bottom_border;
requisition->width += priv->left_border + priv->right_border;
tmp_list = priv->children;
while (tmp_list != NULL)
+22 -4
View File
@@ -7227,7 +7227,7 @@ subtract_corners_from_region (cairo_region_t *region,
static void
update_opaque_region (GtkWindow *window,
GtkBorder *border,
const GtkBorder *border,
const GtkAllocation *allocation)
{
GtkWidget *widget = GTK_WIDGET (window);
@@ -7489,8 +7489,13 @@ gtk_window_realize (GtkWidget *widget)
gdk_window_set_decorations (gdk_window, 0);
#ifdef GDK_WINDOWING_WAYLAND
if (priv->client_decorated && GDK_IS_WAYLAND_WINDOW (gdk_window))
gdk_wayland_window_announce_csd (gdk_window);
if (GDK_IS_WAYLAND_WINDOW (gdk_window))
{
if (priv->client_decorated)
gdk_wayland_window_announce_csd (gdk_window);
else
gdk_wayland_window_announce_ssd (gdk_window);
}
#endif
if (!priv->deletable)
@@ -9000,11 +9005,24 @@ static void
gtk_window_style_updated (GtkWidget *widget)
{
GtkCssStyleChange *change = gtk_style_context_get_change (gtk_widget_get_style_context (widget));
GtkWindow *window = GTK_WINDOW (widget);
GTK_WIDGET_CLASS (gtk_window_parent_class)->style_updated (widget);
if (!_gtk_widget_get_alloc_needed (widget) &&
(change == NULL || gtk_css_style_change_changes_property (change, GTK_CSS_PROPERTY_BACKGROUND_COLOR)))
{
GtkAllocation allocation;
GtkBorder window_border;
_gtk_widget_get_allocation (widget, &allocation);
get_shadow_width (window, &window_border);
update_opaque_region (window, &window_border, &allocation);
}
if (change == NULL || gtk_css_style_change_changes_property (change, GTK_CSS_PROPERTY_ICON_THEME))
update_themed_icon (GTK_WINDOW (widget));
update_themed_icon (window);
}
/**
+3
View File
@@ -15,6 +15,8 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT)
#include <hb-ot.h>
#include "language-names.h"
@@ -237,3 +239,4 @@ get_language_name_for_tag (guint32 tag)
return get_language_name (pango_language_from_string (s));
}
#endif
+3
View File
@@ -1,6 +1,8 @@
#include "config.h"
#include <glib.h>
#include <glib/gi18n-lib.h>
#if defined (HAVE_HARFBUZZ) && defined (HAVE_PANGOFT)
#include <hb-ot.h>
#include "script-names.h"
@@ -182,3 +184,4 @@ get_script_name_for_tag (guint32 tag)
return NULL;
}
#endif
-4
View File
@@ -3393,8 +3393,6 @@ progressbar {
trough { @extend %scale_trough; }
&:backdrop trough { @extend %scale_trough:backdrop; } // looks like states are not passed to the trough component here
progress {
@extend %scale_highlight;
@@ -3421,8 +3419,6 @@ progressbar {
}
}
&:backdrop progress { @extend %scale_highlight:backdrop; } // states not passed here as well
&.osd { // progressbar.osd used for epiphany page loading progress
min-width: 3px;
min-height: 3px;
+4 -4
View File
@@ -1177,9 +1177,9 @@ scale trough, scale fill, progressbar trough { border: 1px solid #1b1f20; border
scale trough:disabled, scale fill:disabled, progressbar trough:disabled { background-color: #2d3234; }
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop, progressbar:backdrop trough { background-color: #2c3233; border-color: #202425; transition: 200ms ease-out; }
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop { background-color: #2c3233; border-color: #202425; transition: 200ms ease-out; }
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled, progressbar:backdrop trough:disabled { background-color: #2d3234; }
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled { background-color: #2d3234; }
row:selected scale trough:disabled, scale row:selected trough:disabled, row:selected scale fill:disabled, scale row:selected fill:disabled, row:selected progressbar trough:disabled, progressbar row:selected trough:disabled, row:selected scale trough, scale row:selected trough, row:selected scale fill, scale row:selected fill, row:selected progressbar trough, progressbar row:selected trough { border-color: #0f2b48; }
@@ -1191,9 +1191,9 @@ scale highlight, progressbar progress { border: 1px solid #0f2b48; border-radius
scale highlight:disabled, progressbar progress:disabled { background-color: transparent; border-color: transparent; }
scale highlight:backdrop, progressbar progress:backdrop, progressbar:backdrop progress { border-color: #0f2b48; }
scale highlight:backdrop, progressbar progress:backdrop { border-color: #0f2b48; }
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled, progressbar:backdrop progress:disabled { background-color: transparent; border-color: transparent; }
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled { background-color: transparent; border-color: transparent; }
row:selected scale highlight:disabled, scale row:selected highlight:disabled, row:selected progressbar progress:disabled, progressbar row:selected progress:disabled, row:selected scale highlight, scale row:selected highlight, row:selected progressbar progress, progressbar row:selected progress { border-color: #0f2b48; }
+4 -4
View File
@@ -1197,9 +1197,9 @@ scale trough, scale fill, progressbar trough { border: 1px solid #b6b6b3; border
scale trough:disabled, scale fill:disabled, progressbar trough:disabled { background-color: #f1f1f1; }
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop, progressbar:backdrop trough { background-color: #dadad8; border-color: #c0c0bd; transition: 200ms ease-out; }
scale trough:backdrop, scale fill:backdrop, progressbar trough:backdrop { background-color: #dadad8; border-color: #c0c0bd; transition: 200ms ease-out; }
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled, progressbar:backdrop trough:disabled { background-color: #f1f1f1; }
scale trough:backdrop:disabled, scale fill:backdrop:disabled, progressbar trough:backdrop:disabled { background-color: #f1f1f1; }
row:selected scale trough:disabled, scale row:selected trough:disabled, row:selected scale fill:disabled, scale row:selected fill:disabled, row:selected progressbar trough:disabled, progressbar row:selected trough:disabled, row:selected scale trough, scale row:selected trough, row:selected scale fill, scale row:selected fill, row:selected progressbar trough, progressbar row:selected trough { border-color: #184472; }
@@ -1211,9 +1211,9 @@ scale highlight, progressbar progress { border: 1px solid #184472; border-radius
scale highlight:disabled, progressbar progress:disabled { background-color: transparent; border-color: transparent; }
scale highlight:backdrop, progressbar progress:backdrop, progressbar:backdrop progress { border-color: #4a90d9; }
scale highlight:backdrop, progressbar progress:backdrop { border-color: #4a90d9; }
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled, progressbar:backdrop progress:disabled { background-color: transparent; border-color: transparent; }
scale highlight:backdrop:disabled, progressbar progress:backdrop:disabled { background-color: transparent; border-color: transparent; }
row:selected scale highlight:disabled, scale row:selected highlight:disabled, row:selected progressbar progress:disabled, progressbar row:selected progress:disabled, row:selected scale highlight, scale row:selected highlight, row:selected progressbar progress, progressbar row:selected progress { border-color: #184472; }
+3 -3
View File
@@ -1368,7 +1368,7 @@ treeview.view {
-GtkTreeView-grid-line-pattern: '';
-GtkTreeView-tree-line-width: 1;
-GtkTreeView-tree-line-pattern: '';
-GtkTreeView-expander-size: 16;
-GtkTreeView-expander-size: 24;
border-left-color: mix($fg_color, $base_color, 50%); // this is actually the tree lines color,
border-top-color: $bg_color; // while this is the grid lines color, better then nothing
@@ -2832,8 +2832,8 @@ row.activatable {
expander {
title > arrow {
min-width: 16px;
min-height: 16px;
min-width: 24px;
min-height: 24px;
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
@@ -548,7 +548,7 @@ window.csd > .titlebar:not(headerbar) { padding: 0; background-color: transparen
.path-bar button image { padding-top: 1px; }
/************** Tree Views * */
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 16; border-left-color: #888888; border-top-color: #000; }
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 24; border-left-color: #888888; border-top-color: #000; }
treeview.view:selected { border-radius: 0; }
@@ -1240,7 +1240,7 @@ row:hover, row.activatable:hover { transition: none; }
.app-notification border, .app-notification.frame border { border-width: 0; }
/************* Expanders * */
expander title > arrow { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
expander title > arrow { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
expander title > arrow:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
+2 -2
View File
@@ -552,7 +552,7 @@ window.csd > .titlebar:not(headerbar) { padding: 0; background-color: transparen
.path-bar button image { padding-top: 1px; }
/************** Tree Views * */
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 16; border-left-color: gray; border-top-color: #fff; }
treeview.view { -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 24; border-left-color: gray; border-top-color: #fff; }
treeview.view:selected { border-radius: 0; }
@@ -1246,7 +1246,7 @@ row:hover, row.activatable:hover { transition: none; }
.app-notification border, .app-notification.frame border { border-width: 0; }
/************* Expanders * */
expander title > arrow { min-width: 16px; min-height: 16px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
expander title > arrow { min-width: 24px; min-height: 24px; -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
expander title > arrow:dir(rtl) { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl"); }
-884
View File
@@ -1,884 +0,0 @@
@define-color fg_color #000;
@define-color bg_color #dcdad5;
@define-color text_color #000;
@define-color base_color #fff;
@define-color selected_bg_color #4b6983;
@define-color selected_fg_color #fff;
@define-color tooltip_bg_color #eee1b3;
@define-color tooltip_fg_color #000;
@define-color placeholder_text_color #808080;
@define-color info_fg_color rgb (181, 171, 156);
@define-color info_bg_color rgb (252, 252, 189);
@define-color warning_fg_color rgb (173, 120, 41);
@define-color warning_bg_color rgb (250, 173, 61);
@define-color question_fg_color rgb (97, 122, 214);
@define-color question_bg_color rgb (138, 173, 212);
@define-color error_fg_color rgb (166, 38, 38);
@define-color error_bg_color rgb (237, 54, 54);
@define-color success_bg_color #4e9a06;
* {
color: @fg_color;
border-color: shade (@bg_color, 0.6);
padding: 2px;
}
.background, .button, .slider {
background-color: @bg_color;
}
.popover {
border-color: darker(@bg_color);
border-width: 1px;
border-style: solid;
}
.expander, GtkTreeView.view.expander {
color: #fff;
}
.expander:hover,
GtkTreeView.view.expander:selected:hover {
color: @text_color;
}
GtkTreeView.dnd {
border-color: @internal_element_color;
border-radius: 0;
border-width: 1px;
border-style: solid;
}
*:disabled {
border-color: shade (@bg_color, 0.7);
background-color: shade (@bg_color, 0.9);
color: shade (@bg_color, 0.7);
}
.entry.read-only {
border-color: shade (@bg_color, 0.7);
background-color: shade (@bg_color, 0.9);
}
.entry:selected {
background-color: shade (@bg_color, 0.9);
color: @fg_color;
}
.entry:selected:focus {
background-color: @selected_bg_color;
color: @selected_fg_color;
}
.view {
border-width: 0;
border-radius: 0;
background-color: @base_color;
color: @text_color;
}
.view:selected {
background-color: shade (@bg_color, 0.9);
color: @fg_color;
}
.view:selected:focus {
background-color: @selected_bg_color;
color: @selected_fg_color;
}
.view column:sorted row,
.view column:sorted row:hover {
background-color: shade (@bg_color, 0.85);
}
.view column:sorted row:nth-child(odd),
.view column:sorted row:nth-child(odd):hover {
background-color: shade (@bg_color, 0.8);
}
.view row,
.view row:hover {
background-color: @base_color;
color: @text_color;
}
.view row:nth-child(odd),
.view row:nth-child(odd):hover {
background-color: shade (@base_color, 0.93);
}
.view row:selected:focus {
background-color: @selected_bg_color;
}
.view row:selected {
background-color: darker (@bg_color);
color: @selected_fg_color;
}
.view.cell.trough,
.view.cell.trough:hover,
.view.cell.trough:selected,
.view.cell.trough:selected:focus {
background-color: @bg_color;
color: @fg_color;
}
.view.cell.progressbar,
.view.cell.progressbar:hover,
.view.cell.progressbar:selected,
.view.cell.progressbar:selected:focus {
background-color: @selected_bg_color;
color: @selected_fg_color;
}
.rubberband {
background-color: alpha (@fg_color, 0.25);
border-color: @fg_color;
border-style: solid;
border-width: 1px;
}
.tooltip,
.tooltip * {
background-color: @tooltip_bg_color;
color: @tooltip_fg_color;
border-color: @tooltip_fg_color;
border-width: 1px;
border-style: solid;
}
.button,
.slider {
border-style: outset;
border-width: 2px;
}
.button:active, .button:checked {
background-color: shade (@bg_color, 0.7);
border-style: inset;
}
.spinbutton.button:hover,
.button:hover,
.slider:hover {
background-color: @selected_bg_color;
color: @selected_fg_color;
border-color: shade (@selected_bg_color, 0.7);
}
.trough {
background-color: darker (@bg_color);
border-style: inset;
border-width: 1px;
padding: 0;
}
.entry {
border-style: inset;
border-width: 2px;
background-color: @base_color;
color: @text_color;
}
.entry:disabled {
background-color: shade (@base_color, 0.9);
color: shade (@base_color, 0.7);
}
.entry:active {
background-color: #c4c2bd;
color: #000;
}
.progressbar,
.entry.progressbar,
.cell.progressbar {
background-color: @selected_bg_color;
border-color: shade (@selected_bg_color, 0.7);
color: @selected_fg_color;
border-style: outset;
border-width: 1px;
}
.level-bar.indicator-discrete {
margin: 1px;
}
.level-bar.fill-block {
background-color: @selected_bg_color;
}
.level-bar.fill-block.level-low {
background-color: @warning_bg_color;
}
.level-bar.fill-block.level-high {
background-color: @success_bg_color;
}
.level-bar.fill-block.empty-fill-block {
background-color: @base_color;
}
GtkCheckButton:hover,
GtkCheckButton:selected,
GtkRadioButton:hover,
GtkRadioButton:selected {
background-color: shade (@bg_color, 1.05);
}
.check, .radio,
.cell.check, .cell.radio,
.cell.check:hover, .cell.radio:hover {
border-style: solid;
border-width: 1px;
background-color: @base_color;
border-color: @fg_color;
}
.check:checked, .radio:checked,
.check:hover, .radio:hover {
background-color: @base_color;
border-color: @fg_color;
color: @text_color;
}
.check:active, .radio:active {
background-color: darker (@bg_color);
color: @selected_fg_color;
border-color: @selected_fg_color;
}
.check:active:focus, .radio:active:focus {
background-color: @selected_bg_color;
}
.menuitem.check, .menuitem.radio {
color: @fg_color;
border-style: none;
border-width: 0;
}
.popup {
border-style: outset;
border-width: 1px;
}
.viewport {
border-style: inset;
border-width: 2px;
}
.notebook {
border-style: outset;
border-width: 1px;
}
.notebook tab {
border-style: solid;
border-width: 1px;
padding: 0;
}
.notebook tab:active {
color: @selected_fg_color;
background-color: darker (@bg_color);
}
.frame {
border-style: inset;
border-width: 1px;
}
GtkScrolledWindow.frame {
padding: 0;
}
.menu,
.menubar,
.toolbar {
border-style: outset;
border-width: 1px;
}
.menu:hover,
.menubar:hover,
.menuitem:hover,
.menuitem.check:hover,
.menuitem.radio:hover {
background-color: @selected_bg_color;
color: @selected_fg_color;
}
GtkSpinButton.button {
border-width: 1px;
}
.scale.slider:hover,
GtkSpinButton.button:hover {
background-color: shade (@bg_color, 1.05);
border-color: shade (@bg_color, 0.8);
}
.scale.slider.fine-tune:active,
.scale.slider.fine-tune:active:hover,
.scale.slider.fine-tune.horizontal:active,
.scale.slider.fine-tune.horizontal:active:hover {
border-width: 5px;
}
.scrollbar.slider.fine-tune {
border-width: 5px;
}
GtkSwitch.trough:active {
background-color: @selected_bg_color;
color: @selected_fg_color;
}
GtkToggleButton.button:indeterminate {
border-style: outset;
border-width: 1px;
background-color: shade (@bg_color, 0.9);
border-color: shade (@bg_color, 0.7);
}
GtkLabel:selected {
background-color: shade (@bg_color, 0.9);
}
GtkLabel:selected:focus {
background-color: @selected_bg_color;
}
.info {
background-color: @info_bg_color;
color: @info_fg_color;
}
.warning {
background-color: @warning_bg_color;
color: @warning_fg_color;
}
.question {
background-color: @question_bg_color;
color: @question_fg_color;
}
.error {
background-color: @error_bg_color;
color: @error_fg_color;
}
.highlight {
background-color: @selected_bg_color;
color: @selected_fg_color;
}
.light-area-focus {
color: #000;
}
.dark-area-focus {
color: #fff;
}
GtkCalendar.view {
border-width: 1px;
border-style: inset;
padding: 1px;
}
GtkCalendar.view:indeterminate {
color: darker (@bg_color);
}
GtkCalendar.header {
background-color: @bg_color;
border-style: outset;
border-width: 2px;
}
GtkCalendar.highlight {
border-width: 0;
}
GtkCalendar.button {
background-color: @bg_color;
}
GtkCalendar.button:hover {
background-color: lighter (@bg_color);
color: @fg_color;
}
.menu * {
border-width: 0;
padding: 2px;
}
@keyframes spinner {
0% { background-image: none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
0% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
8% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none; }
8% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)); }
16% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)); }
16% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)); }
25% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)); }
25% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)); }
33% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)); }
33% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)); }
41% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)); }
41% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)); }
50% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)); }
50% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)); }
58% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)); }
58% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)); }
66% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)); }
66% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)); }
75% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)); }
75% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)); }
83% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)); }
83% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)); }
91% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)); }
91% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)); }
100% { background-image: none,
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
100% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
}
.spinner {
background-color: transparent;
background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent));
background-position: 25.00% 6.70%, 6.70% 25.00%, 0.00% 50.00%, 6.70% 75.00%, 25.00% 93.30%, 50.00% 100.00%, 75.00% 93.30%, 93.30% 75.00%, 100.00% 50.00%, 93.30% 25.00%, 75.00% 6.70%, 50.00% 0.00%;
background-size: 20% 20%;
background-repeat: no-repeat;
transition: background-image 500ms ease-out;
}
.spinner:active {
background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent));
animation: spinner 1s infinite linear;
}
/* Client side decorations */
.titlebar {
text-shadow: 1px 1px lighter (@bg_color);
background-image: linear-gradient(to bottom, white, @bg_color);
border-radius: 7px 7px 0px 0px;
}
.maximized .titlebar,
.tiled .titlebar {
border-radius: 0;
}
.titlebar.default-decoration {
border: none;
box-shadow: none;
}
.titlebar .title {
font-weight: bold;
font-size: 10pt;
}
.titlebar .subtitle {
font-size: 9pt;
}
.titlebar:backdrop {
text-shadow: none;
background-image: none;
background-color: @bg_color;
}
.titlebar .titlebutton {
-gtk-icon-shadow: 0px 1px #ffff;
color: shade(@fg_color, 1.8);
background: none;
padding: 5px 5px 6px 5px;
border-radius: 3px;
border-width: 1px 1px 2px 1px;
border-color: transparent;
border-style: solid;
border-image: none;
}
.titlebar .titlebutton:hover {
background-image: linear-gradient(to bottom, @bg_color, lighter (@bg_color));
}
.titlebar .titlebutton:backdrop {
border-image: none;
background-image: none;
}
.titlebar .titlebutton:active {
background-image: linear-gradient(to bottom, #a7aba7, shade(@bg_color, 0.95));
color: @selected_fg_color;
-gtk-icon-shadow: none;
}
.titlebar .titlebutton:backdrop {
background-image: none;
color: #a7aba7;
border-image: none;
-gtk-icon-shadow: none;
}
.window-frame {
border-color: darker (@bg_color);
border-radius: 7px 7px 0 0;
border-width: 1px;
border-style: solid;
box-shadow: 0 2px 8px 3px alpha(black, 0.5);
margin: 10px;
}
.window-frame.tooltip.csd {
border-radius: 1px 1px 0 0;
box-shadow: none;
margin: 0px;
}
.window-frame.popup.csd {
border-radius: 1px 1px 0 0;
box-shadow: 0 1px 1px 1px alpha(black, 0.5);
margin: 0px;
}
.window-frame.popup {
border-color: darker (@bg_color);
border-width: 1px;
border-style: solid;
}
.window-frame.tiled {
border-radius: 0;
background-color: @bg_color;
}
.window-frame:backdrop {
box-shadow: 0 2px 5px 1px alpha(black, 0.5);
}
.window-frame.solid-csd {
border-radius: 0;
margin: 2px;
background-color: @bg_color;
border-style: outset;
border-width: 2px;
box-shadow: none;
}
+9
View File
@@ -71,6 +71,15 @@
</style>
</object>
</child>
<child>
<object class="GtkSpinner" id="busy_spinner">
<property name="active">1</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="margin-start">4px</property>
<property name="no-show-all">1</property>
</object>
</child>
</object>
</child>
</object>
+2 -1
View File
@@ -336,7 +336,8 @@ gtk_im_context_thai_filter_keypress (GtkIMContext *context,
if (is_reject)
{
/* reject character */
gdk_beep ();
GdkDisplay *display = gdk_display_get_default ();
gdk_display_beep (display);
}
return TRUE;
}
+7 -2
View File
@@ -491,8 +491,13 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
GTK_IM_CONTEXT_CLASS (parent_class)->get_preedit_string (context, str, attrs, cursor_pos);
/* If the parent implementation returns a len>0 string, go with it */
if (str && *str && **str)
return;
if (str && *str)
{
if (**str)
return;
g_free (*str);
}
preedit_str =
context_wayland->preedit.text ? context_wayland->preedit.text : "";
+4
View File
@@ -140,6 +140,9 @@ gtk/gtkentry.c
gtk/gtkentrycompletion.c
gtk/gtkeventbox.c
gtk/gtkeventcontroller.c
gtk/gtkeventcontrollerkey.c
gtk/gtkeventcontrollermotion.c
gtk/gtkeventcontrollerscroll.c
gtk/gtkexpander.c
gtk/gtkfilechooserbutton.c
gtk/gtkfilechooser.c
@@ -167,6 +170,7 @@ gtk/gtkgesturemultipress.c
gtk/gtkgesturepan.c
gtk/gtkgesturerotate.c
gtk/gtkgesturesingle.c
gtk/gtkgesturestylus.c
gtk/gtkgestureswipe.c
gtk/gtkgesturezoom.c
gtk/gtkglarea.c
+303 -255
View File
File diff suppressed because it is too large Load Diff
+253 -209
View File
File diff suppressed because it is too large Load Diff
+312 -255
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -142,6 +142,9 @@ gtk/gtkentry.c
gtk/gtkentrycompletion.c
gtk/gtkeventbox.c
gtk/gtkeventcontroller.c
gtk/gtkeventcontrollerkey.c
gtk/gtkeventcontrollermotion.c
gtk/gtkeventcontrollerscroll.c
gtk/gtkexpander.c
gtk/gtkfilechooserbutton.c
gtk/gtkfilechooser.c
@@ -159,7 +162,6 @@ gtk/gtkfixed.c
gtk/gtkflowbox.c
gtk/gtkfontbutton.c
gtk/gtkfontchooser.c
gtk/gtkfontchooser.c
gtk/gtkfontchooserdialog.c
gtk/gtkfontchooserwidget.c
gtk/gtkframe.c
@@ -170,6 +172,7 @@ gtk/gtkgesturemultipress.c
gtk/gtkgesturepan.c
gtk/gtkgesturerotate.c
gtk/gtkgesturesingle.c
gtk/gtkgesturestylus.c
gtk/gtkgestureswipe.c
gtk/gtkgesturezoom.c
gtk/gtkglarea.c
@@ -357,8 +360,8 @@ gtk/ui/gtkcolorchooserdialog.ui
gtk/ui/gtkcoloreditor.ui
gtk/ui/gtkdialog.ui
gtk/ui/gtkemojichooser.ui
gtk/ui/gtkfilechooserbutton.ui
gtk/ui/gtkemojicompletion.ui
gtk/ui/gtkfilechooserbutton.ui
gtk/ui/gtkfilechooserdialog.ui
gtk/ui/gtkfilechooserwidget.ui
gtk/ui/gtkfontbutton.ui
+1812 -362
View File
File diff suppressed because it is too large Load Diff
+256 -316
View File
File diff suppressed because it is too large Load Diff
+1833 -365
View File
File diff suppressed because it is too large Load Diff
+2061 -310
View File
File diff suppressed because it is too large Load Diff
+3 -5
View File
@@ -168,7 +168,7 @@ int
main(int argc, char **argv)
{
GError *error = NULL;
GdkScreen *screen;
GdkMonitor *monitor;
GdkRectangle monitor_bounds;
GOptionContext *context = g_option_context_new (NULL);
@@ -204,10 +204,8 @@ main(int argc, char **argv)
G_CALLBACK (on_map_event), NULL);
on_frame (0.);
screen = gtk_widget_get_screen (window);
gdk_screen_get_monitor_geometry (screen,
gdk_screen_get_primary_monitor (screen),
&monitor_bounds);
monitor = gdk_display_get_primary_monitor (gtk_widget_get_display (window));
gdk_monitor_get_geometry (monitor, &monitor_bounds);
gtk_window_move (GTK_WINDOW (window),
monitor_bounds.x + (monitor_bounds.width - window_width) / 2,
+51 -14
View File
@@ -104,7 +104,7 @@ test_type (gconstpointer data)
klass = g_type_class_ref (type);
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
instance = g_object_ref (gtk_settings_get_default ());
instance = G_OBJECT (g_object_ref (gtk_settings_get_default ()));
else if (g_type_is_a (type, GDK_TYPE_WINDOW))
{
GdkWindowAttr attributes;
@@ -113,7 +113,7 @@ test_type (gconstpointer data)
attributes.event_mask = 0;
attributes.width = 100;
attributes.height = 100;
instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
instance = G_OBJECT (g_object_ref (gdk_window_new (NULL, &attributes, 0)));
}
else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))
instance = g_object_new (type, "display", display, NULL);
@@ -232,9 +232,14 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
strcmp (pspec->name, "cell-area-context") == 0))
continue;
if (g_type_is_a (type, GTK_TYPE_FONT_SELECTION) &&
strcmp (pspec->name, "font") == 0)
continue;
G_GNUC_END_IGNORE_DEPRECATIONS
/* This is set in init() */
if (g_type_is_a (type, GTK_TYPE_FONT_CHOOSER_WIDGET) &&
strcmp (pspec->name, "tweak-action") == 0)
continue;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (g_type_is_a (type, GTK_TYPE_ICON_VIEW) &&
(strcmp (pspec->name, "cell-area") == 0 ||
@@ -358,9 +363,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
continue;
if (g_test_verbose ())
g_print ("Property %s.%s\n",
g_type_name (pspec->owner_type),
pspec->name);
{
g_print ("Property %s:%s\n",
g_type_name (pspec->owner_type),
pspec->name);
}
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
g_object_get_property (instance, pspec->name, &value);
check_property ("Property", pspec, &value);
@@ -370,7 +378,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (g_type_is_a (type, GTK_TYPE_WIDGET))
{
g_object_set (gtk_settings_get_default (), "gtk-theme-name", "Raleigh", NULL);
g_object_set (gtk_settings_get_default (), "gtk-theme-name", "Adwaita", NULL);
pspecs = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (klass), &n_pspecs);
for (i = 0; i < n_pspecs; ++i)
@@ -384,14 +392,43 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if ((pspec->flags & G_PARAM_READABLE) == 0)
continue;
if (g_type_is_a (type, GTK_TYPE_BUTTON) &&
strcmp (pspec->name, "default-border") == 0)
/* These are overridden by Adwaita */
if (g_type_is_a (type, GTK_TYPE_DIALOG) &&
(strcmp (pspec->name, "action-area-border") == 0 ||
strcmp (pspec->name, "button-spacing") == 0))
continue;
if (g_type_is_a (type, GTK_TYPE_SCROLLBAR) &&
(strcmp (pspec->name, "has-backward-stepper") == 0 ||
strcmp (pspec->name, "has-forward-stepper") == 0))
continue;
if (g_type_is_a (type, GTK_TYPE_SCROLLED_WINDOW) &&
strcmp (pspec->name, "scrollbar-spacing") == 0)
continue;
if (g_type_is_a (type, GTK_TYPE_TEXT_VIEW) &&
strcmp (pspec->name, "error-underline-color") == 0)
continue;
if (g_type_is_a (type, GTK_TYPE_TOOL_BUTTON) &&
strcmp (pspec->name, "icon-spacing") == 0)
continue;
if (g_type_is_a (type, GTK_TYPE_TOOL_ITEM_GROUP) &&
strcmp (pspec->name, "expander-size") == 0)
continue;
if (g_type_is_a (type, GTK_TYPE_TREE_VIEW) &&
(strcmp (pspec->name, "expander-size") == 0 ||
strcmp (pspec->name, "grid-line-pattern") == 0 ||
strcmp (pspec->name, "horizontal-separator") == 0 ||
strcmp (pspec->name, "tree-line-pattern") == 0))
continue;
/* This is desktop-dependent */
if (g_type_is_a (type, GTK_TYPE_WINDOW) &&
(strcmp (pspec->name, "resize-grip-width") == 0 ||
strcmp (pspec->name, "resize-grip-height") == 0 ||
strcmp (pspec->name, "decoration-button-layout") == 0))
strcmp (pspec->name, "decoration-button-layout") == 0)
continue;
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
+2 -2
View File
@@ -431,7 +431,7 @@ test_type (gconstpointer data)
klass = g_type_class_ref (type);
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
instance = g_object_ref (gtk_settings_get_default ());
instance = G_OBJECT (g_object_ref (gtk_settings_get_default ()));
else if (g_type_is_a (type, GDK_TYPE_WINDOW))
{
GdkWindowAttr attributes;
@@ -440,7 +440,7 @@ test_type (gconstpointer data)
attributes.event_mask = 0;
attributes.width = 100;
attributes.height = 100;
instance = g_object_ref (gdk_window_new (NULL, &attributes, 0));
instance = G_OBJECT (g_object_ref (gdk_window_new (NULL, &attributes, 0)));
}
else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))
instance = g_object_new (type, "display", display, NULL);