Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ced8d1803 | |||
| 14b1873e5a |
+1
-1
@@ -26,7 +26,7 @@ variables:
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v28"
|
||||
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
|
||||
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v27"
|
||||
DOCS_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora-docs:v26"
|
||||
|
||||
.only-default:
|
||||
only:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
FROM registry.gitlab.gnome.org/gnome/gtk/fedora-base:v28
|
||||
|
||||
RUN dnf -y install \
|
||||
graphviz \
|
||||
python3-jinja2 \
|
||||
python3-markdown \
|
||||
python3-pygments \
|
||||
|
||||
@@ -1,79 +1,3 @@
|
||||
Overview of Changes in 4.3.0
|
||||
============================
|
||||
|
||||
* 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,9 +76,6 @@
|
||||
/* 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,7 +25,6 @@
|
||||
<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>
|
||||
@@ -33,7 +32,6 @@
|
||||
<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>
|
||||
@@ -43,7 +41,6 @@
|
||||
<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,14 +25,12 @@
|
||||
</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"/>
|
||||
@@ -42,7 +40,6 @@
|
||||
</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>
|
||||
@@ -50,7 +47,6 @@
|
||||
</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">920</property>
|
||||
<property name="default-height">600</property>
|
||||
<property name="default-width">720</property>
|
||||
<property name="default-height">520</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<child>
|
||||
|
||||
@@ -438,7 +438,6 @@ 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,9 +21,3 @@ 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,9 +21,3 @@ 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://docs.gtk.org/Pango/"
|
||||
docs_url = "https://developer.gnome.org/pango/stable"
|
||||
|
||||
[dependencies."GdkWayland-4.0"]
|
||||
name = "GdkWayland"
|
||||
description = "GDK Wayland Backend"
|
||||
docs_url = "https://docs.gtk.org/gdk4-wayland/"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4-wayland/"
|
||||
|
||||
[dependencies."GdkX11-4.0"]
|
||||
name = "GdkX11"
|
||||
description = "GDK X11 Backend"
|
||||
docs_url = "https://docs.gtk.org/gdk4-x11/"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/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://docs.gtk.org/Pango/"
|
||||
docs_url = "https://developer.gnome.org/pango/stable"
|
||||
|
||||
[dependencies."Gdk-4.0"]
|
||||
name = "GDK"
|
||||
description = "The GTK windowing system abstraction"
|
||||
docs_url = "https://docs.gtk.org/gdk4/"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
|
||||
@@ -3,29 +3,27 @@ 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.
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```
|
||||
gtk4-broadwayd :5
|
||||
broadwayd :5
|
||||
```
|
||||
|
||||
Then point your web browser at `http://127.0.0.1:8085`.
|
||||
|
||||
Once the Broadway server is running, you can start your applications like
|
||||
this:
|
||||
Start your applications like this:
|
||||
|
||||
```
|
||||
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk4-demo
|
||||
@@ -33,13 +31,9 @@ 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://docs.gtk.org/Pango/"
|
||||
docs_url = "https://developer.gnome.org/pango/stable"
|
||||
|
||||
[dependencies."Gdk-4.0"]
|
||||
name = "GDK"
|
||||
description = "The GTK windowing system abstraction"
|
||||
docs_url = "https://docs.gtk.org/gdk4/"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gdk4/"
|
||||
|
||||
[dependencies."Gsk-4.0"]
|
||||
name = "GSK"
|
||||
description = "The GTK rendering abstraction"
|
||||
docs_url = "https://docs.gtk.org/gsk4/"
|
||||
docs_url = "https://gnome.pages.gitlab.gnome.org/gtk/gsk4/"
|
||||
|
||||
[theme]
|
||||
name = "basic"
|
||||
|
||||
@@ -70,21 +70,16 @@ 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')
|
||||
|
||||
@@ -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'
|
||||
docs_dir = gtk_datadir / 'doc/gtk4/reference'
|
||||
|
||||
subdir('gdk')
|
||||
subdir('gsk')
|
||||
|
||||
+10
-10
@@ -554,19 +554,19 @@ gdk_clipboard_store_async (GdkClipboard *clipboard,
|
||||
|
||||
if (priv->local)
|
||||
{
|
||||
GDK_CLIPBOARD_GET_CLASS (clipboard)->store_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
return GDK_CLIPBOARD_GET_CLASS (clipboard)->store_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_clipboard_store_default_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
return gdk_clipboard_store_default_async (clipboard,
|
||||
io_priority,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -672,18 +672,9 @@ 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 (mem_stream)));
|
||||
g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (
|
||||
g_filter_output_stream_get_base_stream (G_FILTER_OUTPUT_STREAM (stream)))));
|
||||
}
|
||||
gdk_content_deserializer_return_success (deserializer);
|
||||
}
|
||||
@@ -712,7 +703,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_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
|
||||
gdk_content_deserializer_get_priority (deserializer),
|
||||
gdk_content_deserializer_get_cancellable (deserializer),
|
||||
string_deserializer_finish,
|
||||
@@ -740,8 +731,7 @@ file_uri_deserializer_finish (GObject *source,
|
||||
}
|
||||
|
||||
/* write terminating NULL */
|
||||
if (g_output_stream_write (stream, "", 1, NULL, &error) < 0 ||
|
||||
!g_output_stream_close (stream, NULL, &error))
|
||||
if (!g_output_stream_write (stream, "", 1, NULL, &error))
|
||||
{
|
||||
gdk_content_deserializer_return_error (deserializer, error);
|
||||
return;
|
||||
@@ -781,7 +771,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_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
|
||||
gdk_content_deserializer_get_priority (deserializer),
|
||||
gdk_content_deserializer_get_cancellable (deserializer),
|
||||
file_uri_deserializer_finish,
|
||||
@@ -931,7 +921,7 @@ init (void)
|
||||
gdk_content_register_deserializer (mime,
|
||||
G_TYPE_STRING,
|
||||
string_deserializer,
|
||||
(gpointer) charset,
|
||||
mime,
|
||||
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 zero-terminated=1):
|
||||
* Returns: (transfer none) (nullable) (array length=n_gtypes):
|
||||
* %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) (optional): optional pointer to take the
|
||||
* @n_mime_types: (out) (allow-none): 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) (array length=n_mime_types zero-terminated=1): %NULL-terminated array of
|
||||
* Returns: (transfer none) (nullable): %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));
|
||||
|
||||
GDK_CONTENT_PROVIDER_GET_CLASS (provider)->attach_clipboard (provider, clipboard);
|
||||
return 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));
|
||||
|
||||
GDK_CONTENT_PROVIDER_GET_CLASS (provider)->detach_clipboard (provider, clipboard);
|
||||
return GDK_CONTENT_PROVIDER_GET_CLASS (provider)->detach_clipboard (provider, clipboard);
|
||||
}
|
||||
|
||||
+4
-10
@@ -1299,11 +1299,12 @@ 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))
|
||||
return;
|
||||
{
|
||||
surface->pending_phases |= GDK_FRAME_CLOCK_PHASE_PAINT;
|
||||
return;
|
||||
}
|
||||
|
||||
/* If there's no frame clock (a foreign surface), then the invalid
|
||||
* region will just stick around unless gdk_surface_process_updates()
|
||||
@@ -2443,7 +2444,6 @@ gdk_surface_ensure_motion (GdkSurface *surface)
|
||||
GdkEvent *event;
|
||||
double x, y;
|
||||
GdkModifierType state;
|
||||
GdkSurface *grab_surface;
|
||||
|
||||
if (!surface->request_motion)
|
||||
return;
|
||||
@@ -2460,12 +2460,6 @@ 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);
|
||||
|
||||
GDK_TEXTURE_GET_CLASS (texture)->download (texture, area, data, stride);
|
||||
return 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));
|
||||
|
||||
GDK_TOPLEVEL_GET_IFACE (toplevel)->focus (toplevel, timestamp);
|
||||
return GDK_TOPLEVEL_GET_IFACE (toplevel)->focus (toplevel, timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define HAVE_MEMFD_CREATE
|
||||
#ifdef HAVE_MEMFD_CREATE
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
@@ -256,23 +256,122 @@ postpone_on_globals_closure (GdkWaylandDisplay *display_wayland,
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
static const char *
|
||||
get_format_name (uint32_t format,
|
||||
char name[10])
|
||||
get_format_name (enum wl_shm_format format)
|
||||
{
|
||||
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));
|
||||
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),
|
||||
|
||||
return name;
|
||||
{ 0xffffffff, NULL }
|
||||
};
|
||||
#undef FORMAT
|
||||
|
||||
for (i = 0; formats[i].name; i++)
|
||||
{
|
||||
if (formats[i].format == format)
|
||||
return formats[i].name;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
@@ -280,10 +379,7 @@ wl_shm_format (void *data,
|
||||
struct wl_shm *wl_shm,
|
||||
uint32_t format)
|
||||
{
|
||||
GDK_NOTE (MISC,
|
||||
char buf[10];
|
||||
g_message ("supported pixel format %s", get_format_name (format, buf));
|
||||
);
|
||||
GDK_NOTE (MISC, g_message ("supported pixel format %s", get_format_name (format)));
|
||||
}
|
||||
|
||||
static const struct wl_shm_listener wl_shm_listener = {
|
||||
@@ -1612,13 +1708,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 = 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-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 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", "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", "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" } },
|
||||
@@ -1821,14 +1917,6 @@ 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);
|
||||
|
||||
@@ -712,30 +712,20 @@ _set_pixformat_for_hdc (HDC hdc,
|
||||
int *best_idx,
|
||||
GdkWin32Display *display)
|
||||
{
|
||||
gboolean already_checked = TRUE;
|
||||
*best_idx = GetPixelFormat (hdc);
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
gboolean set_pixel_format_result = FALSE;
|
||||
|
||||
/* one is only allowed to call SetPixelFormat(), and so ChoosePixelFormat()
|
||||
* one single time per window HDC
|
||||
*/
|
||||
if (*best_idx == 0)
|
||||
{
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
gboolean set_pixel_format_result = FALSE;
|
||||
*best_idx = _get_wgl_pfd (hdc, &pfd, display);
|
||||
|
||||
GDK_NOTE (OPENGL, g_print ("requesting pixel format...\n"));
|
||||
already_checked = FALSE;
|
||||
*best_idx = _get_wgl_pfd (hdc, &pfd, display);
|
||||
if (*best_idx != 0)
|
||||
set_pixel_format_result = SetPixelFormat (hdc, *best_idx, &pfd);
|
||||
|
||||
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));
|
||||
/* ChoosePixelFormat() or SetPixelFormat() failed, bail out */
|
||||
if (*best_idx == 0 || !set_pixel_format_result)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,6 @@ 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,9 +1795,6 @@ _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
|
||||
|
||||
+17
-6
@@ -185,13 +185,24 @@ 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 g_debug() instead of g_warning(), because g_warning()
|
||||
* could possibly be redirected to the log
|
||||
* We fprintf(stderr, instead of g_warning() because g_warning()
|
||||
* could possibly be redirected to a dialog
|
||||
*/
|
||||
g_debug ("%s: Fatal IO error %d (%s) on X server %s.\n",
|
||||
g_get_prgname (),
|
||||
errno, g_strerror (errno),
|
||||
display ? DisplayString (display) : "");
|
||||
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);
|
||||
}
|
||||
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
@@ -1822,16 +1822,9 @@ gdk_x11_surface_layout_popup (GdkSurface *surface,
|
||||
|
||||
monitor = gdk_surface_get_layout_monitor (surface, layout,
|
||||
gdk_x11_monitor_get_workarea);
|
||||
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_x11_monitor_get_workarea (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,
|
||||
@@ -4549,9 +4542,6 @@ 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))
|
||||
GSK_RENDER_NODE_GET_CLASS (node1)->diff (node1, node2, region);
|
||||
return GSK_RENDER_NODE_GET_CLASS (node1)->diff (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);
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+12
-18
@@ -1867,7 +1867,6 @@ 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))
|
||||
@@ -1877,9 +1876,7 @@ 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;
|
||||
|
||||
blur_radius = self->blur_radius / 2;
|
||||
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (blur_radius);
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (self->blur_radius);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
@@ -1893,8 +1890,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 (blur_radius))
|
||||
draw_shadow (cr, TRUE, &box, &clip_box, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
if (!needs_blur (self->blur_radius))
|
||||
draw_shadow (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
else
|
||||
{
|
||||
cairo_region_t *remaining;
|
||||
@@ -1925,7 +1922,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, blur_radius, &self->color, i, &r);
|
||||
draw_shadow_corner (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -1939,7 +1936,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, blur_radius, &self->color, i, &r);
|
||||
draw_shadow_side (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -1951,7 +1948,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, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
draw_shadow (cr, TRUE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_region_destroy (remaining);
|
||||
@@ -2162,7 +2159,6 @@ 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))
|
||||
@@ -2172,9 +2168,7 @@ 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;
|
||||
|
||||
blur_radius = self->blur_radius / 2;
|
||||
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (blur_radius);
|
||||
clip_radius = gsk_cairo_blur_compute_pixels (self->blur_radius);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
@@ -2192,8 +2186,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 (blur_radius))
|
||||
draw_shadow (cr, FALSE, &box, &clip_box, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
if (!needs_blur (self->blur_radius))
|
||||
draw_shadow (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
else
|
||||
{
|
||||
int i;
|
||||
@@ -2223,7 +2217,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, blur_radius, &self->color, i, &r);
|
||||
draw_shadow_corner (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -2237,7 +2231,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, blur_radius, &self->color, i, &r);
|
||||
draw_shadow_side (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, i, &r);
|
||||
cairo_restore (cr);
|
||||
|
||||
/* We drew the region, remove it from remaining */
|
||||
@@ -2249,7 +2243,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, blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
draw_shadow (cr, FALSE, &box, &clip_box, self->blur_radius, &self->color, GSK_BLUR_NONE);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_region_destroy (remaining);
|
||||
|
||||
+51
-77
@@ -203,7 +203,7 @@ gsk_rounded_rect_offset (GskRoundedRect *self,
|
||||
return self;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
border_radius_shrink (graphene_size_t *corner,
|
||||
double width,
|
||||
double height,
|
||||
@@ -252,29 +252,26 @@ gsk_rounded_rect_shrink (GskRoundedRect *self,
|
||||
float bottom,
|
||||
float left)
|
||||
{
|
||||
float width = left + right;
|
||||
float height = top + bottom;
|
||||
|
||||
if (self->bounds.size.width - width < 0)
|
||||
if (self->bounds.size.width - left - right < 0)
|
||||
{
|
||||
self->bounds.origin.x += left * self->bounds.size.width / width;
|
||||
self->bounds.origin.x += left * self->bounds.size.width / (left + right);
|
||||
self->bounds.size.width = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->bounds.origin.x += left;
|
||||
self->bounds.size.width -= width;
|
||||
self->bounds.size.width -= left + right;
|
||||
}
|
||||
|
||||
if (self->bounds.size.height - height < 0)
|
||||
if (self->bounds.size.height - bottom - top < 0)
|
||||
{
|
||||
self->bounds.origin.y += top * self->bounds.size.height / height;
|
||||
self->bounds.origin.y += top * self->bounds.size.height / (top + bottom);
|
||||
self->bounds.size.height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->bounds.origin.y += top;
|
||||
self->bounds.size.height -= height;
|
||||
self->bounds.size.height -= top + bottom;
|
||||
}
|
||||
|
||||
border_radius_shrink (&self->corner[GSK_CORNER_TOP_LEFT], left, top, &self->bounds.size);
|
||||
@@ -314,7 +311,9 @@ gsk_rounded_rect_scale_affine (GskRoundedRect *dest,
|
||||
gboolean
|
||||
gsk_rounded_rect_is_circular (const GskRoundedRect *self)
|
||||
{
|
||||
for (guint i = 0; i < 4; i++)
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (self->corner[i].width != self->corner[i].height)
|
||||
return FALSE;
|
||||
@@ -338,7 +337,9 @@ gsk_rounded_rect_is_circular (const GskRoundedRect *self)
|
||||
gboolean
|
||||
gsk_rounded_rect_is_rectilinear (const GskRoundedRect *self)
|
||||
{
|
||||
for (guint i = 0; i < 4; i++)
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (self->corner[i].width > 0 ||
|
||||
self->corner[i].height > 0)
|
||||
@@ -348,8 +349,8 @@ gsk_rounded_rect_is_rectilinear (const GskRoundedRect *self)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
ellipsis_contains_point (const graphene_size_t *ellipsis,
|
||||
static gboolean
|
||||
ellipsis_contains_point (const graphene_size_t *ellipsis,
|
||||
const graphene_point_t *point)
|
||||
{
|
||||
return (point->x * point->x) / (ellipsis->width * ellipsis->width)
|
||||
@@ -370,42 +371,46 @@ 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 > ox ||
|
||||
point->y > oy)
|
||||
point->x > self->bounds.origin.x + self->bounds.size.width ||
|
||||
point->y > self->bounds.origin.y + self->bounds.size.height)
|
||||
return OUTSIDE;
|
||||
|
||||
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)))
|
||||
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
|
||||
)))
|
||||
return OUTSIDE_TOP_LEFT;
|
||||
|
||||
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)))
|
||||
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
|
||||
)))
|
||||
return OUTSIDE_TOP_RIGHT;
|
||||
|
||||
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 &&
|
||||
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 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_LEFT],
|
||||
&GRAPHENE_POINT_INIT (px, py)))
|
||||
&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
|
||||
)))
|
||||
return OUTSIDE_BOTTOM_LEFT;
|
||||
|
||||
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 &&
|
||||
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 &&
|
||||
!ellipsis_contains_point (&self->corner[GSK_CORNER_BOTTOM_RIGHT],
|
||||
&GRAPHENE_POINT_INIT (px, py)))
|
||||
&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
|
||||
)))
|
||||
return OUTSIDE_BOTTOM_RIGHT;
|
||||
|
||||
return INSIDE;
|
||||
@@ -440,45 +445,16 @@ 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 ||
|
||||
tx > ox ||
|
||||
ty > oy)
|
||||
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)
|
||||
return FALSE;
|
||||
|
||||
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)))
|
||||
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)))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@@ -500,10 +476,8 @@ 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_printerr (" Bind[%d]: %u\n", bind->texture, bind->id);
|
||||
g_print (" Bind[%d]: %u\n", bind->texture, bind->id);
|
||||
}
|
||||
|
||||
for (guint i = 0; i < batch->draw.uniform_count; i++)
|
||||
|
||||
+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,14 +1498,20 @@ gsk_ngl_render_job_visit_clipped_child (GskNglRenderJob *job,
|
||||
}
|
||||
else
|
||||
{
|
||||
GskRoundedRect scaled_clip;
|
||||
GskNglRenderOffscreen offscreen = {0};
|
||||
|
||||
offscreen.bounds = clip;
|
||||
offscreen.bounds = &child->bounds;
|
||||
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);
|
||||
|
||||
@@ -1515,7 +1521,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, clip);
|
||||
gsk_ngl_render_job_draw_offscreen_rect (job, &child->bounds);
|
||||
gsk_ngl_render_job_end_draw (job);
|
||||
}
|
||||
}
|
||||
@@ -1892,7 +1898,6 @@ 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))
|
||||
@@ -3619,13 +3624,6 @@ 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 */
|
||||
@@ -3634,6 +3632,8 @@ 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,17 +215,7 @@ gsk_ngl_uniform_state_end_frame (GskNglUniformState *state)
|
||||
|
||||
state->values_pos = allocator;
|
||||
|
||||
/* 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);
|
||||
}
|
||||
g_assert (allocator <= state->values_len);
|
||||
|
||||
memset (state->apply_hash, 0, sizeof state->apply_hash);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#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:
|
||||
@@ -63,8 +61,6 @@ struct _GtkAtSpiCache
|
||||
|
||||
/* Re-entrancy guard */
|
||||
gboolean in_get_items;
|
||||
|
||||
GtkAtSpiRoot *root;
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -148,36 +144,6 @@ 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)
|
||||
@@ -194,10 +160,6 @@ 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))
|
||||
{
|
||||
@@ -388,21 +350,15 @@ gtk_at_spi_cache_init (GtkAtSpiCache *self)
|
||||
|
||||
GtkAtSpiCache *
|
||||
gtk_at_spi_cache_new (GDBusConnection *connection,
|
||||
const char *cache_path,
|
||||
GtkAtSpiRoot *root)
|
||||
const char *cache_path)
|
||||
{
|
||||
GtkAtSpiCache *cache;
|
||||
|
||||
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
|
||||
g_return_val_if_fail (cache_path != NULL, NULL);
|
||||
|
||||
cache = g_object_new (GTK_TYPE_AT_SPI_CACHE,
|
||||
"connection", connection,
|
||||
"cache-path", cache_path,
|
||||
NULL);
|
||||
cache->root = root;
|
||||
|
||||
return cache;
|
||||
return g_object_new (GTK_TYPE_AT_SPI_CACHE,
|
||||
"connection", connection,
|
||||
"cache-path", cache_path,
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -31,8 +31,7 @@ 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,
|
||||
GtkAtSpiRoot *root);
|
||||
const char *cache_path);
|
||||
|
||||
void
|
||||
gtk_at_spi_cache_add_context (GtkAtSpiCache *self,
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "gtkaccessibleprivate.h"
|
||||
|
||||
#include "gtkatspiactionprivate.h"
|
||||
#include "gtkatspicacheprivate.h"
|
||||
#include "gtkatspieditabletextprivate.h"
|
||||
#include "gtkatspiprivate.h"
|
||||
#include "gtkatspirootprivate.h"
|
||||
@@ -90,6 +91,9 @@ 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;
|
||||
|
||||
@@ -150,13 +154,6 @@ 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)
|
||||
@@ -860,43 +857,6 @@ 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,
|
||||
@@ -928,7 +888,6 @@ 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
|
||||
{
|
||||
@@ -1124,25 +1083,6 @@ 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);
|
||||
self->cache = gtk_at_spi_cache_new (self->connection, ATSPI_CACHE_PATH);
|
||||
|
||||
/* Drain the list of queued GtkAtSpiContexts, and add them to the cache */
|
||||
if (self->queued_contexts != NULL)
|
||||
|
||||
@@ -1326,12 +1326,9 @@ 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;
|
||||
@@ -1342,7 +1339,7 @@ update_selection (TextChanged *changed,
|
||||
if (caret_moved)
|
||||
changed->selection_changed (changed->data, "text-caret-moved", changed->cursor_position);
|
||||
|
||||
if (had_selection || has_selection)
|
||||
if (caret_moved || bound_moved)
|
||||
changed->selection_changed (changed->data, "text-selection-changed", 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -403,3 +403,7 @@
|
||||
<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
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<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
|
||||
+103
-12
@@ -108,23 +108,88 @@ gsk_pango_renderer_draw_glyph_item (PangoRenderer *renderer,
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_pango_renderer_draw_rectangle (PangoRenderer *renderer,
|
||||
PangoRenderPart part,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
gsk_pango_renderer_draw_rectangle (PangoRenderer *renderer,
|
||||
PangoRenderPart part,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
|
||||
GdkRGBA rgba;
|
||||
double xx, yy, ww, hh;
|
||||
GtkLineStyle line_style;
|
||||
|
||||
xx = (double)x / PANGO_SCALE;
|
||||
yy = (double)y / PANGO_SCALE;
|
||||
ww = (double)width / PANGO_SCALE;
|
||||
hh = (double)height / PANGO_SCALE;
|
||||
|
||||
get_color (crenderer, part, &rgba);
|
||||
gtk_snapshot_append_color (crenderer->snapshot,
|
||||
&rgba,
|
||||
&GRAPHENE_RECT_INIT ((double)x / PANGO_SCALE,
|
||||
(double)y / PANGO_SCALE,
|
||||
(double)width / PANGO_SCALE,
|
||||
(double)height / PANGO_SCALE));
|
||||
|
||||
if (part == PANGO_RENDER_PART_UNDERLINE ||
|
||||
part == PANGO_RENDER_PART_STRIKETHROUGH ||
|
||||
part == PANGO_RENDER_PART_OVERLINE)
|
||||
line_style = crenderer->line_style;
|
||||
else
|
||||
line_style = GTK_LINE_STYLE_SOLID;
|
||||
|
||||
switch (line_style)
|
||||
{
|
||||
case GTK_LINE_STYLE_SOLID:
|
||||
gtk_snapshot_append_color (crenderer->snapshot,
|
||||
&rgba,
|
||||
&GRAPHENE_RECT_INIT (xx, yy, ww, hh));
|
||||
break;
|
||||
|
||||
case GTK_LINE_STYLE_DOTTED:
|
||||
{
|
||||
GskRoundedRect dot;
|
||||
double d = hh;
|
||||
graphene_rect_t bounds = GRAPHENE_RECT_INIT (xx, yy, d, d);
|
||||
graphene_size_t rr = GRAPHENE_SIZE_INIT (d/2, d/2);
|
||||
GdkRGBA transparent = { 0.f, 0.f, 0.f, 0.f };
|
||||
|
||||
gsk_rounded_rect_init (&dot, &bounds, &rr, &rr, &rr, &rr);
|
||||
|
||||
gtk_snapshot_push_repeat (crenderer->snapshot,
|
||||
&GRAPHENE_RECT_INIT (xx, yy, ww, hh),
|
||||
NULL);
|
||||
|
||||
gtk_snapshot_push_rounded_clip (crenderer->snapshot, &dot);
|
||||
gtk_snapshot_append_color (crenderer->snapshot, &rgba, &bounds);
|
||||
gtk_snapshot_pop (crenderer->snapshot);
|
||||
gtk_snapshot_append_color (crenderer->snapshot, &transparent, &GRAPHENE_RECT_INIT (xx + d, yy, 0.5 * d, d));
|
||||
gtk_snapshot_pop (crenderer->snapshot);
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_LINE_STYLE_DASHED:
|
||||
{
|
||||
GskColorStop stops[4];
|
||||
GdkRGBA transparent = { 0.f, 0.f, 0.f, 0.f };
|
||||
|
||||
stops[0].offset = 0;
|
||||
stops[0].color = rgba;
|
||||
stops[1].offset = 0.66;
|
||||
stops[1].color = rgba;
|
||||
stops[2].offset = 0.66;
|
||||
stops[2].color = transparent;
|
||||
stops[3].offset = 1;
|
||||
stops[3].color = transparent;
|
||||
|
||||
gtk_snapshot_append_repeating_linear_gradient (
|
||||
crenderer->snapshot,
|
||||
&GRAPHENE_RECT_INIT (xx, yy, ww, hh),
|
||||
&GRAPHENE_POINT_INIT (xx, yy),
|
||||
&GRAPHENE_POINT_INIT (xx + 9 * MIN (ww, hh), yy),
|
||||
stops, 4);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -343,6 +408,24 @@ get_item_appearance (PangoItem *item)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GtkLineStyle
|
||||
get_item_line_style (PangoItem *item)
|
||||
{
|
||||
GSList *tmp_list = item->analysis.extra_attrs;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
PangoAttribute *attr = tmp_list->data;
|
||||
|
||||
if (attr->klass->type == gtk_text_attr_line_style_type)
|
||||
return ((GtkTextAttrLineStyle *)attr)->value;
|
||||
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
return GTK_LINE_STYLE_SOLID;
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_pango_renderer_prepare_run (PangoRenderer *renderer,
|
||||
PangoLayoutRun *run)
|
||||
@@ -351,9 +434,17 @@ gsk_pango_renderer_prepare_run (PangoRenderer *renderer,
|
||||
const GdkRGBA *bg_rgba = NULL;
|
||||
const GdkRGBA *fg_rgba = NULL;
|
||||
GtkTextAppearance *appearance;
|
||||
GtkLineStyle line_style;
|
||||
|
||||
PANGO_RENDERER_CLASS (gsk_pango_renderer_parent_class)->prepare_run (renderer, run);
|
||||
|
||||
line_style = get_item_line_style (run->item);
|
||||
if (crenderer->line_style != line_style)
|
||||
{
|
||||
pango_renderer_part_changed (renderer, PANGO_RENDER_PART_UNDERLINE);
|
||||
crenderer->line_style = get_item_line_style (run->item);
|
||||
}
|
||||
|
||||
appearance = get_item_appearance (run->item);
|
||||
|
||||
if (appearance == NULL)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <pango/pango.h>
|
||||
#include "gtk/gtksnapshot.h"
|
||||
#include "gtk/gtktextlayoutprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -68,6 +69,8 @@ struct _GskPangoRenderer
|
||||
guint is_cached_renderer : 1;
|
||||
|
||||
GskPangoShapeHandler shape_handler;
|
||||
|
||||
GtkLineStyle line_style;
|
||||
};
|
||||
|
||||
struct _GskPangoRendererClass
|
||||
|
||||
+10
-2
@@ -696,8 +696,15 @@ 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,
|
||||
self->updated_states, self->updated_properties, self->updated_relations,
|
||||
changed_states, changed_properties, changed_relations,
|
||||
self->states, self->properties, self->relations);
|
||||
g_signal_emit (self, obj_signals[STATE_CHANGE], 0);
|
||||
|
||||
@@ -1165,7 +1172,8 @@ void
|
||||
gtk_at_context_platform_changed (GtkATContext *self,
|
||||
GtkAccessiblePlatformChange change)
|
||||
{
|
||||
gtk_at_context_realize (self);
|
||||
if (!self->realized)
|
||||
return;
|
||||
|
||||
GTK_AT_CONTEXT_GET_CLASS (self)->platform_change (self, change);
|
||||
}
|
||||
|
||||
@@ -83,13 +83,11 @@ 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.
|
||||
*/
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
* `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
|
||||
@@ -782,8 +780,6 @@ 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;
|
||||
}
|
||||
}
|
||||
@@ -794,8 +790,6 @@ 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;
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
*
|
||||
* 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].
|
||||
* using [method@Gtk.ComboBoxText.get_active_text]. The entry itself can be
|
||||
* accessed by calling [method@Gtk.ComboBox.get_child] on the combo box.
|
||||
*
|
||||
* 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.
|
||||
|
||||
@@ -66,9 +66,9 @@ gtk_css_image_paintable_snapshot (GtkCssImage *image,
|
||||
{
|
||||
GtkCssImagePaintable *paintable = GTK_CSS_IMAGE_PAINTABLE (image);
|
||||
|
||||
gdk_paintable_snapshot (get_paintable (paintable),
|
||||
snapshot,
|
||||
width, height);
|
||||
return gdk_paintable_snapshot (get_paintable (paintable),
|
||||
snapshot,
|
||||
width, height);
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
|
||||
@@ -470,7 +470,6 @@ drag_end (GtkDragSource *source,
|
||||
|
||||
gdk_drag_drop_done (source->drag, success);
|
||||
g_clear_object (&source->drag);
|
||||
g_object_unref (source);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -594,9 +593,6 @@ 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,8 +351,6 @@ 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,13 +3084,14 @@ cancel_all_operations (GtkFileChooserWidget *impl)
|
||||
|
||||
/* Removes the settings signal handler. It's safe to call multiple times */
|
||||
static void
|
||||
remove_settings_signal (GtkFileChooserWidget *impl)
|
||||
remove_settings_signal (GtkFileChooserWidget *impl,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
if (impl->settings_signal_id)
|
||||
{
|
||||
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (impl));
|
||||
GtkSettings *settings = gtk_settings_get_for_display (display);
|
||||
GtkSettings *settings;
|
||||
|
||||
settings = gtk_settings_get_for_display (display);
|
||||
g_signal_handler_disconnect (settings,
|
||||
impl->settings_signal_id);
|
||||
impl->settings_signal_id = 0;
|
||||
@@ -3114,7 +3115,6 @@ 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);
|
||||
remove_settings_signal (impl, gtk_widget_get_display (GTK_WIDGET (impl)));
|
||||
check_icon_theme (impl);
|
||||
}
|
||||
|
||||
|
||||
@@ -1095,9 +1095,6 @@ 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).
|
||||
@@ -1138,9 +1135,6 @@ 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
|
||||
@@ -1354,7 +1348,7 @@ my_pango_font_family_equal (const char *familya,
|
||||
return g_ascii_strcasecmp (familya, familyb) == 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
static void
|
||||
gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
|
||||
{
|
||||
const char *desc_family;
|
||||
@@ -1364,7 +1358,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 TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
n = g_list_model_get_n_items (G_LIST_MODEL (self->selection));
|
||||
@@ -1403,13 +1397,7 @@ gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
|
||||
pango_font_description_free (merged);
|
||||
}
|
||||
|
||||
if (i < n)
|
||||
{
|
||||
gtk_single_selection_set_selected (self->selection, i);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
gtk_single_selection_set_selected (self->selection, i);
|
||||
}
|
||||
|
||||
static PangoFontFace *
|
||||
@@ -2364,7 +2352,6 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,10 +105,7 @@ 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_Latch,
|
||||
GDK_KEY_ISO_Level5_Shift,
|
||||
GDK_KEY_ISO_Level5_Latch
|
||||
GDK_KEY_ISO_Level3_Shift
|
||||
};
|
||||
|
||||
static void gtk_im_context_simple_finalize (GObject *obj);
|
||||
@@ -764,21 +761,13 @@ 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])
|
||||
{
|
||||
if (priv->in_hex_sequence || priv->in_compose_sequence)
|
||||
return TRUE; /* Don't leak random key events during preedit */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
hex_mod_mask = GDK_CONTROL_MASK|GDK_SHIFT_MASK;
|
||||
|
||||
@@ -813,23 +802,16 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
|
||||
|
||||
no_text_input_mask = GDK_ALT_MASK|GDK_CONTROL_MASK;
|
||||
|
||||
if (priv->in_hex_sequence && priv->modifiers_dropped &&
|
||||
(keyval == GDK_KEY_Return ||
|
||||
keyval == GDK_KEY_ISO_Enter ||
|
||||
keyval == GDK_KEY_KP_Enter))
|
||||
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)))
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -1155,7 +1137,7 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
|
||||
}
|
||||
|
||||
if (cursor_pos)
|
||||
*cursor_pos = g_utf8_strlen (s->str, s->len);
|
||||
*cursor_pos = 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, 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_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_Greek_iota, 0x0390,
|
||||
GDK_KEY_Greek_upsilon, 0x03B0,
|
||||
GDK_KEY_space, 0x0060,
|
||||
@@ -127,7 +127,6 @@ 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,
|
||||
@@ -210,7 +209,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, 0x0027,
|
||||
GDK_KEY_space, 0x00B4,
|
||||
GDK_KEY_V, 0x01D7,
|
||||
GDK_KEY_v, 0x01D8,
|
||||
GDK_KEY_nobreakspace, 0x0301,
|
||||
@@ -241,7 +240,6 @@ 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,
|
||||
@@ -496,7 +494,6 @@ 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,
|
||||
@@ -575,7 +572,6 @@ 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,
|
||||
@@ -624,7 +620,6 @@ 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,
|
||||
@@ -645,7 +640,6 @@ 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,
|
||||
@@ -699,7 +693,6 @@ 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,
|
||||
@@ -714,12 +707,10 @@ 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,
|
||||
@@ -740,7 +731,6 @@ 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,
|
||||
@@ -748,14 +738,12 @@ 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,
|
||||
@@ -766,7 +754,6 @@ 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,9 +205,6 @@ 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,35 +123,6 @@ 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,13 +23,6 @@
|
||||
|
||||
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,
|
||||
@@ -41,10 +34,6 @@ 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,
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "gtkdragsourceprivate.h"
|
||||
#include "gtkdragicon.h"
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtktextlayoutprivate.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
@@ -1259,6 +1260,85 @@ gtk_label_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
add_dotted_underline (PangoLayout *layout)
|
||||
{
|
||||
const char *text;
|
||||
char *p;
|
||||
GSList *l, *ll, *a;
|
||||
|
||||
text = pango_layout_get_text (layout);
|
||||
p = strstr (text, "good");
|
||||
|
||||
for (int i = 0; i < pango_layout_get_line_count (layout); i++)
|
||||
{
|
||||
PangoLayoutLine *line = pango_layout_get_line (layout, i);
|
||||
|
||||
for (l = line->runs, ll = NULL; l; ll = l, l = l->next)
|
||||
{
|
||||
PangoGlyphItem *run = l->data;
|
||||
|
||||
if (run == NULL)
|
||||
continue;
|
||||
|
||||
if (p != NULL && text + run->item->offset <= p && p + strlen ("good") <= text + run->item->offset + run->item->length)
|
||||
{
|
||||
/* Match inside this item */
|
||||
if (text + run->item->offset < p)
|
||||
{
|
||||
PangoGlyphItem *before;
|
||||
|
||||
/* split off initial segment */
|
||||
before = pango_glyph_item_split (run, text, p - (text + run->item->offset));
|
||||
if (ll)
|
||||
{
|
||||
ll->next = g_slist_prepend (l, before);
|
||||
ll = ll->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
line->runs = g_slist_prepend (line->runs, before);
|
||||
ll = line->runs;
|
||||
}
|
||||
}
|
||||
|
||||
if (p + strlen ("good") < text + run->item->offset + run->item->length)
|
||||
{
|
||||
/* split off final segment */
|
||||
run = pango_glyph_item_split (run, text, strlen ("good"));
|
||||
|
||||
if (ll)
|
||||
ll->next = g_slist_prepend (l, run);
|
||||
else
|
||||
line->runs = g_slist_prepend (line->runs, run);
|
||||
}
|
||||
|
||||
for (a = run->item->analysis.extra_attrs; a; a = a->next)
|
||||
{
|
||||
PangoAttribute *attr = a->data;
|
||||
|
||||
if (attr->klass->type == gtk_text_attr_line_style_type)
|
||||
break;
|
||||
}
|
||||
|
||||
if (a == NULL)
|
||||
{
|
||||
PangoAttribute *attr;
|
||||
|
||||
attr = gtk_text_attr_line_style_new (GTK_LINE_STYLE_DOTTED);
|
||||
run->item->analysis.extra_attrs =
|
||||
g_slist_prepend (run->item->analysis.extra_attrs, attr);
|
||||
|
||||
attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
|
||||
run->item->analysis.extra_attrs =
|
||||
g_slist_prepend (run->item->analysis.extra_attrs, attr);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define GRAPHENE_RECT_FROM_RECT(_r) (GRAPHENE_RECT_INIT ((_r)->x, (_r)->y, (_r)->width, (_r)->height))
|
||||
|
||||
@@ -1280,6 +1360,7 @@ gtk_label_snapshot (GtkWidget *widget,
|
||||
context = _gtk_widget_get_style_context (widget);
|
||||
get_layout_location (self, &lx, &ly);
|
||||
|
||||
add_dotted_underline (self->layout);
|
||||
gtk_snapshot_render_layout (snapshot, context, lx, ly, self->layout);
|
||||
|
||||
info = self->select_info;
|
||||
|
||||
+1
-4
@@ -1782,10 +1782,7 @@ 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);
|
||||
box->selected_row = selected_row;
|
||||
}
|
||||
gtk_list_box_select_all_between (box, selected_row, row, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -214,22 +214,6 @@ 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)
|
||||
@@ -334,7 +318,6 @@ 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,8 +1404,7 @@ pointer_cb (GObject *object,
|
||||
GtkModelButton *button = data;
|
||||
|
||||
stop_open (button);
|
||||
if (popover)
|
||||
gtk_popover_menu_set_active_item (GTK_POPOVER_MENU (popover), NULL);
|
||||
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)
|
||||
{
|
||||
GTK_NATIVE_GET_IFACE (self)->layout (self, width, height);
|
||||
return 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);
|
||||
|
||||
GTK_NATIVE_GET_IFACE (self)->get_surface_transform (self, x, y);
|
||||
return GTK_NATIVE_GET_IFACE (self)->get_surface_transform (self, x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5461,9 +5461,6 @@ 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);
|
||||
|
||||
@@ -532,8 +532,6 @@ 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,9 +795,6 @@ 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);
|
||||
|
||||
+7
-18
@@ -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->recent_servers_listbox), child);
|
||||
gtk_list_box_remove (GTK_LIST_BOX (view->listbox), child);
|
||||
|
||||
gtk_list_store_clear (view->completion_store);
|
||||
|
||||
@@ -1215,14 +1215,12 @@ 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"));
|
||||
@@ -1245,11 +1243,6 @@ 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)
|
||||
{
|
||||
@@ -1260,10 +1253,6 @@ server_mount_ready_cb (GObject *source_file,
|
||||
g_object_unref (root);
|
||||
g_object_unref (mount);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_open_location (view, location, view->open_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1399,7 +1388,8 @@ pulse_entry_cb (gpointer user_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_entry_set_progress_fraction (GTK_ENTRY (view->address_entry), 0);
|
||||
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);
|
||||
view->entry_pulse_timeout_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
@@ -1453,7 +1443,6 @@ 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);
|
||||
|
||||
+21
-40
@@ -401,6 +401,9 @@ 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,
|
||||
@@ -1332,7 +1335,10 @@ start_scroll_deceleration_cb (gpointer user_data)
|
||||
priv->scroll_events_overshoot_id = 0;
|
||||
|
||||
if (!priv->deceleration_id)
|
||||
gtk_scrolled_window_start_deceleration (scrolled_window);
|
||||
{
|
||||
uninstall_scroll_cursor (scrolled_window);
|
||||
gtk_scrolled_window_start_deceleration (scrolled_window);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1343,6 +1349,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -1435,6 +1442,7 @@ 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
|
||||
@@ -3176,6 +3184,18 @@ 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,
|
||||
@@ -3435,24 +3455,6 @@ 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)))
|
||||
@@ -3466,29 +3468,8 @@ 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,8 +475,6 @@ 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,19 +943,6 @@ 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;
|
||||
|
||||
|
||||
@@ -1432,7 +1432,6 @@ 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);
|
||||
|
||||
GTK_SHORTCUT_ACTION_GET_CLASS (self)->print (self, string);
|
||||
return GTK_SHORTCUT_ACTION_GET_CLASS (self)->print (self, string);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -432,11 +432,9 @@ gtk_shortcut_controller_handle_event (GtkEventController *controller,
|
||||
|
||||
if (event_type == GDK_KEY_PRESS)
|
||||
{
|
||||
GdkModifierType modifiers, consumed_modifiers;
|
||||
|
||||
GdkModifierType modifiers;
|
||||
modifiers = gdk_event_get_modifier_state (event);
|
||||
consumed_modifiers = gdk_key_event_get_consumed_modifiers (event);
|
||||
enable_mnemonics = (modifiers & ~consumed_modifiers & gtk_accelerator_get_default_mod_mask ()) == self->mnemonics_modifiers;
|
||||
enable_mnemonics = (modifiers & gtk_accelerator_get_default_mod_mask ()) == self->mnemonics_modifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+19
-25
@@ -1413,8 +1413,7 @@ gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
||||
}
|
||||
|
||||
static GskRenderNode *
|
||||
gtk_snapshot_pop_internal (GtkSnapshot *snapshot,
|
||||
gboolean is_texture_pop)
|
||||
gtk_snapshot_pop_internal (GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkSnapshotState *state;
|
||||
GskRenderNode *node;
|
||||
@@ -1438,17 +1437,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -1472,7 +1460,7 @@ gtk_snapshot_push_collect (GtkSnapshot *snapshot)
|
||||
GskRenderNode *
|
||||
gtk_snapshot_pop_collect (GtkSnapshot *snapshot)
|
||||
{
|
||||
GskRenderNode *result = gtk_snapshot_pop_internal (snapshot, FALSE);
|
||||
GskRenderNode *result = gtk_snapshot_pop_internal (snapshot);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1495,7 +1483,7 @@ gtk_snapshot_to_node (GtkSnapshot *snapshot)
|
||||
{
|
||||
GskRenderNode *result;
|
||||
|
||||
result = gtk_snapshot_pop_internal (snapshot, FALSE);
|
||||
result = gtk_snapshot_pop_internal (snapshot);
|
||||
|
||||
/* We should have exactly our initial state */
|
||||
if (!gtk_snapshot_states_is_empty (&snapshot->state_stack))
|
||||
@@ -1563,9 +1551,13 @@ gtk_snapshot_to_paintable (GtkSnapshot *snapshot,
|
||||
void
|
||||
gtk_snapshot_pop (GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkSnapshotState *state = gtk_snapshot_get_current_state (snapshot);
|
||||
GskRenderNode *node;
|
||||
|
||||
node = gtk_snapshot_pop_internal (snapshot, FALSE);
|
||||
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);
|
||||
|
||||
if (node)
|
||||
gtk_snapshot_append_node_internal (snapshot, node);
|
||||
@@ -1585,9 +1577,18 @@ 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;
|
||||
|
||||
node = gtk_snapshot_pop_internal (snapshot, TRUE);
|
||||
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);
|
||||
g_assert (node == NULL);
|
||||
}
|
||||
|
||||
@@ -2447,14 +2448,7 @@ 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,
|
||||
(float[4]) {
|
||||
border_width[0] * scale_y,
|
||||
border_width[1] * scale_x,
|
||||
border_width[2] * scale_y,
|
||||
border_width[3] * scale_x,
|
||||
},
|
||||
border_color);
|
||||
node = gsk_border_node_new (&real_outline, border_width, border_color);
|
||||
|
||||
gtk_snapshot_append_node_internal (snapshot, node);
|
||||
}
|
||||
|
||||
@@ -633,8 +633,6 @@ 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 ();
|
||||
}
|
||||
|
||||
@@ -154,10 +154,6 @@ 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,37 +78,12 @@ 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
|
||||
|
||||
@@ -1512,6 +1512,51 @@ gtk_text_attr_appearance_new (const GtkTextAppearance *appearance)
|
||||
return (PangoAttribute *)result;
|
||||
}
|
||||
|
||||
static PangoAttribute *
|
||||
attr_line_style_copy (const PangoAttribute *attr)
|
||||
{
|
||||
const GtkTextAttrLineStyle *a = (GtkTextAttrLineStyle *)attr;
|
||||
return gtk_text_attr_line_style_new (a->value);
|
||||
}
|
||||
|
||||
static void
|
||||
attr_line_style_destroy (PangoAttribute *attr)
|
||||
{
|
||||
g_slice_free (GtkTextAttrLineStyle, (gpointer)attr);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
attr_line_style_equal (const PangoAttribute *attr1,
|
||||
const PangoAttribute *attr2)
|
||||
{
|
||||
const GtkTextAttrLineStyle *a1 = (GtkTextAttrLineStyle *)attr1;
|
||||
const GtkTextAttrLineStyle *a2 = (GtkTextAttrLineStyle *)attr2;
|
||||
return a1->value == a2->value;
|
||||
}
|
||||
|
||||
PangoAttrType gtk_text_attr_line_style_type = 0;
|
||||
|
||||
PangoAttribute *
|
||||
gtk_text_attr_line_style_new (GtkLineStyle style)
|
||||
{
|
||||
static PangoAttrClass klass = {
|
||||
0,
|
||||
attr_line_style_copy,
|
||||
attr_line_style_destroy,
|
||||
attr_line_style_equal
|
||||
};
|
||||
GtkTextAttrLineStyle *attr;
|
||||
|
||||
if (!klass.type)
|
||||
klass.type = gtk_text_attr_line_style_type =
|
||||
pango_attr_type_register (I_("GtkTextAttrLineStyle"));
|
||||
|
||||
attr = g_slice_new (GtkTextAttrLineStyle);
|
||||
pango_attribute_init (&attr->attr, &klass);
|
||||
attr->value = style;
|
||||
return (PangoAttribute *)attr;
|
||||
}
|
||||
|
||||
static void
|
||||
add_generic_attrs (GtkTextLayout *layout,
|
||||
GtkTextAppearance *appearance,
|
||||
|
||||
@@ -219,6 +219,21 @@ struct _GtkTextLineDisplay
|
||||
|
||||
#ifdef GTK_COMPILATION
|
||||
extern G_GNUC_INTERNAL PangoAttrType gtk_text_attr_appearance_type;
|
||||
|
||||
typedef enum {
|
||||
GTK_LINE_STYLE_SOLID,
|
||||
GTK_LINE_STYLE_DASHED,
|
||||
GTK_LINE_STYLE_DOTTED
|
||||
} GtkLineStyle;
|
||||
|
||||
typedef struct {
|
||||
PangoAttribute attr;
|
||||
GtkLineStyle value;
|
||||
} GtkTextAttrLineStyle;
|
||||
|
||||
extern PangoAttrType gtk_text_attr_line_style_type;
|
||||
|
||||
PangoAttribute *gtk_text_attr_line_style_new (GtkLineStyle style);
|
||||
#endif
|
||||
|
||||
GType gtk_text_layout_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@@ -199,9 +199,6 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
+5
-12
@@ -151,8 +151,6 @@ 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
|
||||
{
|
||||
@@ -194,19 +192,22 @@ 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),
|
||||
gtk_accessible_update_state (GTK_ACCESSIBLE (self->expander),
|
||||
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),
|
||||
gtk_accessible_update_state (GTK_ACCESSIBLE (self->expander),
|
||||
GTK_ACCESSIBLE_STATE_EXPANDED, FALSE,
|
||||
-1);
|
||||
}
|
||||
@@ -724,14 +725,6 @@ 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]);
|
||||
|
||||
+5
-21
@@ -74,7 +74,6 @@
|
||||
#include "gtkwidgetpaintableprivate.h"
|
||||
#include "gtkwindowgroup.h"
|
||||
#include "gtkwindowprivate.h"
|
||||
#include "gtktestatcontextprivate.h"
|
||||
|
||||
#include "inspector/window.h"
|
||||
|
||||
@@ -2450,13 +2449,13 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
|
||||
priv->at_context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (widget));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_widget_root_at_context (GtkWidget *self)
|
||||
void
|
||||
gtk_widget_realize_at_context (GtkWidget *self)
|
||||
{
|
||||
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (self);
|
||||
GtkAccessibleRole role = priv->accessible_role;
|
||||
|
||||
if (priv->at_context == NULL)
|
||||
if (priv->at_context == NULL || gtk_at_context_is_realized (priv->at_context))
|
||||
return;
|
||||
|
||||
/* Reset the accessible role to its current value */
|
||||
@@ -2469,17 +2468,6 @@ gtk_widget_root_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);
|
||||
}
|
||||
|
||||
@@ -2523,8 +2511,6 @@ 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))
|
||||
@@ -7826,7 +7812,7 @@ _gtk_widget_list_devices (GtkWidget *widget,
|
||||
}
|
||||
|
||||
root = gtk_widget_get_root (widget);
|
||||
if (!GTK_IS_WINDOW (root))
|
||||
if (!root)
|
||||
{
|
||||
*out_n_devices = 0;
|
||||
return NULL;
|
||||
@@ -8506,8 +8492,6 @@ 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 ();
|
||||
}
|
||||
@@ -12162,7 +12146,7 @@ gtk_widget_set_cursor (GtkWidget *widget,
|
||||
return;
|
||||
|
||||
root = _gtk_widget_get_root (widget);
|
||||
if (GTK_IS_WINDOW (root))
|
||||
if (root)
|
||||
gtk_window_maybe_update_cursor (GTK_WINDOW (root), widget, NULL);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_CURSOR]);
|
||||
|
||||
+51
-107
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "gtkwindowprivate.h"
|
||||
|
||||
#include "gtkaccessibleprivate.h"
|
||||
#include "gtkaccelgroupprivate.h"
|
||||
#include "gtkactionable.h"
|
||||
#include "gtkapplicationprivate.h"
|
||||
@@ -149,8 +148,7 @@
|
||||
*/
|
||||
|
||||
#define MENU_BAR_ACCEL GDK_KEY_F10
|
||||
#define RESIZE_HANDLE_SIZE 12 /* Width of resize borders */
|
||||
#define RESIZE_HANDLE_CORNER_SIZE 24 /* How resize corners extend */
|
||||
#define RESIZE_HANDLE_SIZE 20
|
||||
#define MNEMONICS_DELAY 300 /* ms */
|
||||
#define NO_CONTENT_CHILD_NAT 200 /* ms */
|
||||
#define VISIBLE_FOCUS_DURATION 3 /* s */
|
||||
@@ -373,8 +371,6 @@ static gboolean surface_render (GdkSurface *surface,
|
||||
static gboolean surface_event (GdkSurface *surface,
|
||||
GdkEvent *event,
|
||||
GtkWidget *widget);
|
||||
static void after_paint (GdkFrameClock *clock,
|
||||
GtkWindow *window);
|
||||
|
||||
static int gtk_window_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction);
|
||||
@@ -481,9 +477,6 @@ static void gtk_window_shortcut_manager_interface_init (GtkShor
|
||||
static void gtk_window_root_interface_init (GtkRootInterface *iface);
|
||||
static void gtk_window_native_interface_init (GtkNativeInterface *iface);
|
||||
|
||||
static void gtk_window_accessible_interface_init (GtkAccessibleInterface *iface);
|
||||
|
||||
|
||||
static void ensure_state_flag_backdrop (GtkWidget *widget);
|
||||
static void unset_titlebar (GtkWindow *window);
|
||||
|
||||
@@ -498,8 +491,6 @@ gtk_window_update_csd_size (GtkWindow *window,
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_WIDGET,
|
||||
G_ADD_PRIVATE (GtkWindow)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE,
|
||||
gtk_window_accessible_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
gtk_window_buildable_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_NATIVE,
|
||||
@@ -509,32 +500,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ROOT,
|
||||
gtk_window_root_interface_init))
|
||||
|
||||
static GtkAccessibleInterface *parent_accessible_iface;
|
||||
|
||||
static gboolean
|
||||
gtk_window_accessible_get_platform_state (GtkAccessible *self,
|
||||
GtkAccessiblePlatformState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSABLE:
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_FOCUSED:
|
||||
return parent_accessible_iface->get_platform_state (self, state);
|
||||
case GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE:
|
||||
return gtk_window_is_active (GTK_WINDOW (self));
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_window_accessible_interface_init (GtkAccessibleInterface *iface)
|
||||
{
|
||||
parent_accessible_iface = g_type_interface_peek_parent (iface);
|
||||
iface->get_at_context = parent_accessible_iface->get_at_context;
|
||||
iface->get_platform_state = gtk_window_accessible_get_platform_state;
|
||||
}
|
||||
|
||||
static void
|
||||
add_tab_bindings (GtkWidgetClass *widget_class,
|
||||
GdkModifierType modifiers,
|
||||
@@ -1364,10 +1329,10 @@ static void
|
||||
get_box_border (GtkCssStyle *style,
|
||||
GtkBorder *border)
|
||||
{
|
||||
border->top = get_number (style->border->border_top_width) + get_number (style->size->padding_top);
|
||||
border->left = get_number (style->border->border_left_width) + get_number (style->size->padding_left);
|
||||
border->bottom = get_number (style->border->border_bottom_width) + get_number (style->size->padding_bottom);
|
||||
border->right = get_number (style->border->border_right_width) + get_number (style->size->padding_right);
|
||||
border->top = get_number (style->border->border_top_width);
|
||||
border->left = get_number (style->border->border_left_width);
|
||||
border->bottom = get_number (style->border->border_bottom_width);
|
||||
border->right = get_number (style->border->border_right_width);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1396,10 +1361,7 @@ get_edge_for_coordinates (GtkWindow *window,
|
||||
return -1;
|
||||
|
||||
gtk_css_boxes_init (&css_boxes, GTK_WIDGET (window));
|
||||
border_rect = gtk_css_boxes_get_content_rect (&css_boxes);
|
||||
|
||||
get_box_border (gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (window))),
|
||||
&handle_size);
|
||||
border_rect = gtk_css_boxes_get_padding_rect (&css_boxes);
|
||||
|
||||
if (priv->use_client_shadow)
|
||||
{
|
||||
@@ -1408,10 +1370,16 @@ get_edge_for_coordinates (GtkWindow *window,
|
||||
|
||||
get_shadow_width (window, &shadow);
|
||||
/* This logic is duplicated in update_realized_window_properties() */
|
||||
handle_size.left += shadow.left;
|
||||
handle_size.top += shadow.top;
|
||||
handle_size.right += shadow.right;
|
||||
handle_size.bottom += shadow.bottom;
|
||||
handle_size.left = MIN (RESIZE_HANDLE_SIZE, shadow.left);
|
||||
handle_size.top = MIN (RESIZE_HANDLE_SIZE, shadow.top);
|
||||
handle_size.right = MIN (RESIZE_HANDLE_SIZE, shadow.right);
|
||||
handle_size.bottom = MIN (RESIZE_HANDLE_SIZE, shadow.bottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Use border */
|
||||
get_box_border (gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (window))),
|
||||
&handle_size);
|
||||
}
|
||||
|
||||
left = border_rect->origin.x;
|
||||
@@ -1419,10 +1387,10 @@ get_edge_for_coordinates (GtkWindow *window,
|
||||
|
||||
if (x < left && x >= left - handle_size.left)
|
||||
{
|
||||
if (y < top + RESIZE_HANDLE_CORNER_SIZE && y >= top - handle_size.top)
|
||||
if (y < top + handle_size.top && y >= top - handle_size.top)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_WEST);
|
||||
|
||||
if (y > top + border_rect->size.height - RESIZE_HANDLE_CORNER_SIZE &&
|
||||
if (y > top + border_rect->size.height - handle_size.bottom &&
|
||||
y <= top + border_rect->size.height + handle_size.bottom)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_WEST);
|
||||
|
||||
@@ -1431,10 +1399,10 @@ get_edge_for_coordinates (GtkWindow *window,
|
||||
else if (x > left + border_rect->size.width &&
|
||||
x <= left + border_rect->size.width + handle_size.right)
|
||||
{
|
||||
if (y < top + RESIZE_HANDLE_CORNER_SIZE && y >= top - handle_size.top)
|
||||
if (y < top + handle_size.top && y >= top - handle_size.top)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_EAST);
|
||||
|
||||
if (y > top + border_rect->size.height - RESIZE_HANDLE_CORNER_SIZE &&
|
||||
if (y > top + border_rect->size.height - handle_size.bottom &&
|
||||
y <= top + border_rect->size.height + handle_size.bottom)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_EAST);
|
||||
|
||||
@@ -1442,10 +1410,10 @@ get_edge_for_coordinates (GtkWindow *window,
|
||||
}
|
||||
else if (y < top && y >= top - handle_size.top)
|
||||
{
|
||||
if (x < left + RESIZE_HANDLE_CORNER_SIZE && x >= left - handle_size.left)
|
||||
if (x < left + handle_size.left && x >= left - handle_size.left)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_WEST);
|
||||
|
||||
if (x > left + border_rect->size.width - RESIZE_HANDLE_CORNER_SIZE &&
|
||||
if (x > left + border_rect->size.width - handle_size.right &&
|
||||
x <= left + border_rect->size.width + handle_size.right)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_NORTH_EAST);
|
||||
|
||||
@@ -1454,10 +1422,10 @@ get_edge_for_coordinates (GtkWindow *window,
|
||||
else if (y > top + border_rect->size.height &&
|
||||
y <= top + border_rect->size.height + handle_size.bottom)
|
||||
{
|
||||
if (x < left + RESIZE_HANDLE_CORNER_SIZE && x >= left - handle_size.left)
|
||||
if (x < left + handle_size.left && x >= left - handle_size.left)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_WEST);
|
||||
|
||||
if (x > left + border_rect->size.width - RESIZE_HANDLE_CORNER_SIZE &&
|
||||
if (x > left + border_rect->size.width - handle_size.right &&
|
||||
x <= left + border_rect->size.width + handle_size.right)
|
||||
return edge_or_minus_one (GDK_SURFACE_EDGE_SOUTH_EAST);
|
||||
|
||||
@@ -2041,8 +2009,6 @@ gtk_window_root_set_focus (GtkRoot *root,
|
||||
|
||||
g_clear_object (&old_focus);
|
||||
|
||||
priv->move_focus = FALSE;
|
||||
|
||||
g_object_notify (G_OBJECT (self), "focus-widget");
|
||||
}
|
||||
|
||||
@@ -2320,8 +2286,6 @@ gtk_window_set_default_widget (GtkWindow *window,
|
||||
|
||||
priv->default_widget = default_widget;
|
||||
|
||||
priv->unset_default = FALSE;
|
||||
|
||||
if (priv->default_widget)
|
||||
{
|
||||
if (priv->focus_widget == NULL ||
|
||||
@@ -3038,10 +3002,8 @@ gtk_window_set_titlebar (GtkWindow *window,
|
||||
|
||||
if (titlebar == NULL)
|
||||
{
|
||||
/* these are updated in realize() */
|
||||
priv->client_decorated = FALSE;
|
||||
gtk_widget_remove_css_class (widget, "csd");
|
||||
gtk_widget_remove_css_class (widget, "solid-csd");
|
||||
|
||||
goto out;
|
||||
}
|
||||
@@ -4007,8 +3969,9 @@ get_shadow_width (GtkWindow *window,
|
||||
if (!priv->decorated)
|
||||
goto out;
|
||||
|
||||
if (!priv->client_decorated ||
|
||||
!priv->use_client_shadow)
|
||||
if (!priv->client_decorated &&
|
||||
!(gtk_window_should_use_csd (window) &&
|
||||
gtk_window_supports_client_shadow (window)))
|
||||
goto out;
|
||||
|
||||
if (priv->maximized ||
|
||||
@@ -4019,12 +3982,6 @@ get_shadow_width (GtkWindow *window,
|
||||
|
||||
/* Calculate the size of the drop shadows ... */
|
||||
gtk_css_shadow_value_get_extents (style->background->box_shadow, shadow_width);
|
||||
|
||||
shadow_width->left = MAX (shadow_width->left, RESIZE_HANDLE_SIZE);
|
||||
shadow_width->top = MAX (shadow_width->top, RESIZE_HANDLE_SIZE);
|
||||
shadow_width->bottom = MAX (shadow_width->bottom, RESIZE_HANDLE_SIZE);
|
||||
shadow_width->right = MAX (shadow_width->right, RESIZE_HANDLE_SIZE);
|
||||
|
||||
return;
|
||||
|
||||
out:
|
||||
@@ -4131,6 +4088,7 @@ update_realized_window_properties (GtkWindow *window)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
GtkBorder shadow;
|
||||
GtkBorder resize_handle;
|
||||
GdkRectangle rect;
|
||||
GtkCssBoxes css_boxes;
|
||||
const graphene_rect_t *border_rect;
|
||||
@@ -4139,7 +4097,7 @@ update_realized_window_properties (GtkWindow *window)
|
||||
get_shadow_width (window, &shadow);
|
||||
update_opaque_region (window, &shadow);
|
||||
|
||||
if (!priv->client_decorated || !priv->use_client_shadow)
|
||||
if (!priv->client_decorated)
|
||||
return;
|
||||
|
||||
gtk_native_get_surface_transform (GTK_NATIVE (window), &native_x, &native_y);
|
||||
@@ -4150,10 +4108,15 @@ update_realized_window_properties (GtkWindow *window)
|
||||
border_rect = gtk_css_boxes_get_border_rect (&css_boxes);
|
||||
|
||||
/* This logic is duplicated in get_edge_for_coordinates() */
|
||||
rect.x = native_x + border_rect->origin.x - RESIZE_HANDLE_SIZE;
|
||||
rect.y = native_y + border_rect->origin.y - RESIZE_HANDLE_SIZE;
|
||||
rect.width = border_rect->size.width + 2 * RESIZE_HANDLE_SIZE;
|
||||
rect.height = border_rect->size.height + 2 * RESIZE_HANDLE_SIZE;
|
||||
resize_handle.left = MIN (shadow.left, RESIZE_HANDLE_SIZE);
|
||||
resize_handle.top = MIN (shadow.top, RESIZE_HANDLE_SIZE);
|
||||
resize_handle.right = MIN (shadow.right, RESIZE_HANDLE_SIZE);
|
||||
resize_handle.bottom = MIN (shadow.bottom, RESIZE_HANDLE_SIZE);
|
||||
|
||||
rect.x = native_x + border_rect->origin.x - resize_handle.left;
|
||||
rect.y = native_y + border_rect->origin.y - resize_handle.top;
|
||||
rect.width = border_rect->size.width + resize_handle.left + resize_handle.right;
|
||||
rect.height = border_rect->size.height + resize_handle.top + resize_handle.bottom;
|
||||
|
||||
if (rect.width > 0 && rect.height > 0)
|
||||
{
|
||||
@@ -4293,7 +4256,6 @@ gtk_window_realize (GtkWidget *widget)
|
||||
GtkWindow *window = GTK_WINDOW (widget);
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
GdkSurface *surface;
|
||||
GdkFrameClock *frame_clock;
|
||||
|
||||
/* Create default title bar */
|
||||
if (!priv->client_decorated && gtk_window_should_use_csd (window))
|
||||
@@ -4330,9 +4292,6 @@ gtk_window_realize (GtkWidget *widget)
|
||||
g_signal_connect (surface, "event", G_CALLBACK (surface_event), widget);
|
||||
g_signal_connect (surface, "compute-size", G_CALLBACK (toplevel_compute_size), widget);
|
||||
|
||||
frame_clock = gdk_surface_get_frame_clock (surface);
|
||||
g_signal_connect (frame_clock, "after-paint", G_CALLBACK (after_paint), widget);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_window_parent_class)->realize (widget);
|
||||
|
||||
gtk_root_start_layout (GTK_ROOT (window));
|
||||
@@ -4404,7 +4363,6 @@ gtk_window_unrealize (GtkWidget *widget)
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
GtkWindowGeometryInfo *info;
|
||||
GdkSurface *surface;
|
||||
GdkFrameClock *frame_clock;
|
||||
|
||||
gtk_native_unrealize (GTK_NATIVE (window));
|
||||
|
||||
@@ -4445,10 +4403,6 @@ gtk_window_unrealize (GtkWidget *widget)
|
||||
g_signal_handlers_disconnect_by_func (surface, surface_render, widget);
|
||||
g_signal_handlers_disconnect_by_func (surface, surface_event, widget);
|
||||
|
||||
frame_clock = gdk_surface_get_frame_clock (surface);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (frame_clock, after_paint, widget);
|
||||
|
||||
gtk_root_stop_layout (GTK_ROOT (window));
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
|
||||
@@ -4706,10 +4660,16 @@ maybe_unset_focus_and_default (GtkWindow *window)
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
if (priv->move_focus)
|
||||
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
|
||||
{
|
||||
gtk_widget_child_focus (GTK_WIDGET (window), GTK_DIR_TAB_FORWARD);
|
||||
priv->move_focus = FALSE;
|
||||
}
|
||||
|
||||
if (priv->unset_default)
|
||||
gtk_window_set_default_widget (window, NULL);
|
||||
{
|
||||
gtk_window_set_default_widget (window, NULL);
|
||||
priv->unset_default = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -4717,18 +4677,14 @@ surface_render (GdkSurface *surface,
|
||||
cairo_region_t *region,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkWindow *window = GTK_WINDOW (widget);
|
||||
|
||||
gtk_widget_render (widget, surface, region);
|
||||
maybe_unset_focus_and_default (window);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
after_paint (GdkFrameClock *clock,
|
||||
GtkWindow *window)
|
||||
{
|
||||
maybe_unset_focus_and_default (window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
surface_event (GdkSurface *surface,
|
||||
GdkEvent *event,
|
||||
@@ -5173,16 +5129,6 @@ _gtk_window_unset_focus_and_default (GtkWindow *window,
|
||||
child = priv->default_widget;
|
||||
if (child && (child == widget || gtk_widget_is_ancestor (child, widget)))
|
||||
priv->unset_default = TRUE;
|
||||
|
||||
if ((priv->move_focus || priv->unset_default) &&
|
||||
priv->surface != NULL)
|
||||
{
|
||||
GdkFrameClock *frame_clock;
|
||||
|
||||
frame_clock = gdk_surface_get_frame_clock (priv->surface);
|
||||
gdk_frame_clock_request_phase (frame_clock,
|
||||
GDK_FRAME_CLOCK_PHASE_AFTER_PAINT);
|
||||
}
|
||||
}
|
||||
|
||||
#undef INCLUDE_CSD_SIZE
|
||||
@@ -5859,8 +5805,6 @@ _gtk_window_set_is_active (GtkWindow *window,
|
||||
g_object_unref (focus);
|
||||
}
|
||||
|
||||
gtk_accessible_platform_changed (GTK_ACCESSIBLE (window), GTK_ACCESSIBLE_PLATFORM_CHANGE_ACTIVE);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_IS_ACTIVE]);
|
||||
}
|
||||
|
||||
@@ -6176,8 +6120,8 @@ inspector_keybinding_enabled (gboolean *warn)
|
||||
GSettings *settings;
|
||||
gboolean enabled;
|
||||
|
||||
enabled = TRUE;
|
||||
*warn = TRUE;
|
||||
enabled = FALSE;
|
||||
*warn = FALSE;
|
||||
|
||||
schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
|
||||
"org.gtk.gtk4.Settings.Debug",
|
||||
|
||||
+27
-58
@@ -568,23 +568,26 @@ populate_display (GdkDisplay *display, GtkInspectorGeneral *gen)
|
||||
gdk_display_is_composited (display));
|
||||
}
|
||||
|
||||
static void
|
||||
add_monitor (GtkInspectorGeneral *gen,
|
||||
GdkMonitor *monitor,
|
||||
guint i)
|
||||
static GtkWidget *
|
||||
populate_monitor (gpointer item,
|
||||
gpointer gen)
|
||||
{
|
||||
GtkListBox *list;
|
||||
GdkMonitor *monitor = item;
|
||||
char *name;
|
||||
char *value;
|
||||
GdkRectangle rect;
|
||||
int scale;
|
||||
char *name;
|
||||
char *scale_str = NULL;
|
||||
const char *manufacturer;
|
||||
const char *model;
|
||||
|
||||
list = GTK_LIST_BOX (gen->monitor_box);
|
||||
list = GTK_LIST_BOX (gtk_list_box_new ());
|
||||
gtk_widget_add_css_class (GTK_WIDGET (list), "rich-list");
|
||||
gtk_list_box_set_selection_mode (list, GTK_SELECTION_NONE);
|
||||
|
||||
name = g_strdup_printf ("Monitor %u", i);
|
||||
/* XXX: add monitor # here when porting to listview */
|
||||
name = g_strdup_printf ("Monitor %d", 1);
|
||||
manufacturer = gdk_monitor_get_manufacturer (monitor);
|
||||
model = gdk_monitor_get_model (monitor);
|
||||
value = g_strdup_printf ("%s%s%s",
|
||||
@@ -592,15 +595,13 @@ add_monitor (GtkInspectorGeneral *gen,
|
||||
manufacturer || model ? " " : "",
|
||||
model ? model : "");
|
||||
add_label_row (gen, list, name, value, 0);
|
||||
g_free (value);
|
||||
g_free (name);
|
||||
|
||||
add_label_row (gen, list, "Connector", gdk_monitor_get_connector (monitor), 10);
|
||||
g_free (value);
|
||||
|
||||
gdk_monitor_get_geometry (monitor, &rect);
|
||||
scale = gdk_monitor_get_scale_factor (monitor);
|
||||
if (scale != 1)
|
||||
scale_str = g_strdup_printf (" @ %d", scale);
|
||||
scale_str = g_strdup_printf (" @ %d", scale);
|
||||
|
||||
value = g_strdup_printf ("%d × %d%s at %d, %d",
|
||||
rect.width, rect.height,
|
||||
@@ -610,46 +611,25 @@ add_monitor (GtkInspectorGeneral *gen,
|
||||
g_free (value);
|
||||
g_free (scale_str);
|
||||
|
||||
value = g_strdup_printf ("%d × %d mm²",
|
||||
value = g_strdup_printf ("%d × %d mm²",
|
||||
gdk_monitor_get_width_mm (monitor),
|
||||
gdk_monitor_get_height_mm (monitor));
|
||||
add_label_row (gen, list, "Size", value, 10);
|
||||
g_free (value);
|
||||
|
||||
if (gdk_monitor_get_refresh_rate (monitor) != 0)
|
||||
{
|
||||
value = g_strdup_printf ("%.2f Hz",
|
||||
0.001 * gdk_monitor_get_refresh_rate (monitor));
|
||||
add_label_row (gen, list, "Refresh rate", value, 10);
|
||||
g_free (value);
|
||||
}
|
||||
value = g_strdup_printf ("%.2f Hz",
|
||||
0.001 * gdk_monitor_get_refresh_rate (monitor));
|
||||
else
|
||||
value = g_strdup ("unknown");
|
||||
add_label_row (gen, list, "Refresh rate", value, 10);
|
||||
g_free (value);
|
||||
|
||||
if (gdk_monitor_get_subpixel_layout (monitor) != GDK_SUBPIXEL_LAYOUT_UNKNOWN)
|
||||
{
|
||||
add_label_row (gen, list, "Subpixel layout",
|
||||
translate_subpixel_layout (gdk_monitor_get_subpixel_layout (monitor)),
|
||||
10);
|
||||
}
|
||||
}
|
||||
value = g_strdup (translate_subpixel_layout (gdk_monitor_get_subpixel_layout (monitor)));
|
||||
add_label_row (gen, list, "Subpixel layout", value, 10);
|
||||
g_free (value);
|
||||
|
||||
static void
|
||||
populate_monitors (GdkDisplay *display,
|
||||
GtkInspectorGeneral *gen)
|
||||
{
|
||||
GtkWidget *child;
|
||||
GListModel *list;
|
||||
|
||||
while ((child = gtk_widget_get_first_child (gen->monitor_box)))
|
||||
gtk_list_box_remove (GTK_LIST_BOX (gen->monitor_box), child);
|
||||
|
||||
list = gdk_display_get_monitors (gen->display);
|
||||
|
||||
for (guint i = 0; i < g_list_model_get_n_items (list); i++)
|
||||
{
|
||||
GdkMonitor *monitor = g_list_model_get_item (list, i);
|
||||
add_monitor (gen, monitor, i);
|
||||
g_object_unref (monitor);
|
||||
}
|
||||
return GTK_WIDGET (list);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -660,25 +640,16 @@ populate_display_notify_cb (GdkDisplay *display,
|
||||
populate_display (display, gen);
|
||||
}
|
||||
|
||||
static void
|
||||
monitors_changed_cb (GListModel *monitors,
|
||||
guint position,
|
||||
guint removed,
|
||||
guint added,
|
||||
GtkInspectorGeneral *gen)
|
||||
{
|
||||
populate_monitors (gen->display, gen);
|
||||
}
|
||||
|
||||
static void
|
||||
init_display (GtkInspectorGeneral *gen)
|
||||
{
|
||||
g_signal_connect (gen->display, "notify", G_CALLBACK (populate_display_notify_cb), gen);
|
||||
g_signal_connect (gdk_display_get_monitors (gen->display), "items-changed",
|
||||
G_CALLBACK (monitors_changed_cb), gen);
|
||||
gtk_list_box_bind_model (GTK_LIST_BOX (gen->monitor_box),
|
||||
gdk_display_get_monitors (gen->display),
|
||||
populate_monitor,
|
||||
gen, NULL);
|
||||
|
||||
populate_display (gen->display, gen);
|
||||
populate_monitors (gen->display, gen);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -982,8 +953,6 @@ gtk_inspector_general_dispose (GObject *object)
|
||||
|
||||
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (seat_added), gen);
|
||||
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (seat_removed), gen);
|
||||
g_signal_handlers_disconnect_by_func (gen->display, G_CALLBACK (populate_display_notify_cb), gen);
|
||||
g_signal_handlers_disconnect_by_func (gdk_display_get_monitors (gen->display), G_CALLBACK (monitors_changed_cb), gen);
|
||||
|
||||
list = gdk_display_list_seats (gen->display);
|
||||
for (l = list; l; l = l->next)
|
||||
|
||||
@@ -38,9 +38,19 @@ dnd {
|
||||
-gtk-icon-size: 32px;
|
||||
}
|
||||
|
||||
image:disabled {
|
||||
-gtk-icon-filter: opacity(0.5);
|
||||
}
|
||||
/*
|
||||
These wildcard seems unavoidable, need to investigate.
|
||||
Wildcards are bad and troublesome, use them with care,
|
||||
or better, just don't.
|
||||
Every time a wildcard is used a kitten dies, painfully.
|
||||
*/
|
||||
|
||||
spinner:disabled,
|
||||
arrow:disabled,
|
||||
scrollbar:disabled,
|
||||
check:disabled,
|
||||
radio:disabled,
|
||||
treeview.expander:disabled { -gtk-icon-filter: opacity(0.5); }
|
||||
|
||||
.view,
|
||||
%view {
|
||||
@@ -482,7 +492,6 @@ button {
|
||||
-gtk-icon-filter: brightness(1.2);
|
||||
}
|
||||
|
||||
&.keyboard-activating,
|
||||
&:active,
|
||||
&:checked {
|
||||
@include button(active);
|
||||
@@ -498,8 +507,7 @@ button {
|
||||
@include button(backdrop);
|
||||
|
||||
transition: $backdrop_transition;
|
||||
|
||||
&:not(:disabled) { -gtk-icon-filter: none; }
|
||||
-gtk-icon-filter: none;
|
||||
|
||||
&:active,
|
||||
&:checked { @include button(backdrop-active); }
|
||||
@@ -515,7 +523,6 @@ button {
|
||||
|
||||
&:disabled {
|
||||
@include button(insensitive);
|
||||
-gtk-icon-filter: opacity(0.5);
|
||||
|
||||
&:active,
|
||||
&:checked { @include button(insensitive-active); }
|
||||
@@ -535,7 +542,6 @@ button {
|
||||
transition: $button_transition;
|
||||
transition-duration: 500ms;
|
||||
}
|
||||
&.keyboard-activating,
|
||||
&:active,
|
||||
&:checked {
|
||||
@include button(undecorated-active);
|
||||
@@ -4067,16 +4073,16 @@ window {
|
||||
box-shadow: 0 1px 2px transparentize(black, 0.8),
|
||||
0 0 0 1px transparentize($_wm_border, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
&.solid-csd {
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
border: solid 1px $borders_color;
|
||||
border-radius: 0;
|
||||
box-shadow: inset 0 0 0 4px $borders_color, inset 0 0 0 3px $headerbar_bg_color, inset 0 1px $top_hilight;
|
||||
&.solid-csd {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: solid 1px $borders_color;
|
||||
border-radius: 0;
|
||||
box-shadow: inset 0 0 0 3px $headerbar_bg_color, inset 0 1px $top_hilight;
|
||||
|
||||
&:backdrop { box-shadow: inset 0 0 0 4px $borders_color, inset 0 0 0 3px $backdrop_bg_color, inset 0 1px $top_hilight; }
|
||||
&:backdrop { box-shadow: inset 0 0 0 3px $backdrop_bg_color, inset 0 1px $top_hilight; }
|
||||
}
|
||||
}
|
||||
|
||||
&.maximized,
|
||||
|
||||
+2
-6
@@ -1,5 +1,5 @@
|
||||
project('gtk', 'c',
|
||||
version: '4.2.1',
|
||||
version: '4.2.0',
|
||||
default_options: [
|
||||
'buildtype=debugoptimized',
|
||||
'warning_level=1',
|
||||
@@ -193,7 +193,6 @@ check_functions = [
|
||||
'getpagesize',
|
||||
'getresuid',
|
||||
'lstat',
|
||||
'memfd_create',
|
||||
'mmap',
|
||||
'posix_fallocate',
|
||||
'_lock_file',
|
||||
@@ -221,13 +220,10 @@ if cc.compiles(uint128_t_src, name : '__uint128_t available')
|
||||
cdata.set('HAVE_UINT128_T', 1)
|
||||
endif
|
||||
|
||||
# Check for mlock and madvise
|
||||
# Check for mlock
|
||||
if cc.has_function('mlock', prefix: '#include <sys/mman.h>')
|
||||
cdata.set('HAVE_MLOCK', 1)
|
||||
endif
|
||||
if cc.has_function('madvise', prefix: '#include <sys/mman.h>')
|
||||
cdata.set('HAVE_MADVISE', 1)
|
||||
endif
|
||||
|
||||
# Disable deprecation checks for all libraries we depend on on stable branches.
|
||||
# This is so newer versions of those libraries don't cause more warnings with
|
||||
|
||||
@@ -127,37 +127,17 @@ g_io_module_query (void)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gst_media_file_ensure_prepared (GtkGstMediaFile *self)
|
||||
gtk_gst_media_file_ensure_prepared (GtkGstMediaFile *self,
|
||||
gint64 duration)
|
||||
{
|
||||
GstPlayerMediaInfo *media_info;
|
||||
|
||||
if (gtk_media_stream_is_prepared (GTK_MEDIA_STREAM (self)))
|
||||
return;
|
||||
|
||||
media_info = gst_player_get_media_info (self->player);
|
||||
if (media_info)
|
||||
{
|
||||
gtk_media_stream_prepared (GTK_MEDIA_STREAM (self),
|
||||
gst_player_media_info_get_audio_streams (media_info) != NULL,
|
||||
gst_player_media_info_get_video_streams (media_info) != NULL,
|
||||
gst_player_media_info_is_seekable (media_info),
|
||||
FROM_GST_TIME (gst_player_media_info_get_duration (media_info)));
|
||||
|
||||
g_object_unref (media_info);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Assuming everything exists is better for the user than pretending it doesn't exist.
|
||||
* Better to be able to control non-existing audio than not be able to control existing audio.
|
||||
*
|
||||
* Only for seeking we can't do a thing, because with 0 duration we can't seek anywhere.
|
||||
*/
|
||||
gtk_media_stream_prepared (GTK_MEDIA_STREAM (self),
|
||||
TRUE,
|
||||
TRUE,
|
||||
FALSE,
|
||||
0);
|
||||
}
|
||||
gtk_media_stream_prepared (GTK_MEDIA_STREAM (self),
|
||||
TRUE,
|
||||
TRUE,
|
||||
TRUE,
|
||||
duration);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -165,17 +145,17 @@ gtk_gst_media_file_position_updated_cb (GstPlayer *player,
|
||||
GstClockTime time,
|
||||
GtkGstMediaFile *self)
|
||||
{
|
||||
gtk_gst_media_file_ensure_prepared (self);
|
||||
gtk_gst_media_file_ensure_prepared (self, 0);
|
||||
|
||||
gtk_media_stream_update (GTK_MEDIA_STREAM (self), FROM_GST_TIME (time));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_gst_media_file_media_info_updated_cb (GstPlayer *player,
|
||||
GstPlayerMediaInfo *media_info,
|
||||
GtkGstMediaFile *self)
|
||||
gtk_gst_media_file_duration_changed_cb (GstPlayer *player,
|
||||
GstClockTime duration,
|
||||
GtkGstMediaFile *self)
|
||||
{
|
||||
gtk_gst_media_file_ensure_prepared (self);
|
||||
gtk_gst_media_file_ensure_prepared (self, FROM_GST_TIME (duration));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -205,7 +185,7 @@ static void
|
||||
gtk_gst_media_file_end_of_stream_cb (GstPlayer *player,
|
||||
GtkGstMediaFile *self)
|
||||
{
|
||||
gtk_gst_media_file_ensure_prepared (self);
|
||||
gtk_gst_media_file_ensure_prepared (self, 0);
|
||||
|
||||
if (gtk_media_stream_get_ended (GTK_MEDIA_STREAM (self)))
|
||||
return;
|
||||
@@ -225,7 +205,7 @@ gtk_gst_media_file_destroy_player (GtkGstMediaFile *self)
|
||||
if (self->player == NULL)
|
||||
return;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_media_info_updated_cb, self);
|
||||
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_duration_changed_cb, self);
|
||||
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_position_updated_cb, self);
|
||||
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_end_of_stream_cb, self);
|
||||
g_signal_handlers_disconnect_by_func (self->player, gtk_gst_media_file_seek_done_cb, self);
|
||||
@@ -244,7 +224,7 @@ gtk_gst_media_file_create_player (GtkGstMediaFile *file)
|
||||
|
||||
self->player = gst_player_new (GST_PLAYER_VIDEO_RENDERER (g_object_ref (self->paintable)),
|
||||
gst_player_g_main_context_signal_dispatcher_new (NULL));
|
||||
g_signal_connect (self->player, "media-info-updated", G_CALLBACK (gtk_gst_media_file_media_info_updated_cb), self);
|
||||
g_signal_connect (self->player, "duration-changed", G_CALLBACK (gtk_gst_media_file_duration_changed_cb), self);
|
||||
g_signal_connect (self->player, "position-updated", G_CALLBACK (gtk_gst_media_file_position_updated_cb), self);
|
||||
g_signal_connect (self->player, "end-of-stream", G_CALLBACK (gtk_gst_media_file_end_of_stream_cb), self);
|
||||
g_signal_connect (self->player, "seek-done", G_CALLBACK (gtk_gst_media_file_seek_done_cb), self);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
directory=gi-docgen
|
||||
url=https://gitlab.gnome.org/GNOME/gi-docgen.git
|
||||
push-url=ssh://git@gitlab.gnome.org:GNOME/gi-docgen.git
|
||||
url=https://gitlab.gnome.org/ebassi/gi-docgen.git
|
||||
push-url=ssh://git@gitlab.gnome.org:ebassi/gi-docgen.git
|
||||
revision=main
|
||||
depth=1
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ main (int argc, char *argv[])
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
|
||||
|
||||
button = gtk_button_new ();
|
||||
gtk_button_set_label (GTK_BUTTON (button), "hello world");
|
||||
gtk_button_set_label (GTK_BUTTON (button), "good world");
|
||||
gtk_widget_set_margin_top (button, 10);
|
||||
gtk_widget_set_margin_bottom (button, 10);
|
||||
gtk_widget_set_margin_start (button, 10);
|
||||
|
||||
@@ -212,7 +212,6 @@ compose_table_match_compact (void)
|
||||
gunichar ch;
|
||||
|
||||
buffer[0] = GDK_KEY_Multi_key;
|
||||
buffer[1] = 0;
|
||||
|
||||
ret = gtk_compose_table_compact_check (&table, buffer, 1, &finish, &match, &ch);
|
||||
g_assert_true (ret);
|
||||
@@ -223,7 +222,6 @@ compose_table_match_compact (void)
|
||||
buffer[0] = GDK_KEY_a;
|
||||
buffer[1] = GDK_KEY_b;
|
||||
buffer[2] = GDK_KEY_c;
|
||||
buffer[3] = 0;
|
||||
|
||||
ret = gtk_compose_table_compact_check (&table, buffer, 3, &finish, &match, &ch);
|
||||
g_assert_false (ret);
|
||||
@@ -235,33 +233,12 @@ compose_table_match_compact (void)
|
||||
buffer[1] = GDK_KEY_parenleft;
|
||||
buffer[2] = GDK_KEY_j;
|
||||
buffer[3] = GDK_KEY_parenright;
|
||||
buffer[4] = 0;
|
||||
|
||||
ret = gtk_compose_table_compact_check (&table, buffer, 4, &finish, &match, &ch);
|
||||
g_assert_true (ret);
|
||||
g_assert_true (finish);
|
||||
g_assert_true (match);
|
||||
g_assert_true (ch == 0x24d9); /* CIRCLED LATIN SMALL LETTER J */
|
||||
|
||||
buffer[0] = GDK_KEY_dead_acute;
|
||||
buffer[1] = GDK_KEY_space;
|
||||
buffer[2] = 0;
|
||||
|
||||
ret = gtk_compose_table_compact_check (&table, buffer, 2, &finish, &match, &ch);
|
||||
g_assert_true (ret);
|
||||
g_assert_true (finish);
|
||||
g_assert_true (match);
|
||||
g_assert_true (ch == 0x27);
|
||||
|
||||
buffer[0] = GDK_KEY_dead_acute;
|
||||
buffer[1] = GDK_KEY_dead_acute;
|
||||
buffer[2] = 0;
|
||||
|
||||
ret = gtk_compose_table_compact_check (&table, buffer, 2, &finish, &match, &ch);
|
||||
g_assert_true (ret);
|
||||
g_assert_true (finish);
|
||||
g_assert_true (match);
|
||||
g_assert_true (ch == 0xb4);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -329,21 +306,12 @@ match_algorithmic (void)
|
||||
g_assert_cmphex (ch, ==, 0x1e09);
|
||||
|
||||
ret = gtk_check_algorithmically (buffer, 2, &ch);
|
||||
g_assert_true (ret);
|
||||
|
||||
buffer[0] = GDK_KEY_dead_acute;
|
||||
buffer[1] = GDK_KEY_dead_cedilla;
|
||||
buffer[2] = GDK_KEY_dead_grave;
|
||||
|
||||
ret = gtk_check_algorithmically (buffer, 3, &ch);
|
||||
g_assert_false (ret);
|
||||
|
||||
buffer[0] = GDK_KEY_dead_diaeresis;
|
||||
buffer[1] = GDK_KEY_a;
|
||||
|
||||
ret = gtk_check_algorithmically (buffer, 2, &ch);
|
||||
g_assert_true (ret);
|
||||
g_assert_cmphex (ch, ==, 0xe4);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user