Commit Graph

69667 Commits

Author SHA1 Message Date
Matthias Clasen
939a254e28 ci: Stop using a separate docs image
No longer needed with gi-docgen.
2021-05-20 21:49:26 -04:00
Benjamin Otte
06a0265efa Merge branch 'fix-gst-media-file' into 'master'
gtkgstmediafile: Remove media-info-updated callback

Closes #3913

See merge request GNOME/gtk!3565

(cherry picked from commit 7db87a8889)

12a9a0fa gtkgstmediafile: Remove media-info-updated callback
2021-05-19 16:51:53 +00:00
Matthias Clasen
f639fda994 Merge branch 'pixbuf-fix-for-4-2' into 'gtk-4-2'
Meson: gdk-pixbuf jpeg/png options changed to feature

See merge request GNOME/gtk!3532
2021-05-07 21:14:51 +00:00
Xavier Claessens
26805edcff Meson: gdk-pixbuf jpeg/png options changed to feature 2021-05-07 15:34:52 -04:00
Matthias Clasen
d5db409c44 Merge branch 'wip/carlosg/map-emulated-moveresize-window-4.2' into 'gtk-4-2'
gdk/x11: Ensure to map the non-ewmh moveresize emulation window before use

See merge request GNOME/gtk!3530
2021-05-07 19:32:46 +00:00
Carlos Garnacho
b6a4ffef36 gdk/x11: Ensure to map the non-ewmh moveresize emulation window before use
Otherwise, we don't deem it as able to be grabbed, which we intend to do
immediately after.
2021-05-07 16:28:07 +02:00
Matthias Clasen
ba44668478 4.2.1 2021-05-03 21:37:09 -04:00
Matthias Clasen
2f921ab667 dragsource: Keep the source alive long enough
When a drop causes the event controller to be finalized
(directly or indirectly), we end up segfaulting while
trying to wrap up the drag operation. So, keep a reference
on the GtkDragSource from when the drag begins to when
it is done.

This fixes a crash in gnome-todo when dragging tasks.
2021-05-03 21:20:54 -04:00
Matthias Clasen
d9784df92e inspector: Improve monitor information display
Avoid a nested listbox, show the connector,
don't show information we don't have. Also,
disconnect all signal handlers from the display
when the inspector is going away.
2021-05-03 21:20:08 -04:00
Matthias Clasen
6a5f93ff95 shortcuts: Ignore consumed modifiers for mnemonics
This is necessary to make mnemonics like Alt-1 work in
layouts where numeric keys are shifted, like AZERTY.

Fixes: #3912
2021-05-03 21:19:43 -04:00
Matthias Clasen
7578a18cd6 contentdeserializer: Fix an oversight
The argument passed with string_deserializer must be
a charset name. Passing the mimetype there does not
make sense.
2021-05-03 21:19:28 -04:00
Ivan Molodetskikh
a5895b5995 gtkgstmediafile: Fix callback argument type 2021-05-03 21:19:14 -04:00
Matthias Clasen
37582c6bf9 wayland: Rewrite shm format debug spew
Rewrite this in a way that doesn't depend on kernel
header defines at the time the wayland scanner was run.

This was causing the build to break on Centos 8, where
a bunch of fourcc formats are missing.
2021-05-03 21:19:07 -04:00
Matthias Clasen
84f02c633c Check for root being a GtkWindow in a few places
These things were showing up as crashes during DND,
when the root is a GtkDragIcon. I'm sure there's more.
2021-05-03 21:18:59 -04:00
Bilal Elmoussaoui
fdb2776577 gdk: add zero-terminated annotation to content_formats_get_gtypes 2021-05-03 21:18:48 -04:00
Bilal Elmoussaoui
94539d469c gdk: fix content_formats_get_mime_types annotation 2021-05-03 21:18:42 -04:00
Chun-wei Fan
f6a2d8148b gdkglcontext-win32.c: Fix running with Mesa drivers
Some GL drivers such as Mesa-D3D12 do not allow one to call SetPixelFormat() on
a given HDC if one pixel format has been already set for it, so first check the
HDC with GetPixelFormat() to see whether a pixel format has already been set
with the HDC, and only attempt to acquire the pixel format if one has not been
set.

This will fix running with GL/NGL on Windows using the Mesa drivers.
2021-05-03 21:18:26 -04:00
Geyslan G. Bem
35e3eaf8cb gtkplacessidebar.c: fix coding style
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
2021-05-03 21:18:20 -04:00
Emmanuele Bassi
2bc7b64004 docs: Add missing extra files for gdk4 sub-references
The Wayland and X11 references need the gtk-logo.svg and the urlmap.js
extra files.

Fixes: #3905
2021-05-03 21:18:03 -04:00
David Lechner
2df07f0564 gdk/wayland/cursor/os-compatibility: fix build when memfd_create is not available
When building for homebrew/linuxbrew on Ubuntu 16.04, memfd_create() is
not available and causes the build to fail.

This adds a proper check for the function.
2021-05-03 21:17:53 -04:00
Geyslan G. Bem
2d747cca3c gtkplacessidebar.c: add bookmark null checking
This fixes nautilus crash and perhaps other callers issues.
Nautilus (and sometimes glib) crashes with malformed URI inside of the
bookmarks file .config/gtk-3.0/bookmarks when it has no LABEL.

This is result from the closed glib MR #2065 analysis and agreement.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2065#note_1091979

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
2021-05-03 21:17:48 -04:00
Matthias Clasen
f795a75d2b x11: Try harder to find the right monitor
If we deal with a panel, we end up with no monitor,
and crash, which isn't great and isn't necessary.

Fixes: #3900
2021-05-03 21:17:37 -04:00
Benjamin Otte
8748d9511b clipboard: Fix reading of files
Make sure writing a terminating null byte actually works and we don't
just ignore the error message.
2021-05-03 21:17:27 -04:00
Benjamin Otte
0fe3a26122 clipboard: Make sure G_TYPE_STRING is nul-terminated
When reading text, we need to check we terminate the G_TYPE_STRING
string with a null byte, because the clipboard does not guarantee one.

So just append a \0 to the stream.

Fixes #3899
2021-05-03 21:17:21 -04:00
Matthias Clasen
9145365331 window: Don't let solid-csd linger
Just from reading the code, it seems that we
should unset .csd and .solid-csd at the same
time, since the are mutually exclusive and
we unset them here so realize() can set one
of them again.
2021-05-03 21:17:03 -04:00
Matthias Clasen
84295147fd Simplify shadow conditions
The code in gtkwindow.c for dealing with the various
combinations of client-side decorations and client-side
shadows is entirely too complicated.

This commit does not really clean it up, but simplifies
one of the shadow conditions far enough to make some
sense.

With this change, I get the expected decorations in
all the cases I can easily reproduce locally.
2021-05-03 21:16:55 -04:00
Matthias Clasen
7ec50b1dd3 x11: Fix shadows
Commit a2cd21cab6 changed a condition and inadvertedly
broke client-side shadows on X11. Change this back.

Fixes: #3896
2021-05-03 21:16:44 -04:00
Matthias Clasen
a5b4c2bb48 a11y: Don't sent redundant property changes
We were sending a property changed event for every set
property whenever we were sending any updates.
2021-05-03 21:16:35 -04:00
Matthias Clasen
d26a3c28d0 gdk: Avoid synthetic motion confusion
Don't emit a synthetic motion event on a surface
that is grab-shadowed by a popup. This has been
known to confuse GTK, at times.

Fixes: #3439
2021-05-03 21:16:22 -04:00
Matthias Clasen
e75df3dcd3 window: Make resize border size independent
Deriving the resize border size from the shadows
carries the risk that we might end up with uneven
resize borders (or none at all, on some sides).

So, justs enforce that we have a big enough shadow
width on all sides.
2021-05-03 21:12:16 -04:00
Ulli Kehrle
db5eef5a81 imcontextsimple: Ignore more modifiers in compose
Previously it was impossible to compose characters on higher levels of
some keyboard layouts as pressing the level selection key would just
exit compose mode.

Examples for affected keyboard layouts include the Latvian
apostrophe-variant "lv(apostrophe)" (latched third level), the extended
German keyboard layout "de(e1)" (latched fifth level) as well as the
multilingual Canadian keyboard layout "ca(multix)" and the German
neo-layout "de(neo)" and its descendants (shifted fifth level).

To reproduce, set a compose key and select the Latvian apostrophe layout.
Notice that you now can input [ by pressing first the ' and then the 8-key.
Then pressing <compose>'8'8 should produce ⟦, but prior to this patch it
did not.
2021-05-03 21:12:07 -04:00
Matthias Clasen
0b0d7d3877 window: Tweak resize borders
Make windows resizable in the padding and border
area of the css box as well. This naturally makes
solid-csd borders work again.
2021-05-03 21:12:01 -04:00
Matthias Clasen
10b302ac29 window: Fix up resize borders
The invisible resize borders have been wider than they
should, for a while. Go back to a size close to what
we have in GTK3.

To summarize: resize borders will be at most 12 pixels
on each size, but never wider than the windows shadow.
The resize corners have 'legs' of 24 pixels where you
still get a corner resize cursor.

Fixes: #3856
2021-05-03 21:11:53 -04:00
John Renner
f1bfbeba45 Allow repeated selection extension on gktlistbox 2021-05-03 21:11:46 -04:00
Emmanuele Bassi
ca405f1060 a11y: Update the labelled-by relation of GtkTreeExpander
Whenever we change the :child property, we need to update the
labelled-by relation.
2021-05-03 21:11:36 -04:00
Emmanuele Bassi
4baec1ef22 a11y: Set state on the GtkTreeExpander widget
Instead of setting it on its internal child.
2021-05-03 21:11:21 -04:00
Matthias Clasen
d35e069436 imcontext: Fix cursor positions
gtk_im_context_get_preedit_string is documented to
return the cursor position as a character offset,
not a byte count. So return that.

Fixed: #3885
2021-05-03 21:11:12 -04:00
Emmanuele Bassi
6a95ca6995 a11y: Pair window:activate with window:deactivate signal
Orca needs both events in order to decide whether or not to subscribe to
other event/state changes in a window.
2021-05-03 21:11:01 -04:00
Matthias Clasen
268c174506 x11: Don't beep on untrusted displays
This can trigger BadAccess, and we don't
want that.

Fixes: #3862
2021-05-03 21:10:56 -04:00
Matthias Clasen
7e3493b15e a11y: Realize notebook tabs when switching
We're not moving focus here, so we can't rely
on that to conjure the a11y objects into existence.
2021-05-03 21:10:46 -04:00
Alberts Muktupāvels
be65bab5f6 theme: fix solid-csd style
Move .solid-csd style out of .csd parent and adjust it so windows
look similar / same to GTK 3 windows:
- 4px padding.
- extra shadow.

https://gitlab.gnome.org/GNOME/gtk/-/issues/3879#note_1086351
https://gitlab.gnome.org/GNOME/gtk/-/issues/3879#note_1086377
2021-05-03 21:10:39 -04:00
Matthias Clasen
c04139405a a11y: Avoid spurious selection changed events
Only send selection-changed events when we either
had a non-empty selection before, or have one now.

This should help orca speak the right things, and
not the wrong things.

Related: #3549
2021-05-03 21:10:29 -04:00
Emmanuele Bassi
5fc008024b a11y: Emit window:activate event
Orca uses the window:activate event type to track top levels, and avoid
being spammed by events coming from non-focused windows.
2021-05-03 21:10:24 -04:00
Matthias Clasen
f6bec2edf2 stackswitcher: Set accessible label properties
This makes the tabs in about dialogs come out as
'About', 'Credits', and 'System', instead of
'Tab', 'Tab', 'Tab'.
2021-05-03 21:10:14 -04:00
Matthias Clasen
c1e68f6044 a11y: Emit focus events
Orca relies on these to keep track of the focus location,
ignoring the focused state. With this change, orca can
once again speak text in entries as I type.
2021-05-03 21:10:08 -04:00
Matthias Clasen
549e5a8e3a a11y: Make things appear on focus in
We are starting with a pretty empty a11y object tree,
and we want orca to bring more of it into existence
by navigating the tree. But that only happens when we
send it events. Primarily focus events, which come in
from GTK via the platform_change mechanism. So realize
the context when we are sending platform_changes,
otherwise, orca never gets the mesage.
2021-05-03 21:10:03 -04:00
Matthias Clasen
5783d8af91 Fix a possible crash in gtk_show_uri
g_file_get_basename can return NULL.
Deal with it somehow.

Fixes: #3883
2021-05-03 21:09:54 -04:00
Matthias Clasen
1926d91e1d a11y: Actually set accessible roles
With most context realization happening inside
GtkAtspiContext in response to D-Bus calls, the
code in gtk_widget_realize_at_context that sets
the role is not executed for most accessibles,
causing them to be stuck with the 'filler' role
that makes orca ignore them.

To fix this, split gtk_widget_realize_at_context
into the actual context realization (getting on
the bus) and the setting of widget-specific
properties, and do the latter part when the
widget is rooted.

This makes accerciser report proper roles for
entries and buttons. Orca still has an issue
with getting the hierarchy populated.
2021-05-03 21:08:11 -04:00
Matthias Clasen
0441101786 a11y: Track window states more closely
Orca ignores events unless the object is inside an object
with role window and states ACTIVE and SHOWING. To arrange
for this, introduce a new ACTIVE platform state, and set it
for windows when they are active.

This gets orca to be a lot more talkative.
2021-05-03 21:07:53 -04:00
Matthias Clasen
eb8fce3645 a11y: Add the root object to the cache
Not 100% sure this is necessary, but maybe it helps
to get orca up to speed.
2021-05-03 21:06:36 -04:00