Compare commits
153 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ad550f341 | |||
| c1816408c0 | |||
| 5699e5ba71 | |||
| 5356202ba3 | |||
| 15a574976e | |||
| f9c7b68853 | |||
| 741603c838 | |||
| 5ab6eca84d | |||
| 024151fe2c | |||
| d5bfcdc218 | |||
| 90bd5a04fd | |||
| 16da71f1ce | |||
| 807537dd5d | |||
| b3fa74d1ac | |||
| dcb620e103 | |||
| c573732ef1 | |||
| 69e72341a2 | |||
| 2a0a55ae97 | |||
| 6df3296211 | |||
| a00d3b107e | |||
| 4ffcc9aa26 | |||
| e7fdb43499 | |||
| 03be0994ad | |||
| 073c40c738 | |||
| b3d6202833 | |||
| bf09dc47fd | |||
| 4e031a9542 | |||
| 8d263eed02 | |||
| 5047f79218 | |||
| 54885d14bf | |||
| c231ce6a9f | |||
| c12f1ebebb | |||
| 6c1f404e5a | |||
| caa5fd0584 | |||
| d883b0a383 | |||
| ffcbc44c7f | |||
| 633d59fff9 | |||
| 939a254e28 | |||
| 06a0265efa | |||
| f639fda994 | |||
| 26805edcff | |||
| d5db409c44 | |||
| b6a4ffef36 | |||
| ba44668478 | |||
| 2f921ab667 | |||
| d9784df92e | |||
| 6a5f93ff95 | |||
| 7578a18cd6 | |||
| a5895b5995 | |||
| 37582c6bf9 | |||
| 84f02c633c | |||
| fdb2776577 | |||
| 94539d469c | |||
| f6a2d8148b | |||
| 35e3eaf8cb | |||
| 2bc7b64004 | |||
| 2df07f0564 | |||
| 2d747cca3c | |||
| f795a75d2b | |||
| 8748d9511b | |||
| 0fe3a26122 | |||
| 9145365331 | |||
| 84295147fd | |||
| 7ec50b1dd3 | |||
| a5b4c2bb48 | |||
| d26a3c28d0 | |||
| e75df3dcd3 | |||
| db5eef5a81 | |||
| 0b0d7d3877 | |||
| 10b302ac29 | |||
| f1bfbeba45 | |||
| ca405f1060 | |||
| 4baec1ef22 | |||
| d35e069436 | |||
| 6a95ca6995 | |||
| 268c174506 | |||
| 7e3493b15e | |||
| be65bab5f6 | |||
| c04139405a | |||
| 5fc008024b | |||
| f6bec2edf2 | |||
| c1e68f6044 | |||
| 549e5a8e3a | |||
| 5783d8af91 | |||
| 1926d91e1d | |||
| 0441101786 | |||
| eb8fce3645 | |||
| 016294ba6e | |||
| b9ce81b912 | |||
| a9d0563085 | |||
| e6bab9b64c | |||
| 513aa20f76 | |||
| 83b38e55c0 | |||
| 22b23a6d19 | |||
| 908f5dc142 | |||
| 7ef493ec88 | |||
| 6edfd29df0 | |||
| eabbc0ef30 | |||
| bfcd5f4881 | |||
| 201fc28a67 | |||
| 0026f74dbe | |||
| d116ba348f | |||
| 06c0012dd4 | |||
| 7b84ffd378 | |||
| cc5d2f24e8 | |||
| c06462aec0 | |||
| a4aaab2e5b | |||
| fe237c4030 | |||
| ff8f32bf10 | |||
| 8a8edde78d | |||
| 3852512446 | |||
| c926f9491a | |||
| 03176fe23c | |||
| d0cb76fff4 | |||
| d76e106382 | |||
| f7ab0b19c7 | |||
| b50df28e38 | |||
| f97d32e253 | |||
| b7a0744324 | |||
| 3ef8ff2a43 | |||
| b4844e2ace | |||
| 610f5ce75c | |||
| 3c4c7896fc | |||
| 686752a852 | |||
| 8bb1b8da57 | |||
| 1b81af591d | |||
| 88a8287c1d | |||
| 8cc2dbe6f8 | |||
| aec29503bf | |||
| 1506a41448 | |||
| 63622923f0 | |||
| 59c87b8387 | |||
| fdf71e13c4 | |||
| 5d49dabade | |||
| 405fab8b36 | |||
| ef455f5c85 | |||
| 05e4cd1579 | |||
| 0ea96e3b0c | |||
| 1e9e7bf0d9 | |||
| d7a5dedd4f | |||
| 2e65416270 | |||
| 13c22e4e2f | |||
| 65a061f3c2 | |||
| fc63e6856f | |||
| 94747d53eb | |||
| 7bfff6c51e | |||
| 3fdedce8f6 | |||
| 5f0fe09423 | |||
| 9e402fa064 | |||
| d84440969a | |||
| e7dc82fa32 | |||
| f1b3492700 | |||
| 70e26d12fb |
+2
-2
@@ -24,9 +24,9 @@ variables:
|
||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v28"
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v31"
|
||||
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
|
||||
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v26"
|
||||
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v31"
|
||||
|
||||
.only-default:
|
||||
only:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v28
|
||||
|
||||
RUN dnf -y install \
|
||||
graphviz \
|
||||
python3-jinja2 \
|
||||
python3-markdown \
|
||||
python3-pygments \
|
||||
|
||||
@@ -1,3 +1,79 @@
|
||||
Overview of Changes in 4.2.1
|
||||
============================
|
||||
|
||||
* GtkVideo:
|
||||
- Detect stream metadata when using gstreamer
|
||||
|
||||
* GtkFileChooser:
|
||||
- Fix a crash
|
||||
|
||||
* GtkButton:
|
||||
- Add back visual feedback for keynav activation
|
||||
|
||||
* GtkFontChooser:
|
||||
- Fix initial font selection
|
||||
|
||||
* Text widgets:
|
||||
- Support translucent selections
|
||||
|
||||
* GtkScrolledWindow:
|
||||
- Stop using scroll cursors
|
||||
|
||||
* GtkMenuButton:
|
||||
- Make focus-on-click work
|
||||
|
||||
* GtkToggleButton:
|
||||
- Make grouped buttons mutually exclusive
|
||||
|
||||
* GtkPasswordEntry:
|
||||
- Use MADV_DONTDUMP for secure memory
|
||||
|
||||
* GtkListBox:
|
||||
- Allow repeated selection extension for MULTIPLE
|
||||
|
||||
* Themes:
|
||||
- Fix resize border sizing
|
||||
- Fix solid-csd window decorations
|
||||
|
||||
* Input:
|
||||
- Revert some Compose sequence changes (mainly around dead
|
||||
acute and apostrophe)
|
||||
- Consume all key events during preedit, to avoid unexpected
|
||||
interactions
|
||||
- Ignore more modifiers during preedit, to allow using 3rd and
|
||||
5th level choosers
|
||||
- Fix handling of cursor positions in non-ASCII preedit text
|
||||
- Fix a problem with deferred focus setting
|
||||
|
||||
* GdkClipboard:
|
||||
- Ensure strings are nul-terminated
|
||||
|
||||
* GSK:
|
||||
- Improvements to the ngl renderer
|
||||
- Fix offscreen rendering with transforms
|
||||
- Fix downscaled textures
|
||||
- Avoid huge intermediate textures
|
||||
- Make shadow rendering match across renderers
|
||||
|
||||
* Accessibility:
|
||||
- Various fixes to get Orca to speak (still a work in progress)
|
||||
|
||||
* Wayland:
|
||||
- Improve font settings fallback
|
||||
- Avoid unintentional rendering freezes with popovers
|
||||
|
||||
* X11:
|
||||
- Don't beep on untrusted displays
|
||||
- Don't crash when popovers are outside the workarea
|
||||
|
||||
* Windows:
|
||||
- Fix using GL rendering with Mesa drivers
|
||||
|
||||
* Inspector:
|
||||
- Enable the inspector by default, in all cases
|
||||
- Improve monitor information
|
||||
|
||||
|
||||
Overview of Changes in 4.2.0
|
||||
============================
|
||||
|
||||
|
||||
@@ -76,6 +76,9 @@
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
#mesondefine HAVE_MMAP
|
||||
|
||||
/* Define to 1 if you have a working `madvise' system call. */
|
||||
#mesondefine HAVE_MADVISE
|
||||
|
||||
/* Define to 1 if you have the `posix_fallocate' function. */
|
||||
#mesondefine HAVE_POSIX_FALLOCATE
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<object class="GtkButton">
|
||||
<property name="valign">center</property>
|
||||
<property name="action-name">win.run</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="label" translatable="yes">Run</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -32,6 +33,7 @@
|
||||
<object class="GtkToggleButton">
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="active" bind-source="searchbar" bind-property="search-mode-enabled" bind-flags="bidirectional|sync-create"/>
|
||||
<accessibility>
|
||||
<property name="label" translatable="yes">Search</property>
|
||||
@@ -41,6 +43,7 @@
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="gear_menu_button">
|
||||
<property name="valign">center</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="menu-model">gear_menu</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<accessibility>
|
||||
|
||||
@@ -25,12 +25,14 @@
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="normal_radio">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="symbolic_radio">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="label" translatable="yes">Symbolic</property>
|
||||
<property name="group">normal_radio</property>
|
||||
<signal name="notify::active" handler="symbolic_toggled" swapped="yes" after="yes"/>
|
||||
@@ -40,6 +42,7 @@
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="gear_menu_button">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="menu-model">gear_menu</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
@@ -47,6 +50,7 @@
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<property name="focus-on-click">0</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="title" translatable="yes">Help</property>
|
||||
<property name="default-width">720</property>
|
||||
<property name="default-height">520</property>
|
||||
<property name="default-width">920</property>
|
||||
<property name="default-height">600</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<child>
|
||||
|
||||
@@ -438,6 +438,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="gear_menu_button">
|
||||
<property name="valign">center</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="popover">
|
||||
<object class="GtkPopoverMenu" id="gear_menu">
|
||||
<property name="menu-model">gear_menu_model</property>
|
||||
|
||||
@@ -21,3 +21,9 @@ show_index_summary = true
|
||||
|
||||
[source-location]
|
||||
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
|
||||
|
||||
[extra]
|
||||
content_images = [
|
||||
"images/gtk-logo.svg",
|
||||
]
|
||||
urlmap_file = "urlmap.js"
|
||||
|
||||
@@ -21,3 +21,9 @@ show_index_summary = true
|
||||
|
||||
[source-location]
|
||||
base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/"
|
||||
|
||||
[extra]
|
||||
content_images = [
|
||||
"images/gtk-logo.svg",
|
||||
]
|
||||
urlmap_file = "urlmap.js"
|
||||
|
||||
@@ -24,17 +24,17 @@ search_index = true
|
||||
[dependencies."Pango-1.0"]
|
||||
name = "Pango"
|
||||
description = "Text shaping and rendering"
|
||||
docs_url = "https://developer.gnome.org/pango/stable"
|
||||
docs_url = "https://docs.gtk.org/Pango/"
|
||||
|
||||
[dependencies."GdkWayland-4.0"]
|
||||
name = "GdkWayland"
|
||||
description = "GDK Wayland Backend"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/"
|
||||
docs_url = "https://docs.gtk.org/gdk4-wayland/"
|
||||
|
||||
[dependencies."GdkX11-4.0"]
|
||||
name = "GdkX11"
|
||||
description = "GDK X11 Backend"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4-x11/"
|
||||
docs_url = "https://docs.gtk.org/gdk4-x11/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
|
||||
@@ -14,22 +14,22 @@ search_index = true
|
||||
[dependencies."GObject-2.0"]
|
||||
name = "GObject"
|
||||
description = "The base type system library"
|
||||
docs_url = "https://developer.gnome.org/gobject/stable"
|
||||
docs_url = "https://developer.gnome.org/gobject/stable/"
|
||||
|
||||
[dependencies."Graphene-1.0"]
|
||||
name = "Graphene"
|
||||
description = "A thin layer of mathematical types for 3D libraries"
|
||||
docs_url = "https://ebassi.github.io/graphene/docs"
|
||||
docs_url = "https://ebassi.github.io/graphene/docs/"
|
||||
|
||||
[dependencies."Pango-1.0"]
|
||||
name = "Pango"
|
||||
description = "Text shaping and rendering"
|
||||
docs_url = "https://developer.gnome.org/pango/stable"
|
||||
docs_url = "https://docs.gtk.org/Pango/"
|
||||
|
||||
[dependencies."Gdk-4.0"]
|
||||
name = "GDK"
|
||||
description = "The GTK windowing system abstraction"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4/"
|
||||
docs_url = "https://docs.gtk.org/gdk4/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
|
||||
@@ -3,27 +3,29 @@ Slug: broadway
|
||||
|
||||
## Using GTK with Broadway
|
||||
|
||||
The GDK Broadway backend provides support for displaying GTK
|
||||
applications in a web browser, using HTML5 and web sockets. To run
|
||||
your application in this way, select the Broadway backend by setting
|
||||
`GDK_BACKEND=broadway`. Then you can make your application appear in
|
||||
a web browser by pointing it at `http://127.0.0.1:8080`. Note that
|
||||
you need to enable web sockets in your web browser.
|
||||
The GDK Broadway backend provides support for displaying GTK applications in
|
||||
a web browser, using HTML5 and web sockets.
|
||||
|
||||
You can choose a different port from the default 8080 by setting
|
||||
the `BROADWAY_DISPLAY` environment variable to the port that you
|
||||
want to use.
|
||||
To run your application in this way, select the Broadway backend by setting
|
||||
`GDK_BACKEND=broadway`. Then you can make your application appear in a web
|
||||
browser by pointing it at `http://127.0.0.1:8080`. Note that you need to
|
||||
enable web sockets in your web browser.
|
||||
|
||||
It is also possible to use multiple GTK applications in the same
|
||||
web browser window, by using the Broadway server, `broadwayd`, that
|
||||
ships with GTK. To use broadwayd, start it like this:
|
||||
You can choose a different port from the default 8080 by setting the
|
||||
`BROADWAY_DISPLAY` environment variable to the port that you want to use.
|
||||
|
||||
It is also possible to use multiple GTK applications in the same web browser
|
||||
window, by using the Broadway server, `gtk4-broadwayd`, that ships with GTK.
|
||||
To start the Broadway server use:
|
||||
|
||||
```
|
||||
broadwayd :5
|
||||
gtk4-broadwayd :5
|
||||
```
|
||||
|
||||
Then point your web browser at `http://127.0.0.1:8085`.
|
||||
Start your applications like this:
|
||||
|
||||
Once the Broadway server is running, you can start your applications like
|
||||
this:
|
||||
|
||||
```
|
||||
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk4-demo
|
||||
@@ -31,9 +33,13 @@ GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk4-demo
|
||||
|
||||
## Broadway-specific environment variables
|
||||
|
||||
### BROADWAY\_DISPLAY
|
||||
### `BROADWAY_DISPLAY`
|
||||
|
||||
Specifies the Broadway display number. The default display is 0.
|
||||
The display number determines the port to use when connecting
|
||||
to a Broadway application via the following formula:
|
||||
`port = 8080 + display`
|
||||
|
||||
The display number determines the port to use when connecting to a Broadway
|
||||
application via the following formula:
|
||||
|
||||
```
|
||||
port = 8080 + display
|
||||
```
|
||||
|
||||
@@ -24,17 +24,17 @@ search_index = true
|
||||
[dependencies."Pango-1.0"]
|
||||
name = "Pango"
|
||||
description = "Text shaping and rendering"
|
||||
docs_url = "https://developer.gnome.org/pango/stable"
|
||||
docs_url = "https://docs.gtk.org/Pango/"
|
||||
|
||||
[dependencies."Gdk-4.0"]
|
||||
name = "GDK"
|
||||
description = "The GTK windowing system abstraction"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4/"
|
||||
docs_url = "https://docs.gtk.org/gdk4/"
|
||||
|
||||
[dependencies."Gsk-4.0"]
|
||||
name = "GSK"
|
||||
description = "The GTK rendering abstraction"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gsk4/"
|
||||
docs_url = "https://docs.gtk.org/gsk4/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
|
||||
@@ -70,16 +70,21 @@ if get_option('man-pages') and xsltproc.found()
|
||||
man_files = [
|
||||
[ 'gtk4-broadwayd', '1', ],
|
||||
[ 'gtk4-builder-tool', '1', ],
|
||||
[ 'gtk4-demo', '1', ],
|
||||
[ 'gtk4-demo-application', '1', ],
|
||||
[ 'gtk4-encode-symbolic-svg', '1', ],
|
||||
[ 'gtk4-icon-browser', '1', ],
|
||||
[ 'gtk4-launch', '1', ],
|
||||
[ 'gtk4-query-settings', '1', ],
|
||||
[ 'gtk4-update-icon-cache', '1', ],
|
||||
[ 'gtk4-widget-factory', '1', ],
|
||||
]
|
||||
|
||||
if get_option('demos')
|
||||
man_files += [
|
||||
[ 'gtk4-demo', '1', ],
|
||||
[ 'gtk4-demo-application', '1', ],
|
||||
[ 'gtk4-widget-factory', '1', ],
|
||||
[ 'gtk4-icon-browser', '1', ],
|
||||
]
|
||||
endif
|
||||
|
||||
foreach man: man_files
|
||||
man_name = man.get(0)
|
||||
man_section = man.get(1, '1')
|
||||
|
||||
@@ -271,7 +271,7 @@ holds a reference on them, and GTK holds a reference on toplevel windows.
|
||||
and cause the whole widget hierarchy to be finalized unless there are other
|
||||
references that keep widgets alive.
|
||||
|
||||
The [signals@Gtk.Widget::destroy] signal is emitted when a widget is
|
||||
The [signal@Gtk.Widget::destroy] signal is emitted when a widget is
|
||||
disposed, and therefore can no longer be used to break reference cycles. A
|
||||
typical sign of a reference cycle involving a toplevel window is when
|
||||
closing the window does not make the application quit.
|
||||
@@ -555,7 +555,7 @@ for you, so templates work like before.
|
||||
A few changes to the event controller and [class@Gtk.Gesture] APIs
|
||||
did not make it back to GTK 3, and have to be taken into account
|
||||
when moving to GTK 4. One is that the [signal@Gtk.EventControllerMotion::enter]
|
||||
and [signals@Gtk.EventControllerMotion::leave] signals have gained new arguments.
|
||||
and [signal@Gtk.EventControllerMotion::leave] signals have gained new arguments.
|
||||
Another is that `GtkGestureMultiPress` has been renamed to [class@Gtk.GestureClick],
|
||||
and has lost its area property. A [class@Gtk.EventControllerFocus] has been
|
||||
split off from [class@Gtk.EventControllerKey].
|
||||
|
||||
@@ -3,7 +3,7 @@ toml_conf.set('version', meson.project_version())
|
||||
|
||||
gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
|
||||
|
||||
docs_dir = gtk_datadir / 'doc/gtk4/reference'
|
||||
docs_dir = gtk_datadir / 'doc'
|
||||
|
||||
subdir('gdk')
|
||||
subdir('gsk')
|
||||
|
||||
+11
-11
@@ -554,19 +554,19 @@ gdk_clipboard_store_async (GdkClipboard *clipboard,
|
||||
|
||||
if (priv->local)
|
||||
{
|
||||
return GDK_CLIPBOARD_GET_CLASS (clipboard)->store_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
GDK_CLIPBOARD_GET_CLASS (clipboard)->store_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
return gdk_clipboard_store_default_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
gdk_clipboard_store_default_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -905,7 +905,7 @@ gdk_clipboard_read_value_finish (GdkClipboard *clipboard,
|
||||
* call [method@Gdk.Clipboard.read_texture_finish] to get the result.
|
||||
*
|
||||
* This is a simple wrapper around [method@Gdk.Clipboard.read_value_async].
|
||||
* Use that function or [methos@Gdk.Clipboard.read_async] directly if you
|
||||
* Use that function or [method@Gdk.Clipboard.read_async] directly if you
|
||||
* need more control over the operation.
|
||||
*/
|
||||
void
|
||||
|
||||
@@ -672,9 +672,18 @@ string_deserializer_finish (GObject *source,
|
||||
}
|
||||
else
|
||||
{
|
||||
GOutputStream *mem_stream = g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (stream));
|
||||
|
||||
/* write a terminating NULL byte */
|
||||
if (g_output_stream_write (mem_stream, "", 1, NULL, &error) < 0 ||
|
||||
!g_output_stream_close (mem_stream, NULL, &error))
|
||||
{
|
||||
gdk_content_deserializer_return_error (deserializer, error);
|
||||
return;
|
||||
}
|
||||
|
||||
g_value_take_string (gdk_content_deserializer_get_value (deserializer),
|
||||
g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (
|
||||
g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (stream)))));
|
||||
g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (mem_stream)));
|
||||
}
|
||||
gdk_content_deserializer_return_success (deserializer);
|
||||
}
|
||||
@@ -703,7 +712,7 @@ string_deserializer (GdkContentDeserializer *deserializer)
|
||||
|
||||
g_output_stream_splice_async (filter,
|
||||
gdk_content_deserializer_get_input_stream (deserializer),
|
||||
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
|
||||
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE,
|
||||
gdk_content_deserializer_get_priority (deserializer),
|
||||
gdk_content_deserializer_get_cancellable (deserializer),
|
||||
string_deserializer_finish,
|
||||
@@ -731,7 +740,8 @@ file_uri_deserializer_finish (GObject *source,
|
||||
}
|
||||
|
||||
/* write terminating NULL */
|
||||
if (!g_output_stream_write (stream, "", 1, NULL, &error))
|
||||
if (g_output_stream_write (stream, "", 1, NULL, &error) < 0 ||
|
||||
!g_output_stream_close (stream, NULL, &error))
|
||||
{
|
||||
gdk_content_deserializer_return_error (deserializer, error);
|
||||
return;
|
||||
@@ -771,7 +781,7 @@ file_uri_deserializer (GdkContentDeserializer *deserializer)
|
||||
|
||||
g_output_stream_splice_async (output,
|
||||
gdk_content_deserializer_get_input_stream (deserializer),
|
||||
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
|
||||
G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE,
|
||||
gdk_content_deserializer_get_priority (deserializer),
|
||||
gdk_content_deserializer_get_cancellable (deserializer),
|
||||
file_uri_deserializer_finish,
|
||||
@@ -921,7 +931,7 @@ init (void)
|
||||
gdk_content_register_deserializer (mime,
|
||||
G_TYPE_STRING,
|
||||
string_deserializer,
|
||||
mime,
|
||||
(gpointer) charset,
|
||||
g_free);
|
||||
}
|
||||
gdk_content_register_deserializer ("text/plain",
|
||||
|
||||
@@ -461,7 +461,7 @@ gdk_content_formats_contain_mime_type (const GdkContentFormats *formats,
|
||||
* Note that @formats may not contain any #GTypes, in particular when
|
||||
* they are empty. In that case %NULL will be returned.
|
||||
*
|
||||
* Returns: (transfer none) (nullable) (array length=n_gtypes):
|
||||
* Returns: (transfer none) (nullable) (array length=n_gtypes zero-terminated=1):
|
||||
* %G_TYPE_INVALID-terminated array of types included in @formats or
|
||||
* %NULL if none.
|
||||
*/
|
||||
@@ -480,7 +480,7 @@ gdk_content_formats_get_gtypes (const GdkContentFormats *formats,
|
||||
/**
|
||||
* gdk_content_formats_get_mime_types:
|
||||
* @formats: a `GdkContentFormats`
|
||||
* @n_mime_types: (out) (allow-none): optional pointer to take the
|
||||
* @n_mime_types: (out) (optional): optional pointer to take the
|
||||
* number of mime types contained in the return value
|
||||
*
|
||||
* Gets the mime types included in @formats.
|
||||
@@ -488,7 +488,7 @@ gdk_content_formats_get_gtypes (const GdkContentFormats *formats,
|
||||
* Note that @formats may not contain any mime types, in particular
|
||||
* when they are empty. In that case %NULL will be returned.
|
||||
*
|
||||
* Returns: (transfer none) (nullable): %NULL-terminated array of
|
||||
* Returns: (transfer none) (nullable) (array length=n_mime_types zero-terminated=1): %NULL-terminated array of
|
||||
* interned strings of mime types included in @formats or %NULL
|
||||
* if none.
|
||||
*/
|
||||
|
||||
@@ -377,7 +377,7 @@ gdk_content_provider_attach_clipboard (GdkContentProvider *provider,
|
||||
g_return_if_fail (GDK_IS_CONTENT_PROVIDER (provider));
|
||||
g_return_if_fail (GDK_IS_CLIPBOARD (clipboard));
|
||||
|
||||
return GDK_CONTENT_PROVIDER_GET_CLASS (provider)->attach_clipboard (provider, clipboard);
|
||||
GDK_CONTENT_PROVIDER_GET_CLASS (provider)->attach_clipboard (provider, clipboard);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -387,5 +387,5 @@ gdk_content_provider_detach_clipboard (GdkContentProvider *provider,
|
||||
g_return_if_fail (GDK_IS_CONTENT_PROVIDER (provider));
|
||||
g_return_if_fail (GDK_IS_CLIPBOARD (clipboard));
|
||||
|
||||
return GDK_CONTENT_PROVIDER_GET_CLASS (provider)->detach_clipboard (provider, clipboard);
|
||||
GDK_CONTENT_PROVIDER_GET_CLASS (provider)->detach_clipboard (provider, clipboard);
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
* `GdkFrameClock` class for documentation of the phases.
|
||||
* %GDK_FRAME_CLOCK_PHASE_UPDATE and the [signal@GdkFrameClock::update] signal
|
||||
* are most interesting for application writers, and are used to update the
|
||||
* animations, using the frame time given by [metohd@Gdk.FrameClock.get_frame_time].
|
||||
* animations, using the frame time given by [method@Gdk.FrameClock.get_frame_time].
|
||||
*
|
||||
* The frame time is reported in microseconds and generally in the same
|
||||
* timescale as g_get_monotonic_time(), however, it is not the same
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* GdkPopupLayout:
|
||||
*
|
||||
* The `GdkPopupLayout` struct contains information that is
|
||||
* necessary position a [interface@Gdk.Popup] relative to its parent.
|
||||
* necessary position a [iface@Gdk.Popup] relative to its parent.
|
||||
*
|
||||
* The positioning requires a negotiation with the windowing system,
|
||||
* since it depends on external constraints, such as the position of
|
||||
|
||||
+10
-4
@@ -1299,12 +1299,11 @@ gdk_surface_schedule_update (GdkSurface *surface)
|
||||
|
||||
g_return_if_fail (surface);
|
||||
|
||||
surface->pending_phases |= GDK_FRAME_CLOCK_PHASE_PAINT;
|
||||
|
||||
if (surface->update_freeze_count ||
|
||||
gdk_surface_is_toplevel_frozen (surface))
|
||||
{
|
||||
surface->pending_phases |= GDK_FRAME_CLOCK_PHASE_PAINT;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
/* If there's no frame clock (a foreign surface), then the invalid
|
||||
* region will just stick around unless gdk_surface_process_updates()
|
||||
@@ -2444,6 +2443,7 @@ gdk_surface_ensure_motion (GdkSurface *surface)
|
||||
GdkEvent *event;
|
||||
double x, y;
|
||||
GdkModifierType state;
|
||||
GdkSurface *grab_surface;
|
||||
|
||||
if (!surface->request_motion)
|
||||
return;
|
||||
@@ -2460,6 +2460,12 @@ gdk_surface_ensure_motion (GdkSurface *surface)
|
||||
if (!gdk_surface_get_device_position (surface, device, &x, &y, &state))
|
||||
return;
|
||||
|
||||
if (gdk_device_grab_info (display, device, &grab_surface, NULL))
|
||||
{
|
||||
if (grab_surface != surface)
|
||||
return;
|
||||
}
|
||||
|
||||
event = gdk_motion_event_new (surface,
|
||||
device,
|
||||
NULL,
|
||||
|
||||
+1
-1
@@ -446,7 +446,7 @@ gdk_texture_download_area (GdkTexture *texture,
|
||||
g_assert (area->x + area->width <= texture->width);
|
||||
g_assert (area->y + area->height <= texture->height);
|
||||
|
||||
return GDK_TEXTURE_GET_CLASS (texture)->download (texture, area, data, stride);
|
||||
GDK_TEXTURE_GET_CLASS (texture)->download (texture, area, data, stride);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -364,7 +364,7 @@ gdk_toplevel_focus (GdkToplevel *toplevel,
|
||||
{
|
||||
g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
|
||||
|
||||
return GDK_TOPLEVEL_GET_IFACE (toplevel)->focus (toplevel, timestamp);
|
||||
GDK_TOPLEVEL_GET_IFACE (toplevel)->focus (toplevel, timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -145,6 +145,7 @@ ensure_gl_view (GdkMacosGLContext *self)
|
||||
[nsview setPostsFrameChangedNotifications: YES];
|
||||
[nsview setNeedsDisplay:YES];
|
||||
[nswindow setContentView:nsview];
|
||||
[nswindow makeFirstResponder:nsview];
|
||||
[nsview release];
|
||||
|
||||
if (self->dummy_view != NULL)
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define HAVE_MEMFD_CREATE
|
||||
#ifdef HAVE_MEMFD_CREATE
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
@@ -1518,6 +1518,7 @@ pointer_handle_leave (void *data,
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkEvent *event;
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkDeviceGrabInfo *grab;
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
@@ -1529,8 +1530,11 @@ pointer_handle_leave (void *data,
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
grab = _gdk_display_get_last_device_grab (seat->display,
|
||||
seat->logical_pointer);
|
||||
|
||||
if (seat->pointer_info.button_modifiers != 0)
|
||||
if (seat->pointer_info.button_modifiers != 0 &&
|
||||
grab && grab->implicit)
|
||||
{
|
||||
gulong display_serial;
|
||||
|
||||
|
||||
@@ -256,122 +256,23 @@ postpone_on_globals_closure (GdkWaylandDisplay *display_wayland,
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
static const char *
|
||||
get_format_name (enum wl_shm_format format)
|
||||
get_format_name (uint32_t format,
|
||||
char name[10])
|
||||
{
|
||||
int i;
|
||||
#define FORMAT(s) { WL_SHM_FORMAT_ ## s, #s }
|
||||
struct { int format; const char *name; } formats[] = {
|
||||
FORMAT(ARGB8888),
|
||||
FORMAT(XRGB8888),
|
||||
FORMAT(C8),
|
||||
FORMAT(RGB332),
|
||||
FORMAT(BGR233),
|
||||
FORMAT(XRGB4444),
|
||||
FORMAT(XBGR4444),
|
||||
FORMAT(RGBX4444),
|
||||
FORMAT(BGRX4444),
|
||||
FORMAT(ARGB4444),
|
||||
FORMAT(ABGR4444),
|
||||
FORMAT(RGBA4444),
|
||||
FORMAT(BGRA4444),
|
||||
FORMAT(XRGB1555),
|
||||
FORMAT(XBGR1555),
|
||||
FORMAT(RGBX5551),
|
||||
FORMAT(BGRX5551),
|
||||
FORMAT(ARGB1555),
|
||||
FORMAT(ABGR1555),
|
||||
FORMAT(RGBA5551),
|
||||
FORMAT(BGRA5551),
|
||||
FORMAT(RGB565),
|
||||
FORMAT(BGR565),
|
||||
FORMAT(RGB888),
|
||||
FORMAT(BGR888),
|
||||
FORMAT(XBGR8888),
|
||||
FORMAT(RGBX8888),
|
||||
FORMAT(BGRX8888),
|
||||
FORMAT(ABGR8888),
|
||||
FORMAT(RGBA8888),
|
||||
FORMAT(BGRA8888),
|
||||
FORMAT(XRGB2101010),
|
||||
FORMAT(XBGR2101010),
|
||||
FORMAT(RGBX1010102),
|
||||
FORMAT(BGRX1010102),
|
||||
FORMAT(ARGB2101010),
|
||||
FORMAT(ABGR2101010),
|
||||
FORMAT(RGBA1010102),
|
||||
FORMAT(BGRA1010102),
|
||||
FORMAT(YUYV),
|
||||
FORMAT(YVYU),
|
||||
FORMAT(UYVY),
|
||||
FORMAT(VYUY),
|
||||
FORMAT(AYUV),
|
||||
FORMAT(NV12),
|
||||
FORMAT(NV21),
|
||||
FORMAT(NV16),
|
||||
FORMAT(NV61),
|
||||
FORMAT(YUV410),
|
||||
FORMAT(YVU410),
|
||||
FORMAT(YUV411),
|
||||
FORMAT(YVU411),
|
||||
FORMAT(YUV420),
|
||||
FORMAT(YVU420),
|
||||
FORMAT(YUV422),
|
||||
FORMAT(YVU422),
|
||||
FORMAT(YUV444),
|
||||
FORMAT(YVU444),
|
||||
FORMAT(R8),
|
||||
FORMAT(R16),
|
||||
FORMAT(RG88),
|
||||
FORMAT(GR88),
|
||||
FORMAT(RG1616),
|
||||
FORMAT(GR1616),
|
||||
FORMAT(XRGB16161616F),
|
||||
FORMAT(XBGR16161616F),
|
||||
FORMAT(ARGB16161616F),
|
||||
FORMAT(ABGR16161616F),
|
||||
FORMAT(XYUV8888),
|
||||
FORMAT(VUY888),
|
||||
FORMAT(VUY101010),
|
||||
FORMAT(Y210),
|
||||
FORMAT(Y212),
|
||||
FORMAT(Y216),
|
||||
FORMAT(Y410),
|
||||
FORMAT(Y412),
|
||||
FORMAT(Y416),
|
||||
FORMAT(XVYU12_16161616),
|
||||
FORMAT(XVYU16161616),
|
||||
FORMAT(Y0L0),
|
||||
FORMAT(X0L0),
|
||||
FORMAT(Y0L2),
|
||||
FORMAT(X0L2),
|
||||
FORMAT(YUV420_8BIT),
|
||||
FORMAT(YUV420_10BIT),
|
||||
FORMAT(XRGB8888_A8),
|
||||
FORMAT(XBGR8888_A8),
|
||||
FORMAT(RGBX8888_A8),
|
||||
FORMAT(BGRX8888_A8),
|
||||
FORMAT(RGB888_A8),
|
||||
FORMAT(BGR888_A8),
|
||||
FORMAT(RGB565_A8),
|
||||
FORMAT(BGR565_A8),
|
||||
FORMAT(NV24),
|
||||
FORMAT(NV42),
|
||||
FORMAT(P210),
|
||||
FORMAT(P010),
|
||||
FORMAT(P012),
|
||||
FORMAT(P016),
|
||||
if (format == 0)
|
||||
g_strlcpy (name, "ARGB8888", 10);
|
||||
else if (format == 1)
|
||||
g_strlcpy (name, "XRGB8888", 10);
|
||||
else
|
||||
g_snprintf (name, 10, "4cc %c%c%c%c",
|
||||
(char) (format & 0xff),
|
||||
(char) ((format >> 8) & 0xff),
|
||||
(char) ((format >> 16) & 0xff),
|
||||
(char) ((format >> 24) & 0xff));
|
||||
|
||||
{ 0xffffffff, NULL }
|
||||
};
|
||||
#undef FORMAT
|
||||
|
||||
for (i = 0; formats[i].name; i++)
|
||||
{
|
||||
if (formats[i].format == format)
|
||||
return formats[i].name;
|
||||
}
|
||||
return NULL;
|
||||
return name;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
@@ -379,7 +280,10 @@ wl_shm_format (void *data,
|
||||
struct wl_shm *wl_shm,
|
||||
uint32_t format)
|
||||
{
|
||||
GDK_NOTE (MISC, g_message ("supported pixel format %s", get_format_name (format)));
|
||||
GDK_NOTE (MISC,
|
||||
char buf[10];
|
||||
g_message ("supported pixel format %s", get_format_name (format, buf));
|
||||
);
|
||||
}
|
||||
|
||||
static const struct wl_shm_listener wl_shm_listener = {
|
||||
@@ -1708,13 +1612,13 @@ static TranslationEntry translations[] = {
|
||||
{ FALSE, "org.gnome.desktop.privacy", "recent-files-max-age", "gtk-recent-files-max-age", G_TYPE_INT, { .i = 30 } },
|
||||
{ FALSE, "org.gnome.desktop.privacy", "remember-recent-files", "gtk-recent-files-enabled", G_TYPE_BOOLEAN, { .b = TRUE } },
|
||||
{ FALSE, "org.gnome.desktop.wm.preferences", "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 1 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 1 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 1 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 1 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "text-scaling-factor", "gtk-xft-dpi" , G_TYPE_NONE, { .i = 0 } }, /* We store the factor as 16.16 */
|
||||
{ FALSE, "org.gnome.desktop.wm.preferences", "action-double-click-titlebar", "gtk-titlebar-double-click", G_TYPE_STRING, { .s = "toggle-maximize" } },
|
||||
@@ -1917,6 +1821,14 @@ init_settings (GdkDisplay *display)
|
||||
|
||||
g_variant_get (ret, "(a{sa{sv}})", &iter);
|
||||
|
||||
if (g_variant_n_children (ret) == 0)
|
||||
{
|
||||
g_debug ("Received no portal settings");
|
||||
g_clear_pointer (&ret, g_variant_unref);
|
||||
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
while (g_variant_iter_loop (iter, "{s@a{sv}}", &schema_str, &val))
|
||||
{
|
||||
GVariantIter *iter2 = g_variant_iter_new (val);
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
*
|
||||
* The Wayland implementation of `GdkToplevel`.
|
||||
*
|
||||
* Beyond the [interface@Gdk.Toplevel] API, the Wayland implementation
|
||||
* Beyond the [iface@Gdk.Toplevel] API, the Wayland implementation
|
||||
* has API to set up cross-process parent-child relationships between
|
||||
* surfaces with [method@GdkWayland.WaylandToplevel.export_handle] and
|
||||
* [method@GdkWayland.WaylandToplevel.set_transient_for_exported].
|
||||
|
||||
@@ -2345,8 +2345,8 @@ gdk_dnd_handle_motion_event (GdkDrag *drag,
|
||||
state = gdk_event_get_modifier_state (event);
|
||||
gdk_event_get_position (event, &x, &y);
|
||||
|
||||
x_root = x + _gdk_offset_x;
|
||||
y_root = y + _gdk_offset_y;
|
||||
x_root = event->surface->x + x;
|
||||
y_root = event->surface->y + y;
|
||||
|
||||
if (drag_win32->drag_surface)
|
||||
move_drag_surface (drag, x_root, y_root);
|
||||
|
||||
@@ -2343,7 +2343,6 @@ gdk_event_translate (MSG *msg,
|
||||
current_root_x = (msg->pt.x + _gdk_offset_x) / impl->surface_scale;
|
||||
current_root_y = (msg->pt.y + _gdk_offset_y) / impl->surface_scale;
|
||||
|
||||
|
||||
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
|
||||
gdk_win32_surface_do_move_resize_drag (window, current_root_x, current_root_y);
|
||||
else if (_gdk_input_ignore_core == 0)
|
||||
|
||||
@@ -712,20 +712,30 @@ _set_pixformat_for_hdc (HDC hdc,
|
||||
int *best_idx,
|
||||
GdkWin32Display *display)
|
||||
{
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
gboolean set_pixel_format_result = FALSE;
|
||||
gboolean already_checked = TRUE;
|
||||
*best_idx = GetPixelFormat (hdc);
|
||||
|
||||
/* one is only allowed to call SetPixelFormat(), and so ChoosePixelFormat()
|
||||
* one single time per window HDC
|
||||
*/
|
||||
*best_idx = _get_wgl_pfd (hdc, &pfd, display);
|
||||
if (*best_idx == 0)
|
||||
{
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
gboolean set_pixel_format_result = FALSE;
|
||||
|
||||
if (*best_idx != 0)
|
||||
set_pixel_format_result = SetPixelFormat (hdc, *best_idx, &pfd);
|
||||
GDK_NOTE (OPENGL, g_print ("requesting pixel format...\n"));
|
||||
already_checked = FALSE;
|
||||
*best_idx = _get_wgl_pfd (hdc, &pfd, display);
|
||||
|
||||
/* ChoosePixelFormat() or SetPixelFormat() failed, bail out */
|
||||
if (*best_idx == 0 || !set_pixel_format_result)
|
||||
return FALSE;
|
||||
if (*best_idx != 0)
|
||||
set_pixel_format_result = SetPixelFormat (hdc, *best_idx, &pfd);
|
||||
|
||||
/* ChoosePixelFormat() or SetPixelFormat() failed, bail out */
|
||||
if (*best_idx == 0 || !set_pixel_format_result)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GDK_NOTE (OPENGL, g_print ("%s""requested and set pixel format: %d\n", already_checked ? "already " : "", *best_idx));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1227,6 +1227,7 @@ gdk_win32_surface_layout_popup (GdkSurface *surface,
|
||||
&shadow_right,
|
||||
&shadow_top,
|
||||
&shadow_bottom);
|
||||
|
||||
gdk_win32_surface_set_shadow_width (surface,
|
||||
shadow_left,
|
||||
shadow_right,
|
||||
@@ -1236,10 +1237,10 @@ gdk_win32_surface_layout_popup (GdkSurface *surface,
|
||||
gdk_surface_layout_popup_helper (surface,
|
||||
width,
|
||||
height,
|
||||
impl->shadow.left,
|
||||
impl->shadow.right,
|
||||
impl->shadow.top,
|
||||
impl->shadow.bottom,
|
||||
shadow_left,
|
||||
shadow_right,
|
||||
shadow_top,
|
||||
shadow_bottom,
|
||||
monitor,
|
||||
&bounds,
|
||||
layout,
|
||||
@@ -1259,9 +1260,7 @@ gdk_win32_surface_layout_popup (GdkSurface *surface,
|
||||
final_rect.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_win32_surface_move (surface, x, y);
|
||||
}
|
||||
gdk_win32_surface_move (surface, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4415,9 +4414,9 @@ gdk_win32_surface_set_shadow_width (GdkSurface *window,
|
||||
if (impl->zero_shadow)
|
||||
return;
|
||||
|
||||
impl->shadow.left = left;
|
||||
impl->shadow.left = left * impl->surface_scale;;
|
||||
impl->shadow.right = right * impl->surface_scale;
|
||||
impl->shadow.top = top;
|
||||
impl->shadow.top = top * impl->surface_scale;;
|
||||
impl->shadow.bottom = bottom * impl->surface_scale;
|
||||
impl->shadow_x = left + right;
|
||||
impl->shadow_y = top + bottom;
|
||||
@@ -4553,7 +4552,7 @@ _gdk_win32_surface_request_layout (GdkSurface *surface)
|
||||
int scale = impl->surface_scale;
|
||||
RECT rect;
|
||||
|
||||
if (GDK_IS_TOPLEVEL (surface) && impl->drag_move_resize_context.native_move_resize_pending)
|
||||
if (impl->drag_move_resize_context.native_move_resize_pending)
|
||||
{
|
||||
surface->width = impl->next_layout.configured_width;
|
||||
surface->height = impl->next_layout.configured_height;
|
||||
@@ -4564,8 +4563,18 @@ _gdk_win32_surface_request_layout (GdkSurface *surface)
|
||||
|
||||
impl->next_layout.configured_width = (rect.right - rect.left + scale - 1) / scale;
|
||||
impl->next_layout.configured_height = (rect.bottom - rect.top + scale - 1) / scale;
|
||||
surface->x = rect.left / scale;
|
||||
surface->y = rect.top / scale;
|
||||
|
||||
if (GDK_IS_TOPLEVEL (surface))
|
||||
{
|
||||
surface->x = rect.left / scale;
|
||||
surface->y = rect.top / scale;
|
||||
}
|
||||
else if (GDK_IS_POPUP (surface))
|
||||
{
|
||||
gdk_win32_surface_get_geometry (surface,
|
||||
&surface->x, &surface->y,
|
||||
NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4655,9 +4664,9 @@ gdk_win32_popup_init (GdkWin32Popup *popup)
|
||||
|
||||
static void
|
||||
gdk_win32_popup_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (object);
|
||||
|
||||
@@ -4679,9 +4688,9 @@ gdk_win32_popup_get_property (GObject *object,
|
||||
|
||||
static void
|
||||
gdk_win32_popup_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (object);
|
||||
|
||||
@@ -4716,9 +4725,9 @@ gdk_win32_popup_class_init (GdkWin32PopupClass *class)
|
||||
|
||||
static gboolean
|
||||
gdk_win32_popup_present (GdkPopup *popup,
|
||||
int width,
|
||||
int height,
|
||||
GdkPopupLayout *layout)
|
||||
int width,
|
||||
int height,
|
||||
GdkPopupLayout *layout)
|
||||
{
|
||||
return gdk_win32_surface_present_popup (GDK_SURFACE (popup), width, height, layout);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ get_display_name (GFile *file,
|
||||
if (name == NULL)
|
||||
{
|
||||
name = g_file_get_basename (file);
|
||||
if (name == NULL)
|
||||
name = g_file_get_uri (file);
|
||||
|
||||
if (!g_utf8_validate (name, -1, NULL))
|
||||
{
|
||||
tmp = name;
|
||||
|
||||
@@ -1795,6 +1795,9 @@ _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
|
||||
static void
|
||||
gdk_x11_display_beep (GdkDisplay *display)
|
||||
{
|
||||
if (!GDK_X11_DISPLAY (display)->trusted_client)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None);
|
||||
#else
|
||||
|
||||
+6
-17
@@ -185,24 +185,13 @@ gdk_x_io_error (Display *display)
|
||||
/* This is basically modelled after the code in XLib. We need
|
||||
* an explicit error handler here, so we can disable our atexit()
|
||||
* which would otherwise cause a nice segfault.
|
||||
* We fprintf(stderr, instead of g_warning() because g_warning()
|
||||
* could possibly be redirected to a dialog
|
||||
* We g_debug() instead of g_warning(), because g_warning()
|
||||
* could possibly be redirected to the log
|
||||
*/
|
||||
if (errno == EPIPE)
|
||||
{
|
||||
g_message ("The application '%s' lost its connection to the display %s;\n"
|
||||
"most likely the X server was shut down or you killed/destroyed\n"
|
||||
"the application.\n",
|
||||
g_get_prgname (),
|
||||
display ? DisplayString (display) : NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_message ("%s: Fatal IO error %d (%s) on X server %s.\n",
|
||||
g_get_prgname (),
|
||||
errno, g_strerror (errno),
|
||||
display ? DisplayString (display) : NULL);
|
||||
}
|
||||
g_debug ("%s: Fatal IO error %d (%s) on X server %s.\n",
|
||||
g_get_prgname (),
|
||||
errno, g_strerror (errno),
|
||||
display ? DisplayString (display) : "");
|
||||
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
@@ -1822,9 +1822,16 @@ gdk_x11_surface_layout_popup (GdkSurface *surface,
|
||||
|
||||
monitor = gdk_surface_get_layout_monitor (surface, layout,
|
||||
gdk_x11_monitor_get_workarea);
|
||||
gdk_x11_monitor_get_workarea (monitor, &bounds);
|
||||
if (monitor)
|
||||
gdk_x11_monitor_get_workarea (monitor, &bounds);
|
||||
else
|
||||
{
|
||||
monitor = gdk_surface_get_layout_monitor (surface, layout,
|
||||
gdk_monitor_get_geometry);
|
||||
gdk_monitor_get_geometry (monitor, &bounds);
|
||||
}
|
||||
|
||||
gdk_popup_layout_get_shadow_width (layout,
|
||||
gdk_popup_layout_get_shadow_width (layout,
|
||||
&impl->shadow_left,
|
||||
&impl->shadow_right,
|
||||
&impl->shadow_top,
|
||||
@@ -4367,6 +4374,7 @@ create_moveresize_surface (MoveResizeData *mv_resize,
|
||||
NULL,
|
||||
-100, -100, 1, 1);
|
||||
|
||||
gdk_surface_set_is_mapped (mv_resize->moveresize_emulation_surface, TRUE);
|
||||
gdk_x11_surface_show (mv_resize->moveresize_emulation_surface, FALSE);
|
||||
|
||||
status = gdk_seat_grab (gdk_device_get_seat (mv_resize->device),
|
||||
@@ -4542,6 +4550,9 @@ gdk_x11_surface_beep (GdkSurface *surface)
|
||||
|
||||
display = GDK_SURFACE_DISPLAY (surface);
|
||||
|
||||
if (!GDK_X11_DISPLAY (display)->trusted_client)
|
||||
return FALSE;
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
if (GDK_X11_DISPLAY (display)->use_xkb)
|
||||
{
|
||||
|
||||
+7
-7
@@ -549,14 +549,14 @@ gsk_render_node_diff (GskRenderNode *node1,
|
||||
return;
|
||||
|
||||
if (_gsk_render_node_get_node_type (node1) == _gsk_render_node_get_node_type (node2))
|
||||
return GSK_RENDER_NODE_GET_CLASS (node1)->diff (node1, node2, region);
|
||||
GSK_RENDER_NODE_GET_CLASS (node1)->diff (node1, node2, region);
|
||||
|
||||
if (_gsk_render_node_get_node_type (node1) == GSK_CONTAINER_NODE)
|
||||
return gsk_container_node_diff_with (node1, node2, region);
|
||||
if (_gsk_render_node_get_node_type (node2) == GSK_CONTAINER_NODE)
|
||||
return gsk_container_node_diff_with (node2, node1, region);
|
||||
|
||||
return gsk_render_node_diff_impossible (node1, node2, region);
|
||||
else if (_gsk_render_node_get_node_type (node1) == GSK_CONTAINER_NODE)
|
||||
gsk_container_node_diff_with (node1, node2, region);
|
||||
else if (_gsk_render_node_get_node_type (node2) == GSK_CONTAINER_NODE)
|
||||
gsk_container_node_diff_with (node2, node1, region);
|
||||
else
|
||||
gsk_render_node_diff_impossible (node1, node2, region);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+18
-12
@@ -1867,6 +1867,7 @@ gsk_inset_shadow_node_draw (GskRenderNode *node,
|
||||
GskRoundedRect box, clip_box;
|
||||
int clip_radius;
|
||||
double x1c, y1c, x2c, y2c;
|
||||
double blur_radius;
|
||||
|
||||
/* We don't need to draw invisible shadows */
|
||||
if (gdk_rgba_is_clear (&self->color))
|
||||
@@ -1876,7 +1877,9 @@ gsk_inset_shadow_node_draw (GskRenderNode *node,
|
||||
if (!gsk_rounded_rect_intersects_rect (&self->outline, &GRAPHENE_RECT_INIT (x1c, y1c, x2c - x1c, y2c - y1c)))
|
||||
return;
|
||||
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (self->blur_radius);
|
||||
blur_radius = self->blur_radius / 2;
|
||||
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (blur_radius);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
@@ -1890,8 +1893,8 @@ gsk_inset_shadow_node_draw (GskRenderNode *node,
|
||||
gsk_rounded_rect_init_copy (&clip_box, &self->outline);
|
||||
gsk_rounded_rect_shrink (&clip_box, -clip_radius, -clip_radius, -clip_radius, -clip_radius);
|
||||
|
||||
if (!needs_blur (self->blur_radius))
|
||||
draw_shadow (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
if (!needs_blur (blur_radius))
|
||||
draw_shadow (cr, TRUE, &box, &clip_box, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
else
|
||||
{
|
||||
cairo_region_t *remaining;
|
||||
@@ -1922,7 +1925,7 @@ gsk_inset_shadow_node_draw (GskRenderNode *node,
|
||||
/* Always clip with remaining to ensure we never draw any area twice */
|
||||
gdk_cairo_region (cr, remaining);
|
||||
cairo_clip (cr);
|
||||
draw_shadow_corner (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
draw_shadow_corner (cr, TRUE, &box, &clip_box, blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -1936,7 +1939,7 @@ gsk_inset_shadow_node_draw (GskRenderNode *node,
|
||||
/* Always clip with remaining to ensure we never draw any area twice */
|
||||
gdk_cairo_region (cr, remaining);
|
||||
cairo_clip (cr);
|
||||
draw_shadow_side (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
draw_shadow_side (cr, TRUE, &box, &clip_box, blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -1948,7 +1951,7 @@ gsk_inset_shadow_node_draw (GskRenderNode *node,
|
||||
cairo_save (cr);
|
||||
gdk_cairo_region (cr, remaining);
|
||||
cairo_clip (cr);
|
||||
draw_shadow (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
draw_shadow (cr, TRUE, &box, &clip_box, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_region_destroy (remaining);
|
||||
@@ -2159,6 +2162,7 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
|
||||
int clip_radius;
|
||||
double x1c, y1c, x2c, y2c;
|
||||
float top, right, bottom, left;
|
||||
double blur_radius;
|
||||
|
||||
/* We don't need to draw invisible shadows */
|
||||
if (gdk_rgba_is_clear (&self->color))
|
||||
@@ -2168,7 +2172,9 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
|
||||
if (gsk_rounded_rect_contains_rect (&self->outline, &GRAPHENE_RECT_INIT (x1c, y1c, x2c - x1c, y2c - y1c)))
|
||||
return;
|
||||
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (self->blur_radius);
|
||||
blur_radius = self->blur_radius / 2;
|
||||
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (blur_radius);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
@@ -2186,8 +2192,8 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
|
||||
gsk_rounded_rect_offset (&box, self->dx, self->dy);
|
||||
gsk_rounded_rect_shrink (&box, -self->spread, -self->spread, -self->spread, -self->spread);
|
||||
|
||||
if (!needs_blur (self->blur_radius))
|
||||
draw_shadow (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
if (!needs_blur (blur_radius))
|
||||
draw_shadow (cr, FALSE, &box, &clip_box, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
else
|
||||
{
|
||||
int i;
|
||||
@@ -2217,7 +2223,7 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
|
||||
/* Always clip with remaining to ensure we never draw any area twice */
|
||||
gdk_cairo_region (cr, remaining);
|
||||
cairo_clip (cr);
|
||||
draw_shadow_corner (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
draw_shadow_corner (cr, FALSE, &box, &clip_box, blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -2231,7 +2237,7 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
|
||||
/* Always clip with remaining to ensure we never draw any area twice */
|
||||
gdk_cairo_region (cr, remaining);
|
||||
cairo_clip (cr);
|
||||
draw_shadow_side (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
draw_shadow_side (cr, FALSE, &box, &clip_box, blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -2243,7 +2249,7 @@ gsk_outset_shadow_node_draw (GskRenderNode *node,
|
||||
cairo_save (cr);
|
||||
gdk_cairo_region (cr, remaining);
|
||||
cairo_clip (cr);
|
||||
draw_shadow (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
draw_shadow (cr, FALSE, &box, &clip_box, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_region_destroy (remaining);
|
||||
|
||||
+77
-51
@@ -203,7 +203,7 @@ gsk_rounded_rect_offset (GskRoundedRect *self,
|
||||
return self;
|
||||
}
|
||||
|
||||
static void
|
||||
static inline void
|
||||
border_radius_shrink (graphene_size_t *corner,
|
||||
double width,
|
||||
double height,
|
||||
@@ -252,26 +252,29 @@ gsk_rounded_rect_shrink (GskRoundedRect *self,
|
||||
float bottom,
|
||||
float left)
|
||||
{
|
||||
if (self->bounds.size.width - left - right < 0)
|
||||
float width = left + right;
|
||||
float height = top + bottom;
|
||||
|
||||
if (self->bounds.size.width - width < 0)
|
||||
{
|
||||
self->bounds.origin.x += left * self->bounds.size.width / (left + right);
|
||||
self->bounds.origin.x += left * self->bounds.size.width / width;
|
||||
self->bounds.size.width = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->bounds.origin.x += left;
|
||||
self->bounds.size.width -= left + right;
|
||||
self->bounds.size.width -= width;
|
||||
}
|
||||
|
||||
if (self->bounds.size.height - bottom - top < 0)
|
||||
if (self->bounds.size.height - height < 0)
|
||||
{
|
||||
self->bounds.origin.y += top * self->bounds.size.height / (top + bottom);
|
||||
self->bounds.origin.y += top * self->bounds.size.height / height;
|
||||
self->bounds.size.height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->bounds.origin.y += top;
|
||||
self->bounds.size.height -= top + bottom;
|
||||
self->bounds.size.height -= height;
|
||||
}
|
||||
|
||||
border_radius_shrink (&self->corner[GSK_CORNER_TOP_LEFT], left, top, &self->bounds.size);
|
||||
@@ -311,9 +314,7 @@ gsk_rounded_rect_scale_affine (GskRoundedRect *dest,
|
||||
gboolean
|
||||
gsk_rounded_rect_is_circular (const GskRoundedRect *self)
|
||||
{
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (guint i = 0; i < 4; i++)
|
||||
{
|
||||
if (self->corner[i].width != self->corner[i].height)
|
||||
return FALSE;
|
||||
@@ -337,9 +338,7 @@ gsk_rounded_rect_is_circular (const GskRoundedRect *self)
|
||||
gboolean
|
||||
gsk_rounded_rect_is_rectilinear (const GskRoundedRect *self)
|
||||
{
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (guint i = 0; i < 4; i++)
|
||||
{
|
||||
if (self->corner[i].width > 0 ||
|
||||
self->corner[i].height > 0)
|
||||
@@ -349,8 +348,8 @@ gsk_rounded_rect_is_rectilinear (const GskRoundedRect *self)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ellipsis_contains_point (const graphene_size_t *ellipsis,
|
||||
static inline gboolean
|
||||
ellipsis_contains_point (const graphene_size_t *ellipsis,
|
||||
const graphene_point_t *point)
|
||||
{
|
||||
return (point->x * point->x) / (ellipsis->width * ellipsis->width)
|
||||
@@ -371,46 +370,42 @@ static Location
|
||||
gsk_rounded_rect_locate_point (const GskRoundedRect *self,
|
||||
const graphene_point_t *point)
|
||||
{
|
||||
float px, py;
|
||||
float ox, oy;
|
||||
|
||||
ox = self->bounds.origin.x + self->bounds.size.width;
|
||||
oy = self->bounds.origin.y + self->bounds.size.height;
|
||||
|
||||
if (point->x < self->bounds.origin.x ||
|
||||
point->y < self->bounds.origin.y ||
|
||||
point->x > self->bounds.origin.x + self->bounds.size.width ||
|
||||
point->y > self->bounds.origin.y + self->bounds.size.height)
|
||||
point->x > ox ||
|
||||
point->y > oy)
|
||||
return OUTSIDE;
|
||||
|
||||
if (self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width > point->x &&
|
||||
self->bounds.origin.y + self->corner[GSK_CORNER_TOP_LEFT].height > point->y &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_TOP_LEFT],
|
||||
&GRAPHENE_POINT_INIT (
|
||||
self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width - point->x,
|
||||
self->bounds.origin.y + self->corner[GSK_CORNER_TOP_LEFT].height- point->y
|
||||
)))
|
||||
px = self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width - point->x;
|
||||
py = self->bounds.origin.y + self->corner[GSK_CORNER_TOP_LEFT].height - point->y;
|
||||
if (px > 0 && py > 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_TOP_LEFT], &GRAPHENE_POINT_INIT (px, py)))
|
||||
return OUTSIDE_TOP_LEFT;
|
||||
|
||||
if (self->bounds.origin.x + self->bounds.size.width - self->corner[GSK_CORNER_TOP_RIGHT].width < point->x &&
|
||||
self->bounds.origin.y + self->corner[GSK_CORNER_TOP_RIGHT].height > point->y &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_TOP_RIGHT],
|
||||
&GRAPHENE_POINT_INIT (
|
||||
self->bounds.origin.x + self->bounds.size.width - self->corner[GSK_CORNER_TOP_RIGHT].width - point->x,
|
||||
self->bounds.origin.y + self->corner[GSK_CORNER_TOP_RIGHT].height- point->y
|
||||
)))
|
||||
px = ox - self->corner[GSK_CORNER_TOP_RIGHT].width - point->x;
|
||||
py = self->bounds.origin.y + self->corner[GSK_CORNER_TOP_RIGHT].height - point->y;
|
||||
if (px < 0 && py > 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_TOP_RIGHT], &GRAPHENE_POINT_INIT (px, py)))
|
||||
return OUTSIDE_TOP_RIGHT;
|
||||
|
||||
if (self->bounds.origin.x + self->corner[GSK_CORNER_BOTTOM_LEFT].width > point->x &&
|
||||
self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_LEFT].height < point->y &&
|
||||
px = self->bounds.origin.x + self->corner[GSK_CORNER_BOTTOM_LEFT].width - point->x;
|
||||
py = oy - self->corner[GSK_CORNER_BOTTOM_LEFT].height - point->y;
|
||||
if (px > 0 && py < 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_LEFT],
|
||||
&GRAPHENE_POINT_INIT (
|
||||
self->bounds.origin.x + self->corner[GSK_CORNER_BOTTOM_LEFT].width - point->x,
|
||||
self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_LEFT].height- point->y
|
||||
)))
|
||||
&GRAPHENE_POINT_INIT (px, py)))
|
||||
return OUTSIDE_BOTTOM_LEFT;
|
||||
|
||||
if (self->bounds.origin.x + self->bounds.size.width - self->corner[GSK_CORNER_BOTTOM_RIGHT].width < point->x &&
|
||||
self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_RIGHT].height < point->y &&
|
||||
px = ox - self->corner[GSK_CORNER_BOTTOM_RIGHT].width - point->x;
|
||||
py = oy - self->corner[GSK_CORNER_BOTTOM_RIGHT].height - point->y;
|
||||
if (px < 0 && py < 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_RIGHT],
|
||||
&GRAPHENE_POINT_INIT (
|
||||
self->bounds.origin.x + self->bounds.size.width - self->corner[GSK_CORNER_BOTTOM_RIGHT].width - point->x,
|
||||
self->bounds.origin.y + self->bounds.size.height - self->corner[GSK_CORNER_BOTTOM_RIGHT].height- point->y
|
||||
)))
|
||||
&GRAPHENE_POINT_INIT (px, py)))
|
||||
return OUTSIDE_BOTTOM_RIGHT;
|
||||
|
||||
return INSIDE;
|
||||
@@ -445,16 +440,45 @@ gboolean
|
||||
gsk_rounded_rect_contains_rect (const GskRoundedRect *self,
|
||||
const graphene_rect_t *rect)
|
||||
{
|
||||
float tx, ty;
|
||||
float px, py;
|
||||
float ox, oy;
|
||||
|
||||
tx = rect->origin.x + rect->size.width;
|
||||
ty = rect->origin.y + rect->size.height;
|
||||
ox = self->bounds.origin.x + self->bounds.size.width;
|
||||
oy = self->bounds.origin.y + self->bounds.size.height;
|
||||
|
||||
if (rect->origin.x < self->bounds.origin.x ||
|
||||
rect->origin.y < self->bounds.origin.y ||
|
||||
rect->origin.x + rect->size.width > self->bounds.origin.x + self->bounds.size.width ||
|
||||
rect->origin.y + rect->size.height > self->bounds.origin.y + self->bounds.size.height)
|
||||
tx > ox ||
|
||||
ty > oy)
|
||||
return FALSE;
|
||||
|
||||
if (!gsk_rounded_rect_contains_point (self, &rect->origin) ||
|
||||
!gsk_rounded_rect_contains_point (self, &GRAPHENE_POINT_INIT (rect->origin.x + rect->size.width, rect->origin.y)) ||
|
||||
!gsk_rounded_rect_contains_point (self, &GRAPHENE_POINT_INIT (rect->origin.x, rect->origin.y + rect->size.height)) ||
|
||||
!gsk_rounded_rect_contains_point (self, &GRAPHENE_POINT_INIT (rect->origin.x + rect->size.width, rect->origin.y + rect->size.height)))
|
||||
px = self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width - rect->origin.x;
|
||||
py = self->bounds.origin.y + self->corner[GSK_CORNER_TOP_LEFT].height - rect->origin.y;
|
||||
if (px > 0 && py > 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_TOP_LEFT], &GRAPHENE_POINT_INIT (px, py)))
|
||||
return FALSE;
|
||||
|
||||
px = ox - self->corner[GSK_CORNER_TOP_RIGHT].width - tx;
|
||||
py = self->bounds.origin.y + self->corner[GSK_CORNER_TOP_RIGHT].height - rect->origin.y;
|
||||
if (px < 0 && py > 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_TOP_RIGHT], &GRAPHENE_POINT_INIT (px, py)))
|
||||
return FALSE;
|
||||
|
||||
px = self->bounds.origin.x + self->corner[GSK_CORNER_BOTTOM_LEFT].width - rect->origin.x;
|
||||
py = oy - self->corner[GSK_CORNER_BOTTOM_LEFT].height - ty;
|
||||
if (px > 0 && py < 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_LEFT],
|
||||
&GRAPHENE_POINT_INIT (px, py)))
|
||||
return FALSE;
|
||||
|
||||
px = ox - self->corner[GSK_CORNER_BOTTOM_RIGHT].width - tx;
|
||||
py = oy - self->corner[GSK_CORNER_BOTTOM_RIGHT].height - ty;
|
||||
if (px < 0 && py < 0 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_RIGHT],
|
||||
&GRAPHENE_POINT_INIT (px, py)))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@@ -476,8 +500,10 @@ gsk_rounded_rect_intersects_rect (const GskRoundedRect *self,
|
||||
if (!graphene_rect_intersection (&self->bounds, rect, NULL))
|
||||
return FALSE;
|
||||
|
||||
/* If the bounding boxes intersect but the rectangles don't, one of the rect's corners
|
||||
* must be in the opposite corner's outside region */
|
||||
/* If the bounding boxes intersect but the rectangles don't,
|
||||
* one of the rect's corners must be in the opposite corner's
|
||||
* outside region
|
||||
*/
|
||||
if (gsk_rounded_rect_locate_point (self, &rect->origin) == OUTSIDE_BOTTOM_RIGHT ||
|
||||
gsk_rounded_rect_locate_point (self, &GRAPHENE_POINT_INIT (rect->origin.x + rect->size.width, rect->origin.y)) == OUTSIDE_BOTTOM_LEFT ||
|
||||
gsk_rounded_rect_locate_point (self, &GRAPHENE_POINT_INIT (rect->origin.x, rect->origin.y + rect->size.height)) == OUTSIDE_TOP_RIGHT ||
|
||||
|
||||
@@ -169,7 +169,7 @@ gsk_ngl_command_queue_print_batch (GskNglCommandQueue *self,
|
||||
for (guint i = 0; i < batch->draw.bind_count; i++)
|
||||
{
|
||||
const GskNglCommandBind *bind = &self->batch_binds.items[batch->draw.bind_offset + i];
|
||||
g_print (" Bind[%d]: %u\n", bind->texture, bind->id);
|
||||
g_printerr (" Bind[%d]: %u\n", bind->texture, bind->id);
|
||||
}
|
||||
|
||||
for (guint i = 0; i < batch->draw.uniform_count; i++)
|
||||
@@ -444,9 +444,12 @@ gsk_ngl_command_queue_new (GdkGLContext *context,
|
||||
else
|
||||
self->uniforms = gsk_ngl_uniform_state_new ();
|
||||
|
||||
/* Determine max texture size immediately and restore context */
|
||||
/* Determine max texture size and other limitations immediately
|
||||
* and restore context
|
||||
*/
|
||||
gdk_gl_context_make_current (context);
|
||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &self->max_texture_size);
|
||||
glGetIntegerv (GL_MAX_ELEMENTS_VERTICES, &self->max_elements_vertices);
|
||||
|
||||
return g_steal_pointer (&self);
|
||||
}
|
||||
@@ -617,6 +620,7 @@ gsk_ngl_command_queue_end_draw (GskNglCommandQueue *self)
|
||||
last_batch->any.viewport.height == batch->any.viewport.height &&
|
||||
last_batch->draw.framebuffer == batch->draw.framebuffer &&
|
||||
last_batch->draw.vbo_offset + last_batch->draw.vbo_count == batch->draw.vbo_offset &&
|
||||
last_batch->draw.vbo_count + batch->draw.vbo_count <= self->max_elements_vertices &&
|
||||
snapshots_equal (self, last_batch, batch))
|
||||
{
|
||||
last_batch->draw.vbo_count += batch->draw.vbo_count;
|
||||
|
||||
@@ -231,6 +231,12 @@ struct _GskNglCommandQueue
|
||||
*/
|
||||
int max_texture_size;
|
||||
|
||||
/* Discovered max element count. We must not create batches that contain
|
||||
* more vertices than this number.
|
||||
*/
|
||||
|
||||
int max_elements_vertices;
|
||||
|
||||
/* The index of the last batch in @batches, which may not be the element
|
||||
* at the end of the array, as batches can be reordered. This is used to
|
||||
* update the "next" index when adding a new batch.
|
||||
|
||||
+13
-13
@@ -726,7 +726,7 @@ gsk_ngl_render_job_transform_bounds (GskNglRenderJob *job,
|
||||
/* Our most common transform is 2d-affine, so inline it.
|
||||
* Both identity and 2d-translate are virtually unseen here.
|
||||
*/
|
||||
if G_LIKELY (category == GSK_TRANSFORM_CATEGORY_2D_AFFINE)
|
||||
if G_LIKELY (category >= GSK_TRANSFORM_CATEGORY_2D_AFFINE)
|
||||
{
|
||||
float dx, dy, scale_x, scale_y;
|
||||
|
||||
@@ -1498,20 +1498,14 @@ gsk_ngl_render_job_visit_clipped_child (GskNglRenderJob *job,
|
||||
}
|
||||
else
|
||||
{
|
||||
GskRoundedRect scaled_clip;
|
||||
GskNglRenderOffscreen offscreen = {0};
|
||||
|
||||
offscreen.bounds = &child->bounds;
|
||||
offscreen.bounds = clip;
|
||||
offscreen.force_offscreen = TRUE;
|
||||
offscreen.reset_clip = TRUE;
|
||||
offscreen.do_not_cache = TRUE;
|
||||
|
||||
scaled_clip = GSK_ROUNDED_RECT_INIT ((job->offset_x + clip->origin.x) * job->scale_x,
|
||||
(job->offset_y + clip->origin.y) * job->scale_y,
|
||||
clip->size.width * job->scale_x,
|
||||
clip->size.height * job->scale_y);
|
||||
|
||||
gsk_ngl_render_job_push_clip (job, &scaled_clip);
|
||||
gsk_ngl_render_job_visit_node_with_offscreen (job, child, &offscreen);
|
||||
gsk_ngl_render_job_pop_clip (job);
|
||||
|
||||
g_assert (offscreen.texture_id);
|
||||
|
||||
@@ -1521,7 +1515,7 @@ gsk_ngl_render_job_visit_clipped_child (GskNglRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
gsk_ngl_render_job_draw_offscreen_rect (job, &child->bounds);
|
||||
gsk_ngl_render_job_draw_offscreen_rect (job, clip);
|
||||
gsk_ngl_render_job_end_draw (job);
|
||||
}
|
||||
}
|
||||
@@ -1898,6 +1892,7 @@ gsk_ngl_render_job_visit_transform_node (GskNglRenderJob *job,
|
||||
GskNglRenderOffscreen offscreen = {0};
|
||||
|
||||
offscreen.bounds = &child->bounds;
|
||||
offscreen.force_offscreen = FALSE;
|
||||
offscreen.reset_clip = TRUE;
|
||||
|
||||
if (!result_is_axis_aligned (transform, &child->bounds))
|
||||
@@ -3624,6 +3619,13 @@ gsk_ngl_render_job_visit_node_with_offscreen (GskNglRenderJob *job,
|
||||
render_target->framebuffer_id);
|
||||
}
|
||||
|
||||
if (downscale_x != 1 || downscale_y != 1)
|
||||
{
|
||||
GskTransform *transform = gsk_transform_scale (NULL, downscale_x, downscale_y);
|
||||
gsk_ngl_render_job_push_modelview (job, transform);
|
||||
gsk_transform_unref (transform);
|
||||
}
|
||||
|
||||
gsk_ngl_render_job_transform_bounds (job, offscreen->bounds, &viewport);
|
||||
/* Code above will scale the size with the scale we use in the render ops,
|
||||
* but for the viewport size, we need our own size limited by the texture size */
|
||||
@@ -3632,8 +3634,6 @@ gsk_ngl_render_job_visit_node_with_offscreen (GskNglRenderJob *job,
|
||||
|
||||
gsk_ngl_render_job_set_viewport (job, &viewport, &prev_viewport);
|
||||
gsk_ngl_render_job_set_projection_from_rect (job, &job->viewport, &prev_projection);
|
||||
if (downscale_x != 1 || downscale_y != 1)
|
||||
gsk_ngl_render_job_push_modelview (job, gsk_transform_scale (NULL, downscale_x, downscale_y));
|
||||
prev_alpha = gsk_ngl_render_job_set_alpha (job, 1.0f);
|
||||
|
||||
prev_fbo = gsk_ngl_command_queue_bind_framebuffer (job->command_queue, render_target->framebuffer_id);
|
||||
|
||||
@@ -215,7 +215,17 @@ gsk_ngl_uniform_state_end_frame (GskNglUniformState *state)
|
||||
|
||||
state->values_pos = allocator;
|
||||
|
||||
g_assert (allocator <= state->values_len);
|
||||
/* It can happen that our space requirements grow due to
|
||||
* difference in order increasing padding. As a pragmatic
|
||||
* solution to this, just increase the allocation to cover
|
||||
* the predefined mappins.
|
||||
*/
|
||||
if (allocator > state->values_len)
|
||||
{
|
||||
while (allocator > state->values_len)
|
||||
state->values_len *= 2;
|
||||
state->values_buf = g_realloc (state->values_buf, state->values_len);
|
||||
}
|
||||
|
||||
memset (state->apply_hash, 0, sizeof state->apply_hash);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "gtkatspiutilsprivate.h"
|
||||
#include "gtkdebug.h"
|
||||
|
||||
#include "a11y/atspi/atspi-accessible.h"
|
||||
#include "a11y/atspi/atspi-application.h"
|
||||
#include "a11y/atspi/atspi-cache.h"
|
||||
|
||||
/* Cached item:
|
||||
@@ -61,6 +63,8 @@ struct _GtkAtSpiCache
|
||||
|
||||
/* Re-entrancy guard */
|
||||
gboolean in_get_items;
|
||||
|
||||
GtkAtSpiRoot *root;
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -144,6 +148,36 @@ collect_object (GtkAtSpiCache *self,
|
||||
g_variant_builder_add (builder, "@au", gtk_at_spi_context_get_states (context));
|
||||
}
|
||||
|
||||
static void
|
||||
collect_root (GtkAtSpiCache *self,
|
||||
GVariantBuilder *builder)
|
||||
{
|
||||
g_variant_builder_add (builder, "@(so)", gtk_at_spi_root_to_ref (self->root));
|
||||
g_variant_builder_add (builder, "@(so)", gtk_at_spi_root_to_ref (self->root));
|
||||
|
||||
g_variant_builder_add (builder, "@(so)", gtk_at_spi_null_ref ());
|
||||
|
||||
g_variant_builder_add (builder, "i", -1);
|
||||
g_variant_builder_add (builder, "i", 0);
|
||||
|
||||
GVariantBuilder interfaces = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("as"));
|
||||
|
||||
g_variant_builder_add (&interfaces, "s", atspi_accessible_interface.name);
|
||||
g_variant_builder_add (&interfaces, "s", atspi_application_interface.name);
|
||||
g_variant_builder_add (builder, "@as", g_variant_builder_end (&interfaces));
|
||||
|
||||
g_variant_builder_add (builder, "s", g_get_prgname () ? g_get_prgname () : "Unnamed");
|
||||
|
||||
g_variant_builder_add (builder, "u", ATSPI_ROLE_APPLICATION);
|
||||
|
||||
g_variant_builder_add (builder, "s", g_get_application_name () ? g_get_application_name () : "No description");
|
||||
|
||||
GVariantBuilder states = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("au"));
|
||||
g_variant_builder_add (&states, "u", 0);
|
||||
g_variant_builder_add (&states, "u", 0);
|
||||
g_variant_builder_add (builder, "@au", g_variant_builder_end (&states));
|
||||
}
|
||||
|
||||
static void
|
||||
collect_cached_objects (GtkAtSpiCache *self,
|
||||
GVariantBuilder *builder)
|
||||
@@ -160,6 +194,10 @@ collect_cached_objects (GtkAtSpiCache *self,
|
||||
while (g_hash_table_iter_next (&iter, &key_p, &value_p))
|
||||
g_hash_table_add (collection, value_p);
|
||||
|
||||
g_variant_builder_open (builder, G_VARIANT_TYPE ("(" ITEM_SIGNATURE ")"));
|
||||
collect_root (self, builder);
|
||||
g_variant_builder_close (builder);
|
||||
|
||||
g_hash_table_iter_init (&iter, collection);
|
||||
while (g_hash_table_iter_next (&iter, &key_p, &value_p))
|
||||
{
|
||||
@@ -350,15 +388,21 @@ gtk_at_spi_cache_init (GtkAtSpiCache *self)
|
||||
|
||||
GtkAtSpiCache *
|
||||
gtk_at_spi_cache_new (GDBusConnection *connection,
|
||||
const char *cache_path)
|
||||
const char *cache_path,
|
||||
GtkAtSpiRoot *root)
|
||||
{
|
||||
GtkAtSpiCache *cache;
|
||||
|
||||
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
|
||||
g_return_val_if_fail (cache_path != NULL, NULL);
|
||||
|
||||
return g_object_new (GTK_TYPE_AT_SPI_CACHE,
|
||||
"connection", connection,
|
||||
"cache-path", cache_path,
|
||||
NULL);
|
||||
cache = g_object_new (GTK_TYPE_AT_SPI_CACHE,
|
||||
"connection", connection,
|
||||
"cache-path", cache_path,
|
||||
NULL);
|
||||
cache->root = root;
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -31,7 +31,8 @@ G_DECLARE_FINAL_TYPE (GtkAtSpiCache, gtk_at_spi_cache, GTK, AT_SPI_CACHE, GObjec
|
||||
|
||||
GtkAtSpiCache *
|
||||
gtk_at_spi_cache_new (GDBusConnection *connection,
|
||||
const char *cache_path);
|
||||
const char *cache_path,
|
||||
GtkAtSpiRoot *root);
|
||||
|
||||
void
|
||||
gtk_at_spi_cache_add_context (GtkAtSpiCache *self,
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "gtkaccessibleprivate.h"
|
||||
|
||||
#include "gtkatspiactionprivate.h"
|
||||
#include "gtkatspicacheprivate.h"
|
||||
#include "gtkatspieditabletextprivate.h"
|
||||
#include "gtkatspiprivate.h"
|
||||
#include "gtkatspirootprivate.h"
|
||||
@@ -91,9 +90,6 @@ struct _GtkAtSpiContext
|
||||
/* The root object, used as a entry point */
|
||||
GtkAtSpiRoot *root;
|
||||
|
||||
/* The cache object, used to retrieve ATContexts */
|
||||
GtkAtSpiCache *cache;
|
||||
|
||||
/* The address for the ATSPI accessibility bus */
|
||||
char *bus_address;
|
||||
|
||||
@@ -154,6 +150,13 @@ collect_states (GtkAtSpiContext *self,
|
||||
|
||||
set_atspi_state (&states, ATSPI_STATE_VISIBLE);
|
||||
|
||||
if (ctx->accessible_role == GTK_ACCESSIBLE_ROLE_WINDOW)
|
||||
{
|
||||
set_atspi_state (&states, ATSPI_STATE_SHOWING);
|
||||
if (gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE))
|
||||
set_atspi_state (&states, ATSPI_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
if (ctx->accessible_role == GTK_ACCESSIBLE_ROLE_TEXT_BOX ||
|
||||
ctx->accessible_role == GTK_ACCESSIBLE_ROLE_SEARCH_BOX ||
|
||||
ctx->accessible_role == GTK_ACCESSIBLE_ROLE_SPIN_BUTTON)
|
||||
@@ -857,6 +860,43 @@ emit_children_changed (GtkAtSpiContext *self,
|
||||
context_ref);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_focus (GtkAtSpiContext *self,
|
||||
gboolean focus_in)
|
||||
{
|
||||
if (self->connection == NULL)
|
||||
return;
|
||||
|
||||
if (focus_in)
|
||||
g_dbus_connection_emit_signal (self->connection,
|
||||
NULL,
|
||||
self->context_path,
|
||||
"org.a11y.atspi.Event.Focus",
|
||||
"Focus",
|
||||
g_variant_new ("(siiva{sv})",
|
||||
"", 0, 0, g_variant_new_string ("0"), NULL),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_window_event (GtkAtSpiContext *self,
|
||||
const char *event_type)
|
||||
{
|
||||
if (self->connection == NULL)
|
||||
return;
|
||||
|
||||
g_dbus_connection_emit_signal (self->connection,
|
||||
NULL,
|
||||
self->context_path,
|
||||
"org.a11y.atspi.Event.Window",
|
||||
event_type,
|
||||
g_variant_new ("(siiva{sv})",
|
||||
"", 0, 0,
|
||||
g_variant_new_string("0"),
|
||||
NULL),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
GtkAccessibleStateChange changed_states,
|
||||
@@ -888,6 +928,7 @@ gtk_at_spi_context_state_change (GtkATContext *ctx,
|
||||
if (GTK_IS_ROOT (accessible))
|
||||
{
|
||||
gtk_at_spi_root_child_changed (self->root, change, accessible);
|
||||
emit_state_changed (self, "showing", gtk_boolean_accessible_value_get (value));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1083,6 +1124,25 @@ gtk_at_spi_context_platform_change (GtkATContext *ctx,
|
||||
gboolean state = gtk_accessible_get_platform_state (GTK_ACCESSIBLE (widget),
|
||||
GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED);
|
||||
emit_state_changed (self, "focused", state);
|
||||
emit_focus (self, state);
|
||||
}
|
||||
|
||||
if (changed_platform & GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE)
|
||||
{
|
||||
gboolean state = gtk_accessible_get_platform_state (GTK_ACCESSIBLE (widget),
|
||||
GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE);
|
||||
emit_state_changed (self, "active", state);
|
||||
|
||||
/* Orca tracks the window:activate and window:deactivate events on top
|
||||
* levels to decide whether to track other AT-SPI events
|
||||
*/
|
||||
if (gtk_accessible_get_accessible_role (accessible) == GTK_ACCESSIBLE_ROLE_WINDOW)
|
||||
{
|
||||
if (state)
|
||||
emit_window_event (self, "activate");
|
||||
else
|
||||
emit_window_event (self, "deactivate");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -503,7 +503,7 @@ on_registration_reply (GObject *gobject,
|
||||
}
|
||||
|
||||
/* Register the cache object */
|
||||
self->cache = gtk_at_spi_cache_new (self->connection, ATSPI_CACHE_PATH);
|
||||
self->cache = gtk_at_spi_cache_new (self->connection, ATSPI_CACHE_PATH, self);
|
||||
|
||||
/* Drain the list of queued GtkAtSpiContexts, and add them to the cache */
|
||||
if (self->queued_contexts != NULL)
|
||||
|
||||
@@ -1326,9 +1326,12 @@ update_selection (TextChanged *changed,
|
||||
int selection_bound)
|
||||
{
|
||||
gboolean caret_moved, bound_moved;
|
||||
gboolean had_selection, has_selection;
|
||||
|
||||
caret_moved = cursor_position != changed->cursor_position;
|
||||
bound_moved = selection_bound != changed->selection_bound;
|
||||
had_selection = changed->cursor_position != changed->selection_bound;
|
||||
has_selection = cursor_position != selection_bound;
|
||||
|
||||
if (!caret_moved && !bound_moved)
|
||||
return;
|
||||
@@ -1339,7 +1342,7 @@ update_selection (TextChanged *changed,
|
||||
if (caret_moved)
|
||||
changed->selection_changed (changed->data, "text-caret-moved", changed->cursor_position);
|
||||
|
||||
if (caret_moved || bound_moved)
|
||||
if (had_selection || has_selection)
|
||||
changed->selection_changed (changed->data, "text-selection-changed", 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +403,3 @@
|
||||
<Multi_key> <Greek_omicron> <apostrophe> : "ό" U03CC
|
||||
<Multi_key> <Greek_upsilon> <apostrophe> : "ύ" U03CD
|
||||
<Multi_key> <Greek_omega> <apostrophe> : "ώ" U03CE
|
||||
|
||||
# This sequence matches our handling of dead keys better.
|
||||
# We remove the xorg sequence that maps this to '
|
||||
<dead_acute> <space> : "´" acute # ACUTE ACCENT
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<dead_tilde> <dead_tilde> : "~" asciitilde # TILDE
|
||||
<dead_acute> <space> : "'" apostrophe # APOSTROPHE
|
||||
<dead_acute> <dead_acute> : "´" acute # ACUTE ACCENT
|
||||
<dead_grave> <dead_grave> : "`" grave # GRAVE ACCENT
|
||||
<dead_abovering> <dead_abovering> : "°" degree # DEGREE SIGN
|
||||
<dead_macron> <dead_macron> : "¯" macron # MACRON
|
||||
<dead_breve> <dead_breve> : "˘" breve # BREVE
|
||||
<dead_abovedot> <dead_abovedot> : "˙" abovedot # DOT ABOVE
|
||||
<dead_diaeresis> <dead_diaeresis> : "¨" diaeresis # DIAERESIS
|
||||
<dead_doubleacute> <dead_doubleacute> : "˝" U2dd # DOUBLE ACUTE ACCENT
|
||||
<dead_caron> <dead_caron> : "ˇ" caron # CARON
|
||||
<dead_cedilla> <dead_cedilla> : "¸" cedilla # CEDILLA
|
||||
<dead_ogonek> <dead_ogonek> : "˛" ogonek # OGONEK
|
||||
<dead_iota> <dead_iota> : "ͺ" U37a # GREEK YPOGEGRAMMENI
|
||||
+2
-10
@@ -696,15 +696,8 @@ gtk_at_context_update (GtkATContext *self)
|
||||
self->updated_states == 0)
|
||||
return;
|
||||
|
||||
GtkAccessibleStateChange changed_states =
|
||||
gtk_accessible_attribute_set_get_changed (self->states);
|
||||
GtkAccessiblePropertyChange changed_properties =
|
||||
gtk_accessible_attribute_set_get_changed (self->properties);
|
||||
GtkAccessibleRelationChange changed_relations =
|
||||
gtk_accessible_attribute_set_get_changed (self->relations);
|
||||
|
||||
GTK_AT_CONTEXT_GET_CLASS (self)->state_change (self,
|
||||
changed_states, changed_properties, changed_relations,
|
||||
self->updated_states, self->updated_properties, self->updated_relations,
|
||||
self->states, self->properties, self->relations);
|
||||
g_signal_emit (self, obj_signals[STATE_CHANGE], 0);
|
||||
|
||||
@@ -1172,8 +1165,7 @@ void
|
||||
gtk_at_context_platform_changed (GtkATContext *self,
|
||||
GtkAccessiblePlatformChange change)
|
||||
{
|
||||
if (!self->realized)
|
||||
return;
|
||||
gtk_at_context_realize (self);
|
||||
|
||||
GTK_AT_CONTEXT_GET_CLASS (self)->platform_change (self, change);
|
||||
}
|
||||
|
||||
@@ -83,11 +83,13 @@ typedef enum {
|
||||
typedef enum {
|
||||
GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE,
|
||||
GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED,
|
||||
GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE
|
||||
} GtkAccessiblePlatformState;
|
||||
|
||||
typedef enum {
|
||||
GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE,
|
||||
GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED,
|
||||
GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE = 1 << GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE,
|
||||
} GtkAccessiblePlatformChange;
|
||||
|
||||
typedef enum {
|
||||
|
||||
+5
-5
@@ -66,13 +66,13 @@
|
||||
* calling [method@Gtk.Builder.set_translation_domain] on the builder.
|
||||
*
|
||||
* Objects are described by `<object>` elements, which can contain
|
||||
* <property> elements to set properties, `<signal>` elements which
|
||||
* `<property>` elements to set properties, `<signal>` elements which
|
||||
* connect signals to handlers, and `<child>` elements, which describe
|
||||
* child objects (most often widgets inside a container, but also e.g.
|
||||
* actions in an action group, or columns in a tree model). A `<child>`
|
||||
* element contains an `<object>` element which describes the child object.
|
||||
*
|
||||
* The target toolkit version(s) are described by <requires> elements,
|
||||
* The target toolkit version(s) are described by `<requires>` elements,
|
||||
* the “lib” attribute specifies the widget library in question (currently
|
||||
* the only supported value is “gtk”) and the “version” attribute specifies
|
||||
* the target version in the form “`<major>`.`<minor>`”. `GtkBuilder` will
|
||||
@@ -93,7 +93,7 @@
|
||||
* underscores) for its own purposes.
|
||||
*
|
||||
* Setting properties of objects is pretty straightforward with the
|
||||
* <property> element: the “name” attribute specifies the name of the
|
||||
* `<property>` element: the “name” attribute specifies the name of the
|
||||
* property, and the content of the element specifies the value.
|
||||
* If the “translatable” attribute is set to a true value, GTK uses
|
||||
* `gettext()` (or `dgettext()` if the builder has a translation domain set)
|
||||
@@ -148,7 +148,7 @@
|
||||
*
|
||||
* # Signal handlers and function pointers
|
||||
*
|
||||
* Signal handlers are set up with the <signal> element. The “name”
|
||||
* Signal handlers are set up with the `<signal>` element. The “name”
|
||||
* attribute specifies the name of the signal, and the “handler” attribute
|
||||
* specifies the function to connect to the signal.
|
||||
* The remaining attributes, “after”, “swapped” and “object”, have the
|
||||
@@ -198,7 +198,7 @@
|
||||
* These XML fragments are explained in the documentation of the
|
||||
* respective objects.
|
||||
*
|
||||
* A <template> tag can be used to define a widget class’s components.
|
||||
* A `<template>` tag can be used to define a widget class’s components.
|
||||
* See the [GtkWidget documentation](class.Widget.html#building-composite-widgets-from-template-xml) for details.
|
||||
*/
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ G_DECLARE_INTERFACE (GtkBuilderScope, gtk_builder_scope, GTK, BUILDER_SCOPE, GOb
|
||||
* The list of flags that can be passed to gtk_builder_create_closure().
|
||||
*
|
||||
* New values may be added in the future for new features, so external
|
||||
* implementations of [interface@Gtk.BuilderScope] should test the flags
|
||||
* implementations of [iface@Gtk.BuilderScope] should test the flags
|
||||
* for unknown values and raise a %GTK_BUILDER_ERROR_INVALID_ATTRIBUTE error
|
||||
* when they encounter one.
|
||||
*/
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
* `GtkButton` has a single CSS node with name button. The node will get the
|
||||
* style classes .image-button or .text-button, if the content is just an
|
||||
* image or label, respectively. It may also receive the .flat style class.
|
||||
* When activating a button via the keyboard, the button will temporarily
|
||||
* gain the .keyboard-activating style class.
|
||||
*
|
||||
* Other style classes that are commonly used with `GtkButton` include
|
||||
* .suggested-action and .destructive-action. In special cases, buttons
|
||||
@@ -780,6 +782,8 @@ gtk_real_button_activate (GtkButton *button)
|
||||
{
|
||||
priv->activate_timeout = g_timeout_add (ACTIVATE_TIMEOUT, button_activate_timeout, button);
|
||||
g_source_set_name_by_id (priv->activate_timeout, "[gtk] button_activate_timeout");
|
||||
|
||||
gtk_widget_add_css_class (GTK_WIDGET (button), "keyboard-activating");
|
||||
priv->button_down = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -790,6 +794,8 @@ gtk_button_finish_activate (GtkButton *button,
|
||||
{
|
||||
GtkButtonPrivate *priv = gtk_button_get_instance_private (button);
|
||||
|
||||
gtk_widget_remove_css_class (GTK_WIDGET (button), "keyboard-activating");
|
||||
|
||||
g_source_remove (priv->activate_timeout);
|
||||
priv->activate_timeout = 0;
|
||||
|
||||
|
||||
@@ -3424,8 +3424,18 @@ gtk_cell_area_inner_cell_area (GtkCellArea *area,
|
||||
|
||||
*inner_area = *cell_area;
|
||||
|
||||
if (border.left + border.right > cell_area->width)
|
||||
{
|
||||
border.left = cell_area->width / 2;
|
||||
border.right = (cell_area->width + 1) / 2;
|
||||
}
|
||||
inner_area->x += border.left;
|
||||
inner_area->width -= border.left + border.right;
|
||||
if (border.top + border.bottom > cell_area->height)
|
||||
{
|
||||
border.top = cell_area->height / 2;
|
||||
border.bottom = (cell_area->height + 1) / 2;
|
||||
}
|
||||
inner_area->y += border.top;
|
||||
inner_area->height -= border.top + border.bottom;
|
||||
}
|
||||
|
||||
@@ -915,7 +915,7 @@ gtk_check_button_set_label (GtkCheckButton *self,
|
||||
*
|
||||
* Setting up groups in a cycle leads to undefined behavior.
|
||||
*
|
||||
* Note that the same effect can be achieved via the [interface@Gtk.Actionable]
|
||||
* Note that the same effect can be achieved via the [iface@Gtk.Actionable]
|
||||
* API, by using the same action with parameter type and state type 's'
|
||||
* for all buttons in the group, and giving each button its own target
|
||||
* value.
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@
|
||||
* is specified in the form of a tree model, and the display of the choices
|
||||
* can be adapted to the data in the model by using cell renderers, as you
|
||||
* would in a tree view. This is possible since `GtkComboBox` implements the
|
||||
* [interface@Gtk.CellLayout] interface. The tree model holding the valid
|
||||
* [iface@Gtk.CellLayout] interface. The tree model holding the valid
|
||||
* choices is not restricted to a flat list, it can be a real tree, and the
|
||||
* popup will reflect the tree structure.
|
||||
*
|
||||
|
||||
@@ -49,11 +49,10 @@
|
||||
*
|
||||
* If the `GtkComboBoxText` contains an entry (via the
|
||||
* [property@Gtk.ComboBox:has-entry] property), its contents can be retrieved
|
||||
* using [method@Gtk.ComboBoxText.get_active_text]. The entry itself can be
|
||||
* accessed by calling [method@Gtk.ComboBox.get_child] on the combo box.
|
||||
* using [method@Gtk.ComboBoxText.get_active_text].
|
||||
*
|
||||
* You should not call [method@Gtk.ComboBox.set_model] or attempt to pack more
|
||||
* cells into this combo box via its [interface@Gtk.CellLayout] interface.
|
||||
* cells into this combo box via its [iface@Gtk.CellLayout] interface.
|
||||
*
|
||||
* # GtkComboBoxText as GtkBuildable
|
||||
*
|
||||
|
||||
@@ -66,9 +66,9 @@ gtk_css_image_paintable_snapshot (GtkCssImage *image,
|
||||
{
|
||||
GtkCssImagePaintable *paintable = GTK_CSS_IMAGE_PAINTABLE (image);
|
||||
|
||||
return gdk_paintable_snapshot (get_paintable (paintable),
|
||||
snapshot,
|
||||
width, height);
|
||||
gdk_paintable_snapshot (get_paintable (paintable),
|
||||
snapshot,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
|
||||
+1
-1
@@ -953,7 +953,7 @@ gtk_dialog_add_buttons_valist (GtkDialog *dialog,
|
||||
*
|
||||
* This is the same as calling [method@Gtk.Dialog.add_button]
|
||||
* repeatedly. The variable argument list should be %NULL-terminated
|
||||
* as with [new@Gtk.Dialog.new_with_buttons]. Each button must have both
|
||||
* as with [ctor@Gtk.Dialog.new_with_buttons]. Each button must have both
|
||||
* text and response ID.
|
||||
*/
|
||||
void
|
||||
|
||||
@@ -470,6 +470,7 @@ drag_end (GtkDragSource *source,
|
||||
|
||||
gdk_drag_drop_done (source->drag, success);
|
||||
g_clear_object (&source->drag);
|
||||
g_object_unref (source);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -593,6 +594,9 @@ gtk_drag_source_drag_begin (GtkDragSource *source)
|
||||
|
||||
gtk_drag_source_ensure_icon (source, source->drag);
|
||||
|
||||
/* Keep the source alive until the drag is done */
|
||||
g_object_ref (source);
|
||||
|
||||
g_signal_connect (source->drag, "dnd-finished",
|
||||
G_CALLBACK (gtk_drag_source_dnd_finished_cb), source);
|
||||
g_signal_connect (source->drag, "cancel",
|
||||
|
||||
@@ -351,6 +351,8 @@ gtk_entry_accessible_get_platform_state (GtkAccessible *self,
|
||||
return gtk_widget_get_focusable (GTK_WIDGET (priv->text));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED:
|
||||
return gtk_widget_has_focus (GTK_WIDGET (priv->text));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE:
|
||||
return FALSE;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -3084,14 +3084,13 @@ cancel_all_operations (GtkFileChooserWidget *impl)
|
||||
|
||||
/* Removes the settings signal handler. It's safe to call multiple times */
|
||||
static void
|
||||
remove_settings_signal (GtkFileChooserWidget *impl,
|
||||
GdkDisplay *display)
|
||||
remove_settings_signal (GtkFileChooserWidget *impl)
|
||||
{
|
||||
if (impl->settings_signal_id)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (impl));
|
||||
GtkSettings *settings = gtk_settings_get_for_display (display);
|
||||
|
||||
settings = gtk_settings_get_for_display (display);
|
||||
g_signal_handler_disconnect (settings,
|
||||
impl->settings_signal_id);
|
||||
impl->settings_signal_id = 0;
|
||||
@@ -3115,6 +3114,7 @@ gtk_file_chooser_widget_dispose (GObject *object)
|
||||
location_entry_disconnect (impl);
|
||||
impl->external_entry = NULL;
|
||||
}
|
||||
remove_settings_signal (impl);
|
||||
|
||||
g_clear_pointer (&impl->box, gtk_widget_unparent);
|
||||
|
||||
@@ -7855,7 +7855,7 @@ display_changed_cb (GtkWidget *wiget,
|
||||
GParamSpec *pspec,
|
||||
GtkFileChooserWidget *impl)
|
||||
{
|
||||
remove_settings_signal (impl, gtk_widget_get_display (GTK_WIDGET (impl)));
|
||||
remove_settings_signal (impl);
|
||||
check_icon_theme (impl);
|
||||
}
|
||||
|
||||
|
||||
@@ -1095,6 +1095,9 @@ add_languages_from_font (GtkFontChooserWidget *self,
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self);
|
||||
|
||||
/* We incrementally populate our fontlist to prevent blocking
|
||||
* the font chooser for a long time with expensive FcFontSort
|
||||
* calls in pango for every row in the list).
|
||||
@@ -1135,6 +1138,9 @@ add_to_fontlist (GtkWidget *widget,
|
||||
|
||||
gtk_slice_list_model_set_size (model, n);
|
||||
|
||||
if (gtk_single_selection_get_selected (GTK_SINGLE_SELECTION (self->selection)) == GTK_INVALID_LIST_POSITION)
|
||||
gtk_font_chooser_widget_ensure_matching_selection (self);
|
||||
|
||||
if (n == G_MAXUINT)
|
||||
return G_SOURCE_REMOVE;
|
||||
else
|
||||
@@ -1348,7 +1354,7 @@ my_pango_font_family_equal (const char *familya,
|
||||
return g_ascii_strcasecmp (familya, familyb) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
|
||||
{
|
||||
const char *desc_family;
|
||||
@@ -1358,7 +1364,7 @@ gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
|
||||
if (desc_family == NULL)
|
||||
{
|
||||
gtk_single_selection_set_selected (self->selection, GTK_INVALID_LIST_POSITION);
|
||||
return;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
n = g_list_model_get_n_items (G_LIST_MODEL (self->selection));
|
||||
@@ -1397,7 +1403,13 @@ gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
|
||||
pango_font_description_free (merged);
|
||||
}
|
||||
|
||||
gtk_single_selection_set_selected (self->selection, i);
|
||||
if (i < n)
|
||||
{
|
||||
gtk_single_selection_set_selected (self->selection, i);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static PangoFontFace *
|
||||
@@ -2352,6 +2364,7 @@ gtk_font_chooser_widget_take_font_desc (GtkFontChooserWidget *fontchooser,
|
||||
if (mask & (PANGO_FONT_MASK_FAMILY | PANGO_FONT_MASK_STYLE | PANGO_FONT_MASK_VARIANT |
|
||||
PANGO_FONT_MASK_WEIGHT | PANGO_FONT_MASK_STRETCH))
|
||||
{
|
||||
gtk_single_selection_set_selected (fontchooser->selection, GTK_INVALID_LIST_POSITION);
|
||||
gtk_font_chooser_widget_ensure_matching_selection (fontchooser);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1644,7 +1644,7 @@ gtk_icon_theme_add_resource_path (GtkIconTheme *self,
|
||||
* overriding system configuration.
|
||||
*
|
||||
* This function cannot be called on the icon theme objects returned
|
||||
* from [type_func@Gtk.IconTheme.get_for_display].
|
||||
* from [func@Gtk.IconTheme.get_for_display].
|
||||
*/
|
||||
void
|
||||
gtk_icon_theme_set_theme_name (GtkIconTheme *self,
|
||||
|
||||
+34
-10
@@ -90,6 +90,9 @@ G_LOCK_DEFINE_STATIC (global_tables);
|
||||
static GSList *global_tables;
|
||||
|
||||
static const guint16 gtk_compose_ignore[] = {
|
||||
0, /* Yes, XKB will send us key press events with NoSymbol :( */
|
||||
GDK_KEY_Overlay1_Enable,
|
||||
GDK_KEY_Overlay2_Enable,
|
||||
GDK_KEY_Shift_L,
|
||||
GDK_KEY_Shift_R,
|
||||
GDK_KEY_Control_L,
|
||||
@@ -105,7 +108,10 @@ static const guint16 gtk_compose_ignore[] = {
|
||||
GDK_KEY_Hyper_L,
|
||||
GDK_KEY_Hyper_R,
|
||||
GDK_KEY_Mode_switch,
|
||||
GDK_KEY_ISO_Level3_Shift
|
||||
GDK_KEY_ISO_Level3_Shift,
|
||||
GDK_KEY_ISO_Level3_Latch,
|
||||
GDK_KEY_ISO_Level5_Shift,
|
||||
GDK_KEY_ISO_Level5_Latch
|
||||
};
|
||||
|
||||
static void gtk_im_context_simple_finalize (GObject *obj);
|
||||
@@ -761,13 +767,21 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
}
|
||||
}
|
||||
|
||||
if (priv->in_hex_sequence || priv->in_compose_sequence)
|
||||
return TRUE; /* Don't leak random key events during preedit */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Ignore modifier key presses */
|
||||
for (i = 0; i < G_N_ELEMENTS (gtk_compose_ignore); i++)
|
||||
if (keyval == gtk_compose_ignore[i])
|
||||
return FALSE;
|
||||
{
|
||||
if (priv->in_hex_sequence || priv->in_compose_sequence)
|
||||
return TRUE; /* Don't leak random key events during preedit */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hex_mod_mask = GDK_CONTROL_MASK|GDK_SHIFT_MASK;
|
||||
|
||||
@@ -802,16 +816,23 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
|
||||
no_text_input_mask = GDK_ALT_MASK|GDK_CONTROL_MASK;
|
||||
|
||||
if (state & no_text_input_mask ||
|
||||
(priv->in_hex_sequence && priv->modifiers_dropped &&
|
||||
(keyval == GDK_KEY_Return ||
|
||||
keyval == GDK_KEY_ISO_Enter ||
|
||||
keyval == GDK_KEY_KP_Enter)))
|
||||
if (priv->in_hex_sequence && priv->modifiers_dropped &&
|
||||
(keyval == GDK_KEY_Return ||
|
||||
keyval == GDK_KEY_ISO_Enter ||
|
||||
keyval == GDK_KEY_KP_Enter))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (state & no_text_input_mask)
|
||||
{
|
||||
if (priv->in_hex_sequence || priv->in_compose_sequence)
|
||||
return TRUE; /* Don't leak random key events during preedit */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Handle backspace */
|
||||
if (priv->in_hex_sequence && have_hex_mods && is_backspace)
|
||||
{
|
||||
@@ -1059,9 +1080,12 @@ gtk_im_context_simple_reset (GtkIMContext *context)
|
||||
|
||||
priv->compose_buffer[0] = 0;
|
||||
|
||||
if (priv->tentative_match->len > 0 || priv->in_hex_sequence)
|
||||
if (priv->tentative_match->len > 0 ||
|
||||
priv->in_hex_sequence ||
|
||||
priv->in_compose_sequence)
|
||||
{
|
||||
priv->in_hex_sequence = FALSE;
|
||||
priv->in_compose_sequence = FALSE;
|
||||
g_string_set_size (priv->tentative_match, 0);
|
||||
priv->tentative_match_len = 0;
|
||||
g_signal_emit_by_name (context_simple, "preedit-changed");
|
||||
@@ -1137,7 +1161,7 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
|
||||
}
|
||||
|
||||
if (cursor_pos)
|
||||
*cursor_pos = s->len;
|
||||
*cursor_pos = g_utf8_strlen (s->str, s->len);
|
||||
|
||||
if (attrs)
|
||||
{
|
||||
|
||||
@@ -66,35 +66,35 @@
|
||||
|
||||
static const guint16 gtk_compose_seqs_compact[] = {
|
||||
GDK_KEY_Greek_accentdieresis, 180, 184, 184, 184, 184,
|
||||
GDK_KEY_dead_grave, 184, 244, 331, 543, 543,
|
||||
GDK_KEY_dead_acute, 543, 605, 701, 977, 977,
|
||||
GDK_KEY_dead_circumflex, 977, 1101, 1101, 1301, 1301,
|
||||
GDK_KEY_dead_tilde, 1301, 1383, 1446, 1586, 1586,
|
||||
GDK_KEY_dead_macron, 1586, 1630, 1648, 1720, 1720,
|
||||
GDK_KEY_dead_breve, 1720, 1768, 1768, 1792, 1792,
|
||||
GDK_KEY_dead_abovedot, 1792, 1820, 1823, 1859, 1859,
|
||||
GDK_KEY_dead_diaeresis, 1859, 1945, 1957, 1981, 1981,
|
||||
GDK_KEY_dead_abovering, 1981, 1989, 1989, 1989, 1989,
|
||||
GDK_KEY_dead_doubleacute, 1989, 1997, 1997, 1997, 1997,
|
||||
GDK_KEY_dead_caron, 1997, 2037, 2037, 2045, 2045,
|
||||
GDK_KEY_dead_cedilla, 2045, 2055, 2061, 2061, 2061,
|
||||
GDK_KEY_dead_ogonek, 2061, 2069, 2069, 2069, 2069,
|
||||
GDK_KEY_dead_iota, 2069, 2089, 2188, 2620, 3280,
|
||||
GDK_KEY_dead_voiced_sound, 3280, 3326, 3326, 3326, 3326,
|
||||
GDK_KEY_dead_semivoiced_sound, 3326, 3336, 3336, 3336, 3336,
|
||||
GDK_KEY_dead_belowdot, 3336, 3352, 3352, 3368, 3368,
|
||||
GDK_KEY_dead_hook, 3368, 3446, 3449, 3505, 3505,
|
||||
GDK_KEY_dead_horn, 3505, 3515, 3515, 3515, 3515,
|
||||
GDK_KEY_dead_stroke, 3515, 3603, 3615, 3615, 3615,
|
||||
GDK_KEY_dead_psili, 3615, 3643, 3643, 3643, 3643,
|
||||
GDK_KEY_dead_dasia, 3643, 3675, 3675, 3675, 3675,
|
||||
GDK_KEY_dead_belowring, 3675, 3677, 3677, 3677, 3677,
|
||||
GDK_KEY_dead_belowtilde, 3677, 3679, 3679, 3679, 3679,
|
||||
GDK_KEY_dead_belowdiaeresis, 3679, 3679, 3682, 3682, 3682,
|
||||
GDK_KEY_dead_belowcomma, 3682, 3696, 3696, 3696, 3696,
|
||||
GDK_KEY_dead_currency, 3696, 3794, 3800, 3800, 3800,
|
||||
GDK_KEY_dead_greek, 3800, 3902, 3926, 3926, 3926,
|
||||
GDK_KEY_Multi_key, 3926, 3926, 10637, 14345, 16220,
|
||||
GDK_KEY_dead_grave, 184, 246, 333, 545, 545,
|
||||
GDK_KEY_dead_acute, 545, 609, 705, 981, 981,
|
||||
GDK_KEY_dead_circumflex, 981, 1105, 1105, 1305, 1305,
|
||||
GDK_KEY_dead_tilde, 1305, 1389, 1452, 1592, 1592,
|
||||
GDK_KEY_dead_macron, 1592, 1638, 1656, 1728, 1728,
|
||||
GDK_KEY_dead_breve, 1728, 1778, 1778, 1802, 1802,
|
||||
GDK_KEY_dead_abovedot, 1802, 1832, 1835, 1871, 1871,
|
||||
GDK_KEY_dead_diaeresis, 1871, 1959, 1971, 1995, 1995,
|
||||
GDK_KEY_dead_abovering, 1995, 2005, 2005, 2005, 2005,
|
||||
GDK_KEY_dead_doubleacute, 2005, 2015, 2015, 2015, 2015,
|
||||
GDK_KEY_dead_caron, 2015, 2057, 2057, 2065, 2065,
|
||||
GDK_KEY_dead_cedilla, 2065, 2077, 2083, 2083, 2083,
|
||||
GDK_KEY_dead_ogonek, 2083, 2093, 2093, 2093, 2093,
|
||||
GDK_KEY_dead_iota, 2093, 2115, 2214, 2646, 3306,
|
||||
GDK_KEY_dead_voiced_sound, 3306, 3352, 3352, 3352, 3352,
|
||||
GDK_KEY_dead_semivoiced_sound, 3352, 3362, 3362, 3362, 3362,
|
||||
GDK_KEY_dead_belowdot, 3362, 3378, 3378, 3394, 3394,
|
||||
GDK_KEY_dead_hook, 3394, 3472, 3475, 3531, 3531,
|
||||
GDK_KEY_dead_horn, 3531, 3541, 3541, 3541, 3541,
|
||||
GDK_KEY_dead_stroke, 3541, 3629, 3641, 3641, 3641,
|
||||
GDK_KEY_dead_psili, 3641, 3669, 3669, 3669, 3669,
|
||||
GDK_KEY_dead_dasia, 3669, 3701, 3701, 3701, 3701,
|
||||
GDK_KEY_dead_belowring, 3701, 3703, 3703, 3703, 3703,
|
||||
GDK_KEY_dead_belowtilde, 3703, 3705, 3705, 3705, 3705,
|
||||
GDK_KEY_dead_belowdiaeresis, 3705, 3705, 3708, 3708, 3708,
|
||||
GDK_KEY_dead_belowcomma, 3708, 3722, 3722, 3722, 3722,
|
||||
GDK_KEY_dead_currency, 3722, 3820, 3826, 3826, 3826,
|
||||
GDK_KEY_dead_greek, 3826, 3928, 3952, 3952, 3952,
|
||||
GDK_KEY_Multi_key, 3952, 3952, 10663, 14371, 16246,
|
||||
GDK_KEY_Greek_iota, 0x0390,
|
||||
GDK_KEY_Greek_upsilon, 0x03B0,
|
||||
GDK_KEY_space, 0x0060,
|
||||
@@ -127,6 +127,7 @@ GDK_KEY_Greek_iota, 0x1F76,
|
||||
GDK_KEY_Greek_omicron, 0x1F78,
|
||||
GDK_KEY_Greek_upsilon, 0x1F7A,
|
||||
GDK_KEY_Greek_omega, 0x1F7C,
|
||||
GDK_KEY_dead_grave, 0x0060,
|
||||
GDK_KEY_dead_diaeresis, GDK_KEY_Greek_iota, 0x1FD2,
|
||||
GDK_KEY_dead_diaeresis, GDK_KEY_Greek_upsilon, 0x1FE2,
|
||||
GDK_KEY_dead_psili, GDK_KEY_Greek_ALPHA, 0x1F0A,
|
||||
@@ -209,7 +210,7 @@ GDK_KEY_Multi_key, GDK_KEY_macron, GDK_KEY_E, 0x1E14,
|
||||
GDK_KEY_Multi_key, GDK_KEY_macron, GDK_KEY_O, 0x1E50,
|
||||
GDK_KEY_Multi_key, GDK_KEY_macron, GDK_KEY_e, 0x1E15,
|
||||
GDK_KEY_Multi_key, GDK_KEY_macron, GDK_KEY_o, 0x1E51,
|
||||
GDK_KEY_space, 0x00B4,
|
||||
GDK_KEY_space, 0x0027,
|
||||
GDK_KEY_V, 0x01D7,
|
||||
GDK_KEY_v, 0x01D8,
|
||||
GDK_KEY_nobreakspace, 0x0301,
|
||||
@@ -240,6 +241,7 @@ GDK_KEY_Greek_iota, 0x03AF,
|
||||
GDK_KEY_Greek_omicron, 0x03CC,
|
||||
GDK_KEY_Greek_upsilon, 0x03CD,
|
||||
GDK_KEY_Greek_omega, 0x03CE,
|
||||
GDK_KEY_dead_acute, 0x00B4,
|
||||
GDK_KEY_dead_diaeresis, GDK_KEY_space, 0x0385,
|
||||
GDK_KEY_dead_diaeresis, GDK_KEY_Greek_iota, 0x0390,
|
||||
GDK_KEY_dead_diaeresis, GDK_KEY_Greek_upsilon, 0x03B0,
|
||||
@@ -494,6 +496,7 @@ GDK_KEY_Greek_omega, 0x1FF6,
|
||||
0x1F61, 0x1F67,
|
||||
0x1F68, 0x1F6E,
|
||||
0x1F69, 0x1F6F,
|
||||
GDK_KEY_dead_tilde, 0x007E,
|
||||
GDK_KEY_dead_diaeresis, GDK_KEY_Greek_iota, 0x1FD7,
|
||||
GDK_KEY_dead_diaeresis, GDK_KEY_Greek_upsilon, 0x1FE7,
|
||||
GDK_KEY_dead_psili, GDK_KEY_Greek_ALPHA, 0x1F0E,
|
||||
@@ -572,6 +575,7 @@ GDK_KEY_Greek_UPSILON, 0x1FE9,
|
||||
GDK_KEY_Greek_alpha, 0x1FB1,
|
||||
GDK_KEY_Greek_iota, 0x1FD1,
|
||||
GDK_KEY_Greek_upsilon, 0x1FE1,
|
||||
GDK_KEY_dead_macron, 0x00AF,
|
||||
GDK_KEY_dead_greek, GDK_KEY_A, 0x1FB9,
|
||||
GDK_KEY_dead_greek, GDK_KEY_I, 0x1FD9,
|
||||
GDK_KEY_dead_greek, GDK_KEY_U, 0x1FE9,
|
||||
@@ -620,6 +624,7 @@ GDK_KEY_Greek_UPSILON, 0x1FE8,
|
||||
GDK_KEY_Greek_alpha, 0x1FB0,
|
||||
GDK_KEY_Greek_iota, 0x1FD0,
|
||||
GDK_KEY_Greek_upsilon, 0x1FE0,
|
||||
GDK_KEY_dead_breve, 0x02D8,
|
||||
GDK_KEY_Multi_key, GDK_KEY_exclam, GDK_KEY_A, 0x1EB6,
|
||||
GDK_KEY_Multi_key, GDK_KEY_exclam, GDK_KEY_a, 0x1EB7,
|
||||
GDK_KEY_Multi_key, GDK_KEY_comma, GDK_KEY_E, 0x1E1C,
|
||||
@@ -640,6 +645,7 @@ GDK_KEY_Amacron, 0x01E0,
|
||||
GDK_KEY_Omacron, 0x0230,
|
||||
GDK_KEY_amacron, 0x01E1,
|
||||
GDK_KEY_omacron, 0x0231,
|
||||
GDK_KEY_dead_abovedot, 0x02D9,
|
||||
GDK_KEY_dead_stroke, GDK_KEY_j, 0x025F,
|
||||
GDK_KEY_Multi_key, GDK_KEY_exclam, GDK_KEY_S, 0x1E68,
|
||||
GDK_KEY_Multi_key, GDK_KEY_exclam, GDK_KEY_s, 0x1E69,
|
||||
@@ -693,6 +699,7 @@ GDK_KEY_Greek_IOTA, 0x03AA,
|
||||
GDK_KEY_Greek_UPSILON, 0x03AB,
|
||||
GDK_KEY_Greek_iota, 0x03CA,
|
||||
GDK_KEY_Greek_upsilon, 0x03CB,
|
||||
GDK_KEY_dead_diaeresis, 0x00A8,
|
||||
GDK_KEY_dead_acute, GDK_KEY_space, 0x0385,
|
||||
GDK_KEY_dead_acute, GDK_KEY_Greek_iota, 0x0390,
|
||||
GDK_KEY_dead_acute, GDK_KEY_Greek_upsilon, 0x03B0,
|
||||
@@ -707,10 +714,12 @@ GDK_KEY_space, 0x00B0,
|
||||
GDK_KEY_nobreakspace, 0x030A,
|
||||
GDK_KEY_Aacute, 0x01FA,
|
||||
GDK_KEY_aacute, 0x01FB,
|
||||
GDK_KEY_dead_abovering, 0x00B0,
|
||||
GDK_KEY_space, 0x02DD,
|
||||
GDK_KEY_nobreakspace, 0x030B,
|
||||
GDK_KEY_Cyrillic_u, 0x04F3,
|
||||
GDK_KEY_Cyrillic_U, 0x04F2,
|
||||
GDK_KEY_dead_doubleacute, 0x02DD,
|
||||
GDK_KEY_space, 0x02C7,
|
||||
GDK_KEY_parenleft, 0x208D,
|
||||
GDK_KEY_parenright, 0x208E,
|
||||
@@ -731,6 +740,7 @@ GDK_KEY_V, 0x01D9,
|
||||
GDK_KEY_v, 0x01DA,
|
||||
GDK_KEY_nobreakspace, 0x030C,
|
||||
0x01F2, 0x01C5,
|
||||
GDK_KEY_dead_caron, 0x02C7,
|
||||
GDK_KEY_Multi_key, GDK_KEY_quotedbl, GDK_KEY_U, 0x01D9,
|
||||
GDK_KEY_Multi_key, GDK_KEY_quotedbl, GDK_KEY_u, 0x01DA,
|
||||
GDK_KEY_space, 0x00B8,
|
||||
@@ -738,12 +748,14 @@ GDK_KEY_nobreakspace, 0x0327,
|
||||
GDK_KEY_cent, 0x20B5,
|
||||
GDK_KEY_Cacute, 0x1E08,
|
||||
GDK_KEY_cacute, 0x1E09,
|
||||
GDK_KEY_dead_cedilla, 0x00B8,
|
||||
GDK_KEY_dead_currency, GDK_KEY_C, 0x20B5,
|
||||
GDK_KEY_dead_currency, GDK_KEY_c, 0x20B5,
|
||||
GDK_KEY_space, 0x02DB,
|
||||
GDK_KEY_nobreakspace, 0x0328,
|
||||
GDK_KEY_Omacron, 0x01EC,
|
||||
GDK_KEY_omacron, 0x01ED,
|
||||
GDK_KEY_dead_ogonek, 0x02DB,
|
||||
GDK_KEY_space, 0x037A,
|
||||
GDK_KEY_Greek_alphaaccent, 0x1FB4,
|
||||
GDK_KEY_Greek_etaaccent, 0x1FC4,
|
||||
@@ -754,6 +766,7 @@ GDK_KEY_Greek_OMEGA, 0x1FFC,
|
||||
GDK_KEY_Greek_alpha, 0x1FB3,
|
||||
GDK_KEY_Greek_eta, 0x1FC3,
|
||||
GDK_KEY_Greek_omega, 0x1FF3,
|
||||
GDK_KEY_dead_iota, 0x037A,
|
||||
GDK_KEY_dead_grave, GDK_KEY_Greek_alpha, 0x1FB2,
|
||||
GDK_KEY_dead_grave, GDK_KEY_Greek_eta, 0x1FC2,
|
||||
GDK_KEY_dead_grave, GDK_KEY_Greek_omega, 0x1FF2,
|
||||
|
||||
@@ -205,6 +205,9 @@ gtk_im_multicontext_set_delegate (GtkIMMulticontext *multicontext,
|
||||
gtk_im_multicontext_delete_surrounding_cb,
|
||||
multicontext);
|
||||
|
||||
if (priv->client_widget)
|
||||
gtk_im_context_set_client_widget (priv->delegate, NULL);
|
||||
|
||||
g_object_unref (priv->delegate);
|
||||
priv->delegate = NULL;
|
||||
|
||||
|
||||
@@ -123,6 +123,35 @@ gtk_kinetic_scrolling_new (double lower,
|
||||
return data;
|
||||
}
|
||||
|
||||
GtkKineticScrollingChange
|
||||
gtk_kinetic_scrolling_update_size (GtkKineticScrolling *data,
|
||||
double lower,
|
||||
double upper)
|
||||
{
|
||||
GtkKineticScrollingChange change = GTK_KINETIC_SCROLLING_CHANGE_NONE;
|
||||
|
||||
if (lower != data->lower)
|
||||
{
|
||||
if (data->position <= lower)
|
||||
change |= GTK_KINETIC_SCROLLING_CHANGE_LOWER;
|
||||
|
||||
data->lower = lower;
|
||||
}
|
||||
|
||||
if (upper != data->upper)
|
||||
{
|
||||
if (data->position >= data->upper)
|
||||
change |= GTK_KINETIC_SCROLLING_CHANGE_UPPER;
|
||||
|
||||
data->upper = upper;
|
||||
}
|
||||
|
||||
if (data->phase == GTK_KINETIC_SCROLLING_PHASE_OVERSHOOTING)
|
||||
change |= GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT;
|
||||
|
||||
return change;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_kinetic_scrolling_free (GtkKineticScrolling *kinetic)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,13 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum {
|
||||
GTK_KINETIC_SCROLLING_CHANGE_NONE = 0,
|
||||
GTK_KINETIC_SCROLLING_CHANGE_LOWER = 1 << 0,
|
||||
GTK_KINETIC_SCROLLING_CHANGE_UPPER = 1 << 1,
|
||||
GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT = 1 << 2,
|
||||
} GtkKineticScrollingChange;
|
||||
|
||||
typedef struct _GtkKineticScrolling GtkKineticScrolling;
|
||||
|
||||
GtkKineticScrolling * gtk_kinetic_scrolling_new (double lower,
|
||||
@@ -34,6 +41,10 @@ GtkKineticScrolling * gtk_kinetic_scrolling_new (double lower
|
||||
double initial_velocity);
|
||||
void gtk_kinetic_scrolling_free (GtkKineticScrolling *kinetic);
|
||||
|
||||
GtkKineticScrollingChange gtk_kinetic_scrolling_update_size (GtkKineticScrolling *data,
|
||||
double lower,
|
||||
double upper);
|
||||
|
||||
gboolean gtk_kinetic_scrolling_tick (GtkKineticScrolling *data,
|
||||
double time_delta,
|
||||
double *position,
|
||||
|
||||
+13
-3
@@ -2970,8 +2970,18 @@ gtk_label_recalculate (GtkLabel *self)
|
||||
gtk_label_clear_layout (self);
|
||||
gtk_label_clear_select_info (self);
|
||||
|
||||
if (self->use_markup || self->use_underline)
|
||||
gtk_label_set_markup_internal (self, self->label, self->use_underline);
|
||||
if (self->use_markup)
|
||||
{
|
||||
gtk_label_set_markup_internal (self, self->label, self->use_underline);
|
||||
}
|
||||
else if (self->use_underline)
|
||||
{
|
||||
char *text;
|
||||
|
||||
text = g_markup_escape_text (self->label, -1);
|
||||
gtk_label_set_markup_internal (self, text, TRUE);
|
||||
g_free (text);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_clear_pointer (&self->markup_attrs, pango_attr_list_unref);
|
||||
@@ -4998,7 +5008,7 @@ gtk_label_get_layout (GtkLabel *self)
|
||||
* inside the [class@Pango.Layout], e.g. to take some action if some part
|
||||
* of the label is clicked. Remember when using the [class@Pango.Layout]
|
||||
* functions you need to convert to and from pixels using PANGO_PIXELS()
|
||||
* or [constant@Pango.SCALE].
|
||||
* or [const@Pango.SCALE].
|
||||
*/
|
||||
void
|
||||
gtk_label_get_layout_offsets (GtkLabel *self,
|
||||
|
||||
+4
-1
@@ -1782,7 +1782,10 @@ gtk_list_box_update_selection_full (GtkListBox *box,
|
||||
g_signal_emit (box, signals[ROW_SELECTED], 0, row);
|
||||
}
|
||||
else
|
||||
gtk_list_box_select_all_between (box, selected_row, row, FALSE);
|
||||
{
|
||||
gtk_list_box_select_all_between (box, selected_row, row, FALSE);
|
||||
box->selected_row = selected_row;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+11
-7
@@ -334,6 +334,7 @@ gtk_list_item_widget_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
{
|
||||
if (n_press == 2 && !priv->single_click_activate)
|
||||
{
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
gtk_widget_activate_action (GTK_WIDGET (self),
|
||||
"list.activate-item",
|
||||
"u",
|
||||
@@ -356,14 +357,17 @@ gtk_list_item_widget_click_gesture_released (GtkGestureClick *gesture,
|
||||
{
|
||||
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
|
||||
|
||||
if (priv->single_click_activate)
|
||||
if (!priv->list_item || priv->list_item->activatable)
|
||||
{
|
||||
gtk_widget_activate_action (GTK_WIDGET (self),
|
||||
"list.activate-item",
|
||||
"u",
|
||||
priv->position);
|
||||
|
||||
return;
|
||||
if (n_press == 1 && priv->single_click_activate)
|
||||
{
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
gtk_widget_activate_action (GTK_WIDGET (self),
|
||||
"list.activate-item",
|
||||
"u",
|
||||
priv->position);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!priv->list_item || priv->list_item->selectable)
|
||||
|
||||
@@ -214,6 +214,22 @@ gtk_menu_button_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_button_notify (GObject *object,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
if (strcmp (pspec->name, "focus-on-click") == 0)
|
||||
{
|
||||
GtkMenuButton *self = GTK_MENU_BUTTON (object);
|
||||
|
||||
gtk_widget_set_focus_on_click (self->button,
|
||||
gtk_widget_get_focus_on_click (GTK_WIDGET (self)));
|
||||
}
|
||||
|
||||
if (G_OBJECT_CLASS (gtk_menu_button_parent_class)->notify)
|
||||
G_OBJECT_CLASS (gtk_menu_button_parent_class)->notify (object, pspec);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_button_state_flags_changed (GtkWidget *widget,
|
||||
GtkStateFlags previous_state_flags)
|
||||
@@ -318,6 +334,7 @@ gtk_menu_button_class_init (GtkMenuButtonClass *klass)
|
||||
|
||||
gobject_class->set_property = gtk_menu_button_set_property;
|
||||
gobject_class->get_property = gtk_menu_button_get_property;
|
||||
gobject_class->notify = gtk_menu_button_notify;
|
||||
gobject_class->dispose = gtk_menu_button_dispose;
|
||||
|
||||
widget_class->measure = gtk_menu_button_measure;
|
||||
|
||||
@@ -1404,7 +1404,8 @@ pointer_cb (GObject *object,
|
||||
GtkModelButton *button = data;
|
||||
|
||||
stop_open (button);
|
||||
gtk_popover_menu_set_active_item (GTK_POPOVER_MENU (popover), NULL);
|
||||
if (popover)
|
||||
gtk_popover_menu_set_active_item (GTK_POPOVER_MENU (popover), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ gtk_native_layout (GtkNative *self,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
return GTK_NATIVE_GET_IFACE (self)->layout (self, width, height);
|
||||
GTK_NATIVE_GET_IFACE (self)->layout (self, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -258,7 +258,7 @@ gtk_native_get_surface_transform (GtkNative *self,
|
||||
g_return_if_fail (x != NULL);
|
||||
g_return_if_fail (y != NULL);
|
||||
|
||||
return GTK_NATIVE_GET_IFACE (self)->get_surface_transform (self, x, y);
|
||||
GTK_NATIVE_GET_IFACE (self)->get_surface_transform (self, x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-2
@@ -5461,6 +5461,9 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
|
||||
gtk_widget_set_state_flags (page->tab_widget, GTK_STATE_FLAG_CHECKED, FALSE);
|
||||
gtk_widget_set_visible (notebook->header_widget, notebook->show_tabs);
|
||||
|
||||
if (gtk_widget_get_realized (GTK_WIDGET (notebook)))
|
||||
gtk_widget_realize_at_context (notebook->cur_page->tab_widget);
|
||||
|
||||
gtk_accessible_update_state (GTK_ACCESSIBLE (notebook->cur_page->tab_widget),
|
||||
GTK_ACCESSIBLE_STATE_SELECTED, TRUE,
|
||||
-1);
|
||||
@@ -5649,8 +5652,8 @@ gtk_notebook_menu_item_recreate (GtkNotebook *notebook,
|
||||
GtkNotebookPage *page = list->data;
|
||||
GtkWidget *menu_item = gtk_widget_get_parent (page->menu_label);
|
||||
|
||||
gtk_box_remove (GTK_BOX (menu_item), page->menu_label);
|
||||
gtk_widget_unparent (menu_item);
|
||||
gtk_button_set_child (GTK_BUTTON (menu_item), NULL);
|
||||
gtk_box_remove (GTK_BOX (notebook->menu_box), menu_item);
|
||||
gtk_notebook_menu_item_create (notebook, page);
|
||||
}
|
||||
|
||||
|
||||
@@ -532,6 +532,8 @@ gtk_password_entry_accessible_get_platform_state (GtkAccessible *se
|
||||
return gtk_widget_get_focusable (GTK_WIDGET (entry->entry));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED:
|
||||
return gtk_widget_has_focus (GTK_WIDGET (entry->entry));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE:
|
||||
return FALSE;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -795,6 +795,9 @@ on_bookmark_query_info_complete (GObject *source,
|
||||
{
|
||||
/* Don't add non-UTF-8 bookmarks */
|
||||
bookmark_name = g_file_get_basename (root);
|
||||
if (bookmark_name == NULL)
|
||||
goto out;
|
||||
|
||||
if (!g_utf8_validate (bookmark_name, -1, NULL))
|
||||
{
|
||||
g_free (bookmark_name);
|
||||
|
||||
+18
-7
@@ -550,7 +550,7 @@ populate_servers (GtkPlacesView *view)
|
||||
|
||||
/* clear previous items */
|
||||
while ((child = gtk_widget_get_first_child (GTK_WIDGET (view->recent_servers_listbox))))
|
||||
gtk_list_box_remove (GTK_LIST_BOX (view->listbox), child);
|
||||
gtk_list_box_remove (GTK_LIST_BOX (view->recent_servers_listbox), child);
|
||||
|
||||
gtk_list_store_clear (view->completion_store);
|
||||
|
||||
@@ -1215,12 +1215,14 @@ server_mount_ready_cb (GObject *source_file,
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
if (view->destroyed) {
|
||||
g_object_unref (view);
|
||||
return;
|
||||
}
|
||||
if (view->destroyed)
|
||||
{
|
||||
g_object_unref (view);
|
||||
return;
|
||||
}
|
||||
|
||||
view->should_pulse_entry = FALSE;
|
||||
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0);
|
||||
|
||||
/* Restore from Cancel to Connect */
|
||||
gtk_button_set_label (GTK_BUTTON (view->connect_button), _("Con_nect"));
|
||||
@@ -1243,6 +1245,11 @@ server_mount_ready_cb (GObject *source_file,
|
||||
GMount *mount;
|
||||
GFile *root;
|
||||
|
||||
/*
|
||||
* If the mount is not found at this point, it is probably user-
|
||||
* invisible, which happens e.g for smb-browse, but the location
|
||||
* should be opened anyway...
|
||||
*/
|
||||
mount = g_file_find_enclosing_mount (location, view->cancellable, NULL);
|
||||
if (mount)
|
||||
{
|
||||
@@ -1253,6 +1260,10 @@ server_mount_ready_cb (GObject *source_file,
|
||||
g_object_unref (root);
|
||||
g_object_unref (mount);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_open_location (view, location, view->open_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1388,8 +1399,7 @@ pulse_entry_cb (gpointer user_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_entry_set_progress_pulse_step (GTK_ENTRY (view->address_entry), 0.0);
|
||||
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0.0);
|
||||
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0);
|
||||
view->entry_pulse_timeout_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
@@ -1443,6 +1453,7 @@ mount_server (GtkPlacesView *view,
|
||||
|
||||
view->should_pulse_entry = TRUE;
|
||||
gtk_entry_set_progress_pulse_step (GTK_ENTRY (view->address_entry), 0.1);
|
||||
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0.1);
|
||||
/* Allow to cancel the operation */
|
||||
gtk_button_set_label (GTK_BUTTON (view->connect_button), _("Cance_l"));
|
||||
gtk_widget_set_sensitive (view->address_entry, FALSE);
|
||||
|
||||
@@ -720,7 +720,7 @@ build_recent_items_list (GtkRecentManager *manager)
|
||||
* signal each time something inside the list changes.
|
||||
*
|
||||
* `GtkRecentManager` objects are expensive: be sure to create them
|
||||
* only when needed. You should use [type_func@Gtk.RecentManager.get_default]
|
||||
* only when needed. You should use [func@Gtk.RecentManager.get_default]
|
||||
* instead.
|
||||
*
|
||||
* Returns: A newly created `GtkRecentManager` object
|
||||
|
||||
+40
-21
@@ -401,9 +401,6 @@ static void indicator_start_fade (Indicator *indicator,
|
||||
static void indicator_set_over (Indicator *indicator,
|
||||
gboolean over);
|
||||
|
||||
static void install_scroll_cursor (GtkScrolledWindow *scrolled_window);
|
||||
static void uninstall_scroll_cursor (GtkScrolledWindow *scrolled_window);
|
||||
|
||||
static void scrolled_window_scroll (GtkScrolledWindow *scrolled_window,
|
||||
double delta_x,
|
||||
double delta_y,
|
||||
@@ -1335,10 +1332,7 @@ start_scroll_deceleration_cb (gpointer user_data)
|
||||
priv->scroll_events_overshoot_id = 0;
|
||||
|
||||
if (!priv->deceleration_id)
|
||||
{
|
||||
uninstall_scroll_cursor (scrolled_window);
|
||||
gtk_scrolled_window_start_deceleration (scrolled_window);
|
||||
}
|
||||
gtk_scrolled_window_start_deceleration (scrolled_window);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1349,7 +1343,6 @@ scroll_controller_scroll_begin (GtkEventControllerScroll *scroll,
|
||||
{
|
||||
GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window);
|
||||
|
||||
install_scroll_cursor (scrolled_window);
|
||||
priv->smooth_scroll = TRUE;
|
||||
}
|
||||
|
||||
@@ -1442,7 +1435,6 @@ scroll_controller_scroll_end (GtkEventControllerScroll *scroll,
|
||||
GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window);
|
||||
|
||||
priv->smooth_scroll = FALSE;
|
||||
uninstall_scroll_cursor (scrolled_window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3184,18 +3176,6 @@ gtk_scrolled_window_allocate_scrollbar (GtkScrolledWindow *scrolled_window,
|
||||
*allocation = child_allocation;
|
||||
}
|
||||
|
||||
static void
|
||||
install_scroll_cursor (GtkScrolledWindow *scrolled_window)
|
||||
{
|
||||
gtk_widget_set_cursor_from_name (GTK_WIDGET (scrolled_window), "all-scroll");
|
||||
}
|
||||
|
||||
static void
|
||||
uninstall_scroll_cursor (GtkScrolledWindow *scrolled_window)
|
||||
{
|
||||
gtk_widget_set_cursor (GTK_WIDGET (scrolled_window), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_scrolled_window_set_adjustment_value (GtkScrolledWindow *scrolled_window,
|
||||
GtkAdjustment *adjustment,
|
||||
@@ -3455,6 +3435,24 @@ gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjustment,
|
||||
|
||||
if (priv->hscrollbar_visible != visible)
|
||||
gtk_widget_queue_resize (GTK_WIDGET (scrolled_window));
|
||||
|
||||
if (priv->hscrolling)
|
||||
{
|
||||
GtkKineticScrollingChange change;
|
||||
double lower = gtk_adjustment_get_lower (adjustment);
|
||||
double upper = gtk_adjustment_get_upper (adjustment);
|
||||
upper -= gtk_adjustment_get_page_size (adjustment);
|
||||
|
||||
change = gtk_kinetic_scrolling_update_size (priv->hscrolling, lower, upper);
|
||||
|
||||
if ((change & GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT) &&
|
||||
(change & (GTK_KINETIC_SCROLLING_CHANGE_UPPER | GTK_KINETIC_SCROLLING_CHANGE_LOWER)))
|
||||
{
|
||||
g_clear_pointer (&priv->hscrolling, gtk_kinetic_scrolling_free);
|
||||
priv->unclamped_hadj_value = gtk_adjustment_get_value (adjustment);
|
||||
gtk_scrolled_window_invalidate_overshoot (scrolled_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (adjustment == gtk_scrollbar_get_adjustment (GTK_SCROLLBAR (priv->vscrollbar)))
|
||||
@@ -3468,8 +3466,29 @@ gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjustment,
|
||||
|
||||
if (priv->vscrollbar_visible != visible)
|
||||
gtk_widget_queue_resize (GTK_WIDGET (scrolled_window));
|
||||
|
||||
if (priv->vscrolling)
|
||||
{
|
||||
GtkKineticScrollingChange change;
|
||||
double lower = gtk_adjustment_get_lower (adjustment);
|
||||
double upper = gtk_adjustment_get_upper (adjustment);
|
||||
upper -= gtk_adjustment_get_page_size (adjustment);
|
||||
|
||||
change = gtk_kinetic_scrolling_update_size (priv->vscrolling, lower, upper);
|
||||
|
||||
if ((change & GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT) &&
|
||||
(change & (GTK_KINETIC_SCROLLING_CHANGE_UPPER | GTK_KINETIC_SCROLLING_CHANGE_LOWER)))
|
||||
{
|
||||
g_clear_pointer (&priv->vscrolling, gtk_kinetic_scrolling_free);
|
||||
priv->unclamped_vadj_value = gtk_adjustment_get_value (adjustment);
|
||||
gtk_scrolled_window_invalidate_overshoot (scrolled_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!priv->hscrolling && !priv->vscrolling)
|
||||
gtk_scrolled_window_cancel_deceleration (scrolled_window);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -475,6 +475,8 @@ gtk_search_entry_accessible_get_platform_state (GtkAccessible *self
|
||||
return gtk_widget_get_focusable (GTK_WIDGET (entry->entry));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED:
|
||||
return gtk_widget_has_focus (GTK_WIDGET (entry->entry));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE:
|
||||
return FALSE;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -943,6 +943,19 @@ sec_acquire_pages (size_t *sz,
|
||||
|
||||
DEBUG_ALLOC ("gtk-secure-memory: new block ", *sz);
|
||||
|
||||
#if defined(HAVE_MADVISE) && defined(MADV_DONTDUMP)
|
||||
if (madvise (pages, *sz, MADV_DONTDUMP) < 0) {
|
||||
if (show_warning && gtk_secure_warnings) {
|
||||
/*
|
||||
* Not fatal - this was added in Linux 3.4 and older
|
||||
* kernels will legitimately fail this at runtime
|
||||
*/
|
||||
fprintf (stderr, "couldn't MADV_DONTDUMP %lu bytes of memory (%s): %s\n",
|
||||
(unsigned long)*sz, during_tag, strerror (errno));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
show_warning = 1;
|
||||
return pages;
|
||||
|
||||
|
||||
+3
-2
@@ -89,7 +89,7 @@
|
||||
* configuration facility.
|
||||
*
|
||||
* There is one `GtkSettings` instance per display. It can be obtained with
|
||||
* [type_func@GtkSettings.get_for_display], but in many cases, it is more
|
||||
* [func@Gtk.Settings.get_for_display], but in many cases, it is more
|
||||
* convenient to use [method@Gtk.Widget.get_settings].
|
||||
*/
|
||||
|
||||
@@ -1333,7 +1333,7 @@ gtk_settings_get_for_display (GdkDisplay *display)
|
||||
* Gets the `GtkSettings` object for the default display, creating
|
||||
* it if necessary.
|
||||
*
|
||||
* See [type_func@Gtk.Settings.get_for_display].
|
||||
* See [func@Gtk.Settings.get_for_display].
|
||||
*
|
||||
* Returns: (nullable) (transfer none): a `GtkSettings` object. If there is
|
||||
* no default display, then returns %NULL.
|
||||
@@ -1432,6 +1432,7 @@ gtk_settings_notify (GObject *object,
|
||||
settings_update_theme (settings);
|
||||
break;
|
||||
case PROP_XFT_DPI:
|
||||
settings_invalidate_style (settings);
|
||||
gtk_system_setting_changed (settings->display, GTK_SYSTEM_SETTING_DPI);
|
||||
break;
|
||||
case PROP_XFT_ANTIALIAS:
|
||||
|
||||
@@ -132,7 +132,7 @@ gtk_shortcut_action_print (GtkShortcutAction *self,
|
||||
g_return_if_fail (GTK_IS_SHORTCUT_ACTION (self));
|
||||
g_return_if_fail (string != NULL);
|
||||
|
||||
return GTK_SHORTCUT_ACTION_GET_CLASS (self)->print (self, string);
|
||||
GTK_SHORTCUT_ACTION_GET_CLASS (self)->print (self, string);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -432,9 +432,11 @@ gtk_shortcut_controller_handle_event (GtkEventController *controller,
|
||||
|
||||
if (event_type == GDK_KEY_PRESS)
|
||||
{
|
||||
GdkModifierType modifiers;
|
||||
GdkModifierType modifiers, consumed_modifiers;
|
||||
|
||||
modifiers = gdk_event_get_modifier_state (event);
|
||||
enable_mnemonics = (modifiers & gtk_accelerator_get_default_mod_mask ()) == self->mnemonics_modifiers;
|
||||
consumed_modifiers = gdk_key_event_get_consumed_modifiers (event);
|
||||
enable_mnemonics = (modifiers & ~consumed_modifiers & gtk_accelerator_get_default_mod_mask ()) == self->mnemonics_modifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+25
-19
@@ -1413,7 +1413,8 @@ gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
||||
}
|
||||
|
||||
static GskRenderNode *
|
||||
gtk_snapshot_pop_internal (GtkSnapshot *snapshot)
|
||||
gtk_snapshot_pop_internal (GtkSnapshot *snapshot,
|
||||
gboolean is_texture_pop)
|
||||
{
|
||||
GtkSnapshotState *state;
|
||||
GskRenderNode *node;
|
||||
@@ -1437,6 +1438,17 @@ gtk_snapshot_pop_internal (GtkSnapshot *snapshot)
|
||||
g_warning ("Too many gtk_snapshot_save() calls. %u saves remaining.", forgotten_restores);
|
||||
}
|
||||
|
||||
if (is_texture_pop && (state->collect_func != gtk_snapshot_collect_gl_shader_texture))
|
||||
{
|
||||
g_critical ("Unexpected call to gtk_snapshot_gl_shader_pop_texture().");
|
||||
return NULL;
|
||||
}
|
||||
else if (!is_texture_pop && (state->collect_func == gtk_snapshot_collect_gl_shader_texture))
|
||||
{
|
||||
g_critical ("Expected a call to gtk_snapshot_gl_shader_pop_texture().");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return gtk_snapshot_pop_one (snapshot);
|
||||
}
|
||||
|
||||
@@ -1460,7 +1472,7 @@ gtk_snapshot_push_collect (GtkSnapshot *snapshot)
|
||||
GskRenderNode *
|
||||
gtk_snapshot_pop_collect (GtkSnapshot *snapshot)
|
||||
{
|
||||
GskRenderNode *result = gtk_snapshot_pop_internal (snapshot);
|
||||
GskRenderNode *result = gtk_snapshot_pop_internal (snapshot, FALSE);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1483,7 +1495,7 @@ gtk_snapshot_to_node (GtkSnapshot *snapshot)
|
||||
{
|
||||
GskRenderNode *result;
|
||||
|
||||
result = gtk_snapshot_pop_internal (snapshot);
|
||||
result = gtk_snapshot_pop_internal (snapshot, FALSE);
|
||||
|
||||
/* We should have exactly our initial state */
|
||||
if (!gtk_snapshot_states_is_empty (&snapshot->state_stack))
|
||||
@@ -1551,13 +1563,9 @@ gtk_snapshot_to_paintable (GtkSnapshot *snapshot,
|
||||
void
|
||||
gtk_snapshot_pop (GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkSnapshotState *state = gtk_snapshot_get_current_state (snapshot);
|
||||
GskRenderNode *node;
|
||||
|
||||
if (state->collect_func == gtk_snapshot_collect_gl_shader_texture)
|
||||
g_warning ("Not enough calls to gtk_snapshot_gl_shader_pop_texture().");
|
||||
|
||||
node = gtk_snapshot_pop_internal (snapshot);
|
||||
node = gtk_snapshot_pop_internal (snapshot, FALSE);
|
||||
|
||||
if (node)
|
||||
gtk_snapshot_append_node_internal (snapshot, node);
|
||||
@@ -1577,18 +1585,9 @@ gtk_snapshot_pop (GtkSnapshot *snapshot)
|
||||
void
|
||||
gtk_snapshot_gl_shader_pop_texture (GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkSnapshotState *state = gtk_snapshot_get_current_state (snapshot);
|
||||
G_GNUC_UNUSED GskRenderNode *node;
|
||||
|
||||
if (state->collect_func != gtk_snapshot_collect_gl_shader_texture)
|
||||
{
|
||||
g_warning ("Too many calls to gtk_snapshot_gl_shader_pop_texture().");
|
||||
return;
|
||||
}
|
||||
|
||||
g_assert (state->collect_func == gtk_snapshot_collect_gl_shader_texture);
|
||||
|
||||
node = gtk_snapshot_pop_internal (snapshot);
|
||||
node = gtk_snapshot_pop_internal (snapshot, TRUE);
|
||||
g_assert (node == NULL);
|
||||
}
|
||||
|
||||
@@ -2448,7 +2447,14 @@ gtk_snapshot_append_border (GtkSnapshot *snapshot,
|
||||
gtk_snapshot_ensure_affine (snapshot, &scale_x, &scale_y, &dx, &dy);
|
||||
gsk_rounded_rect_scale_affine (&real_outline, outline, scale_x, scale_y, dx, dy);
|
||||
|
||||
node = gsk_border_node_new (&real_outline, border_width, border_color);
|
||||
node = gsk_border_node_new (&real_outline,
|
||||
(float[4]) {
|
||||
border_width[0] * scale_y,
|
||||
border_width[1] * scale_x,
|
||||
border_width[2] * scale_y,
|
||||
border_width[3] * scale_x,
|
||||
},
|
||||
border_color);
|
||||
|
||||
gtk_snapshot_append_node_internal (snapshot, node);
|
||||
}
|
||||
|
||||
+10
-3
@@ -208,6 +208,7 @@ struct _GtkSpinButton
|
||||
|
||||
double climb_rate;
|
||||
double timer_step;
|
||||
double swipe_remainder;
|
||||
|
||||
int width_chars;
|
||||
|
||||
@@ -633,6 +634,8 @@ gtk_spin_button_accessible_get_platform_state (GtkAccessible *self,
|
||||
return gtk_widget_get_focusable (spin_button->entry);
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED:
|
||||
return gtk_widget_has_focus (spin_button->entry);
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE:
|
||||
return FALSE;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
@@ -836,6 +839,7 @@ swipe_gesture_begin (GtkGesture *gesture,
|
||||
{
|
||||
gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
gtk_widget_grab_focus (GTK_WIDGET (spin_button));
|
||||
spin_button->swipe_remainder = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -843,10 +847,12 @@ swipe_gesture_update (GtkGesture *gesture,
|
||||
GdkEventSequence *sequence,
|
||||
GtkSpinButton *spin_button)
|
||||
{
|
||||
double vel_y;
|
||||
double vel_y, step;
|
||||
|
||||
gtk_gesture_swipe_get_velocity (GTK_GESTURE_SWIPE (gesture), NULL, &vel_y);
|
||||
gtk_spin_button_real_spin (spin_button, -vel_y / 20);
|
||||
step = (-vel_y / 20) + spin_button->swipe_remainder;
|
||||
spin_button->swipe_remainder = fmod (step, gtk_adjustment_get_step_increment (spin_button->adjustment));
|
||||
gtk_spin_button_real_spin (spin_button, step - spin_button->swipe_remainder);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1076,7 +1082,8 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
|
||||
G_CALLBACK (swipe_gesture_begin), spin_button);
|
||||
g_signal_connect (gesture, "update",
|
||||
G_CALLBACK (swipe_gesture_update), spin_button);
|
||||
gtk_widget_add_controller (GTK_WIDGET (spin_button), GTK_EVENT_CONTROLLER (gesture));
|
||||
gtk_widget_add_controller (GTK_WIDGET (spin_button->entry),
|
||||
GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
controller = gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_VERTICAL |
|
||||
GTK_EVENT_CONTROLLER_SCROLL_DISCRETE);
|
||||
|
||||
@@ -154,6 +154,10 @@ rebuild_child (GtkWidget *self,
|
||||
gtk_widget_set_halign (GTK_WIDGET (button_child), GTK_ALIGN_CENTER);
|
||||
gtk_button_set_child (GTK_BUTTON (self), button_child);
|
||||
}
|
||||
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (self),
|
||||
GTK_ACCESSIBLE_PROPERTY_LABEL, title,
|
||||
-1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -78,12 +78,37 @@ gtk_test_at_context_state_change (GtkATContext *self,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_test_at_context_platform_change (GtkATContext *self,
|
||||
GtkAccessiblePlatformChange changed_platform)
|
||||
{
|
||||
if (GTK_DEBUG_CHECK (A11Y))
|
||||
{
|
||||
GtkAccessible *accessible;
|
||||
|
||||
accessible = gtk_at_context_get_accessible (self);
|
||||
|
||||
g_print ("*** Accessible platform state changed for accessible “%s”:\n",
|
||||
G_OBJECT_TYPE_NAME (accessible));
|
||||
if (changed_platform & GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSABLE)
|
||||
g_print ("*** focusable = %d\n",
|
||||
gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE));
|
||||
if (changed_platform & GTK_ACCESSIBLE_PLATFORM_CHANGE_FOCUSED)
|
||||
g_print ("*** focused = %d\n",
|
||||
gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED));
|
||||
if (changed_platform & GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE)
|
||||
g_print ("*** active = %d\n",
|
||||
gtk_accessible_get_platform_state (accessible, GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_test_at_context_class_init (GtkTestATContextClass *klass)
|
||||
{
|
||||
GtkATContextClass *context_class = GTK_AT_CONTEXT_CLASS (klass);
|
||||
|
||||
context_class->state_change = gtk_test_at_context_state_change;
|
||||
context_class->platform_change = gtk_test_at_context_platform_change;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -199,6 +199,9 @@ gtk_toggle_button_clicked (GtkButton *button)
|
||||
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
|
||||
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (toggle_button);
|
||||
|
||||
if (priv->active && (priv->group_prev || priv->group_next))
|
||||
return;
|
||||
|
||||
gtk_toggle_button_set_active (toggle_button, !priv->active);
|
||||
}
|
||||
|
||||
@@ -475,7 +478,7 @@ gtk_toggle_button_toggled (GtkToggleButton *toggle_button)
|
||||
*
|
||||
* Setting up groups in a cycle leads to undefined behavior.
|
||||
*
|
||||
* Note that the same effect can be achieved via the [interface@Gtk.Actionable]
|
||||
* Note that the same effect can be achieved via the [iface@Gtk.Actionable]
|
||||
* API, by using the same action with parameter type and state type 's'
|
||||
* for all buttons in the group, and giving each button its own target
|
||||
* value.
|
||||
|
||||
+12
-5
@@ -151,6 +151,8 @@ gtk_tree_expander_update_for_list_row (GtkTreeExpander *self)
|
||||
gtk_widget_unparent (child);
|
||||
}
|
||||
self->expander = NULL;
|
||||
|
||||
gtk_accessible_reset_state (GTK_ACCESSIBLE (self), GTK_ACCESSIBLE_STATE_EXPANDED);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -192,22 +194,19 @@ gtk_tree_expander_update_for_list_row (GtkTreeExpander *self)
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (self->expander),
|
||||
GTK_ACCESSIBLE_PROPERTY_LABEL, _("Expand"),
|
||||
-1);
|
||||
gtk_accessible_update_relation (GTK_ACCESSIBLE (self->expander),
|
||||
GTK_ACCESSIBLE_RELATION_LABELLED_BY, self->child, NULL,
|
||||
-1);
|
||||
}
|
||||
|
||||
if (gtk_tree_list_row_get_expanded (self->list_row))
|
||||
{
|
||||
gtk_widget_set_state_flags (self->expander, GTK_STATE_FLAG_CHECKED, FALSE);
|
||||
gtk_accessible_update_state (GTK_ACCESSIBLE (self->expander),
|
||||
gtk_accessible_update_state (GTK_ACCESSIBLE (self),
|
||||
GTK_ACCESSIBLE_STATE_EXPANDED, TRUE,
|
||||
-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_unset_state_flags (self->expander, GTK_STATE_FLAG_CHECKED);
|
||||
gtk_accessible_update_state (GTK_ACCESSIBLE (self->expander),
|
||||
gtk_accessible_update_state (GTK_ACCESSIBLE (self),
|
||||
GTK_ACCESSIBLE_STATE_EXPANDED, FALSE,
|
||||
-1);
|
||||
}
|
||||
@@ -725,6 +724,14 @@ gtk_tree_expander_set_child (GtkTreeExpander *self,
|
||||
{
|
||||
self->child = child;
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (self));
|
||||
|
||||
gtk_accessible_update_relation (GTK_ACCESSIBLE (self),
|
||||
GTK_ACCESSIBLE_RELATION_LABELLED_BY, self->child, NULL,
|
||||
-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_accessible_reset_relation (GTK_ACCESSIBLE (self), GTK_ACCESSIBLE_RELATION_LABELLED_BY);
|
||||
}
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CHILD]);
|
||||
|
||||
@@ -37,7 +37,7 @@ G_BEGIN_DECLS
|
||||
/**
|
||||
* GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID:
|
||||
*
|
||||
* Uses the default sort function in a [interface@Gtk.TreeSortable].
|
||||
* Uses the default sort function in a [iface@Gtk.TreeSortable].
|
||||
*
|
||||
* See also: [method@Gtk.TreeSortable.set_sort_column_id]
|
||||
*/
|
||||
@@ -46,7 +46,7 @@ G_BEGIN_DECLS
|
||||
/**
|
||||
* GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID:
|
||||
*
|
||||
* Disables sorting in a [interface@Gtk.TreeSortable].
|
||||
* Disables sorting in a [iface@Gtk.TreeSortable].
|
||||
*
|
||||
* See also: [method@Gtk.TreeSortable.set_sort_column_id]
|
||||
*/
|
||||
|
||||
@@ -855,6 +855,7 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
|
||||
priv->button = gtk_button_new ();
|
||||
g_object_ref_sink (priv->button);
|
||||
gtk_widget_set_focus_on_click (priv->button, FALSE);
|
||||
gtk_widget_set_overflow (priv->button, GTK_OVERFLOW_HIDDEN);
|
||||
|
||||
g_signal_connect (priv->button, "clicked",
|
||||
G_CALLBACK (gtk_tree_view_column_button_clicked),
|
||||
|
||||
+21
-5
@@ -74,6 +74,7 @@
|
||||
#include "gtkwidgetpaintableprivate.h"
|
||||
#include "gtkwindowgroup.h"
|
||||
#include "gtkwindowprivate.h"
|
||||
#include "gtktestatcontextprivate.h"
|
||||
|
||||
#include "inspector/window.h"
|
||||
|
||||
@@ -2449,13 +2450,13 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
|
||||
priv->at_context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (widget));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_realize_at_context (GtkWidget *self)
|
||||
static void
|
||||
gtk_widget_root_at_context (GtkWidget *self)
|
||||
{
|
||||
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (self);
|
||||
GtkAccessibleRole role = priv->accessible_role;
|
||||
|
||||
if (priv->at_context == NULL || gtk_at_context_is_realized (priv->at_context))
|
||||
if (priv->at_context == NULL)
|
||||
return;
|
||||
|
||||
/* Reset the accessible role to its current value */
|
||||
@@ -2468,6 +2469,17 @@ gtk_widget_realize_at_context (GtkWidget *self)
|
||||
|
||||
gtk_at_context_set_accessible_role (priv->at_context, role);
|
||||
gtk_at_context_set_display (priv->at_context, gtk_root_get_display (priv->root));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_realize_at_context (GtkWidget *self)
|
||||
{
|
||||
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (self);
|
||||
|
||||
if (priv->at_context == NULL || gtk_at_context_is_realized (priv->at_context))
|
||||
return;
|
||||
|
||||
gtk_widget_root_at_context (self);
|
||||
gtk_at_context_realize (priv->at_context);
|
||||
}
|
||||
|
||||
@@ -2511,6 +2523,8 @@ gtk_widget_root (GtkWidget *widget)
|
||||
if (priv->layout_manager)
|
||||
gtk_layout_manager_set_root (priv->layout_manager, priv->root);
|
||||
|
||||
gtk_widget_root_at_context (widget);
|
||||
|
||||
GTK_WIDGET_GET_CLASS (widget)->root (widget);
|
||||
|
||||
if (!GTK_IS_ROOT (widget))
|
||||
@@ -7812,7 +7826,7 @@ _gtk_widget_list_devices (GtkWidget *widget,
|
||||
}
|
||||
|
||||
root = gtk_widget_get_root (widget);
|
||||
if (!root)
|
||||
if (!GTK_IS_WINDOW (root))
|
||||
{
|
||||
*out_n_devices = 0;
|
||||
return NULL;
|
||||
@@ -8492,6 +8506,8 @@ gtk_widget_accessible_get_platform_state (GtkAccessible *self,
|
||||
return gtk_widget_get_focusable (GTK_WIDGET (self));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED:
|
||||
return gtk_widget_has_focus (GTK_WIDGET (self));
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE:
|
||||
return FALSE;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
@@ -12146,7 +12162,7 @@ gtk_widget_set_cursor (GtkWidget *widget,
|
||||
return;
|
||||
|
||||
root = _gtk_widget_get_root (widget);
|
||||
if (root)
|
||||
if (GTK_IS_WINDOW (root))
|
||||
gtk_window_maybe_update_cursor (GTK_WINDOW (root), widget, NULL);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_CURSOR]);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user