Matthias Clasen
efe16cf4be
entry: Add <attributes> support
...
Make entries support the same <attributes> syntax
as labels.
Closes : #1335
2020-04-06 22:13:10 -04:00
Matthias Clasen
dc2f65dd2b
Move label attribute parser code
...
We want to reuse the parser for <attributes> in several
widgets, so move it to a shared place.
2020-04-06 21:46:12 -04:00
Matthias Clasen
baeae71d12
Merge branch 'cross-postinstall' into 'master'
...
meson: Don't execute post-install.py if cross compiling
See merge request GNOME/gtk!1636
2020-04-06 23:59:33 +00:00
Matthias Clasen
f8be3229b1
Merge branch 'fix-event-match' into 'master'
...
shortcuttrigger: Don't trigger on key releases
See merge request GNOME/gtk!1642
2020-04-06 23:44:32 +00:00
Matthias Clasen
b9cfcf07e0
Merge branch 'wip/chergert/fix-shortcut-param-order' into 'master'
...
widget: fix parameter ordering to match implementation
Closes #2586
See merge request GNOME/gtk!1641
2020-04-06 23:30:26 +00:00
Matthias Clasen
eb649d8204
shortcuttrigger: Don't trigger on key releases
...
This broke when the event type check in gdk_key_event_matches
was removed and replaced by a precondition that accepts both
key press and release events.
Add the check in gtk_keyval_trigger_trigger instead.
2020-04-06 19:16:41 -04:00
Christian Hergert
4a00f3bc9a
widget: fix parameter ordering to match implementation
...
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2586
2020-04-06 15:44:19 -07:00
Matthias Clasen
0b17658a82
Replace most uses of <Primary> with <Control>
...
The only place where we are still using <Primary> is
in tests, to ensure we keep parsing it. Otherwise,
<Control> is now the preferred syntax.
2020-04-06 17:05:52 -04:00
Matthias Clasen
2486f46c0b
Merge branch 'keymap-rework-2' into 'master'
...
Keymap rework 2
See merge request GNOME/gtk!1635
2020-04-06 20:56:06 +00:00
Matthias Clasen
c03b7e4d45
reftests: Comment out a test that fails only in ci
...
Fixing such only-in-ci failures is just too hard,
unfortunately.
2020-04-06 16:32:03 -04:00
Matthias Clasen
e7a8a4eb06
Update migration guide
...
Rewrite the sections about keymaps and menus, and add
hints about modifiers.
2020-04-06 16:32:03 -04:00
Matthias Clasen
70fbf8dbb6
accelgroup: Small documentation updates
...
Mention GtkShortcutTrigger, and remove references
to <Release>.
2020-04-06 16:32:03 -04:00
Matthias Clasen
93a1b3027d
Reshuffle keymap docs
...
Since GdkKeymap api is on longer public, move relevant
documentation to the long description.
2020-04-06 16:32:03 -04:00
Matthias Clasen
1de7719e34
Drop gtk_accelerator_set_default_mod_mask
...
Our new approach to modifiers works with a fixed set,
there is really no need to customize the modifier
masks if the backends are all supposed to deliver
the same modifiers.
2020-04-06 16:32:03 -04:00
Matthias Clasen
f7f103a322
gdk: Remove gdk_keymap_get_modifier_mask
...
This function is no longer public and no longer used.
2020-04-06 16:32:03 -04:00
Matthias Clasen
14be8f6b73
Remove uses of modifier intents in gdkevents.c
...
This removes the use of the context menu and shift group
intents in gdkevents.c. If it turns out to be important,
we need to introduce vfuncs for gdk_event_triggers_context_menu
and gdk_event_matches.
2020-04-06 16:32:03 -04:00
Matthias Clasen
99a344f791
display: Remove gdk_display_get_modifier_mask
...
This is not used anymore.
2020-04-06 16:32:03 -04:00
Matthias Clasen
3419d9c04f
gtk: Drop gtk_widget_get_modifier_mask
...
This is not used anymore.
2020-04-06 16:32:03 -04:00
Matthias Clasen
c297d45b8a
gtk: Stop using modifier intents
...
Reviewing the existing settings, the only backend with
some differences in the modifier intent settings is OS X,
and we would rather have that implemented by interpreting
the existing modifiers in the appropriate way.
X11 Wayland Win32 OS X
primary ctrl ctrl ctrl mod2
mnemonic alt alt alt alt
context menu - - - ctrl
extend sel shift shift shift shift
modify sel ctrl ctrl ctrl mod2
no text alt|ctrl alt|ctrl alt|ctrl mod2|ctrl
shift group varies - - alt
GTK now uses the following modifiers:
primary ctrl
mnemonic alt
extend sel shift
modify sel ctrl
no text alt|ctrl
The context menu and shift group intents were not used
in GTK at all.
Update tests to no longer expect <Primary> to roundtrip
through the accelerator parsing and formatting code.
2020-04-06 16:32:03 -04:00
Matthias Clasen
dce8d251c6
keymap: Remove virtual modifier mapping functions
...
These are not used anymore.
Drop the vfuncs and their implementations in the
broadway, x11, wayland and win32 backends as well.
2020-04-06 16:32:03 -04:00
Matthias Clasen
89ad7893ad
gdk: Make GdkKeymap a private api
...
We have replacement apis in GdkDevice and GdkDisplay.
2020-04-06 16:32:03 -04:00
Matthias Clasen
da6faf321c
Merge branch 'misc-meson-fixes' into 'master'
...
Reduce useless relinking on configure and fix check for buildtype arguments
See merge request GNOME/gtk!1614
2020-04-06 20:22:01 +00:00
Justin van Steijn
c8b791a763
Update Dutch translation
2020-04-06 19:40:22 +00:00
Matthias Clasen
0eb728aa51
imcontextsimple: Disable some win32-only code
...
This code needs to be redone differently, since keymaps are no
longer going to be exposed. There should really not be this much
ifdef-ed backend-specific code here anyway. Or any, really.
2020-04-06 15:33:49 -04:00
Matthias Clasen
3300686bef
gdk: Clean up GdkModifierType
...
Remove MOD2..MOD5. Backends are expected to just set
the named modifiers.
2020-04-06 15:13:54 -04:00
Matthias Clasen
0a96a483c6
gdk: Redo key events
...
Add all of the keyboard translation results in the key event,
so we can translate the keyboard state at the time the event
is created, and avoid doing state translation at match time.
We actually need to carry two sets of translation results,
since we ignore CapsLock when matching accelerators, in
gdk_event_matches().
At the same time, drop the scancode field - it is only ever
set on win32, and is basically unused in GTK.
Update all callers.
2020-04-06 15:13:54 -04:00
Matthias Clasen
5071367794
gtk: Remove handling of virtual modifiers
...
These are going away. We expect to just have
named modifiers in modifier masks now, so we
longer juggle 'real' and 'virtual' modifiers.
2020-04-06 15:13:54 -04:00
Matthias Clasen
5ce05a8fd0
events: Stop doing elaborate virtual modifier handling
...
These are going away in the GdkModifierType cleanup.
Just compare the modifiers we got.
2020-04-06 15:13:54 -04:00
Matthias Clasen
be2a0971c2
broadway: Stop using MOD2..MOD5
...
These are going away in the GdkModifierType cleanup.
2020-04-06 15:13:53 -04:00
Matthias Clasen
25e9a54902
win32: Stop using MODx modifiers
...
The win32 backend is using GDK_MOD2_MASK for AltGr,
so define GDK_MOD2_MASK locally to keep this working,
but remove any mention of GDK_MOD3_MASK,...,GDK_MOD5_MASK.
2020-04-06 15:13:00 -04:00
Yuri Chornoivan
df1c6b6b68
Update Ukrainian translation
2020-04-06 15:46:52 +00:00
Yuri Chornoivan
00c791fcf9
Update Ukrainian translation
2020-04-06 14:06:17 +00:00
Matthias Clasen
a5e73820da
Merge branch 'fno-common' into 'master'
...
Add a missing extern, to fix building with -fno-common
See merge request GNOME/gtk!1631
2020-04-06 12:47:55 +00:00
Matthias Clasen
7fa103717d
wayland: Stop setting MOD2..MOD5
...
These are going away in the GdkModifierType cleanup.
2020-04-06 01:40:49 -04:00
Matthias Clasen
f8646b9733
gdk: Remove reserved bit from GdkModifierType
...
This really has no purpose and obscures the header.
2020-04-06 01:40:49 -04:00
Matthias Clasen
d110fddbce
gtk: Stop using GDK_MODx_MASK
...
These are never used in practice, and we never want to
see them in the UI, so stop supporting them. This is
in preparation for cleaning up GdkModifierType.
2020-04-06 01:40:49 -04:00
Matthias Clasen
b02db72e17
Rename GDK_MOD1_MASK to GDK_ALT_MASK
...
We've hardcoded Mod1 = Alt for a long time, there is
no need to keep the confusing naming around anymore.
2020-04-06 01:40:49 -04:00
Matthias Clasen
e8f30c836d
tests: Stop using gtk_accelerator_set_default_mod_mask
...
This is not doing anything useful here.
2020-04-06 01:40:49 -04:00
Matthias Clasen
6eaadba008
testsuite: Stop using keymap apis
2020-04-06 01:40:49 -04:00
Matthias Clasen
4495bacfd1
gtk: Use display apis for keymap mapping
...
This removes the last uses of GdkKeymap from GTK.
2020-04-06 01:40:49 -04:00
Matthias Clasen
234a21905c
gtk: Stop using keymap apis
...
Stop using most keymap apis in GTK. Only a few calls
related to virtual modifiers are left.
2020-04-06 01:40:49 -04:00
Matthias Clasen
13213c710f
x11: Notify new device properties
2020-04-06 01:40:49 -04:00
Matthias Clasen
e165267924
wayland: Notify new device properties
2020-04-06 01:40:49 -04:00
Matthias Clasen
00b25d5594
Move keymap mapping functions to GdkDisplay
...
We want to stop exposing GdkKeymap, so this
functionality needs a new home.
2020-04-06 01:40:40 -04:00
Matthias Clasen
31fb5c287a
Move GdkKeymapKey to gdktypes.h
...
We are going to use this type in a different header.
2020-04-05 23:43:41 -04:00
Matthias Clasen
416ec580dc
gdk: Move modifier mask api to GdkDisplay
...
GdkKeymap is on the way out.
2020-04-05 23:43:41 -04:00
Matthias Clasen
ee14be8ac1
gdk: Add keymap properties to GdkDevice
...
GdkKeymap is on the way out.
2020-04-05 23:43:41 -04:00
Matthias Clasen
f27470aaf4
passwordentry: Show caps lock warning more
...
Show the caps lock warning regardless of whether we
have the peek icon or not.
2020-04-05 23:43:41 -04:00
Matthias Clasen
90eda2b17c
Drop some no longer used code
2020-04-05 23:43:41 -04:00
Matthias Clasen
68d43c8e5c
cell renderer accel: Use gdk_event_get_match
2020-04-05 23:43:41 -04:00
Matthias Clasen
c9aef3fc4d
Add gdk_event_get_match
...
This is a counterpart to gdk_event_matches() that can
be used to obtain a shortcut matching an event.
2020-04-05 23:37:13 -04:00
Matthias Clasen
e8330c5eec
Add gdk_event_matches
...
Move the elaborate key event matching code from
GtkShortcutTrigger to GdkEvent, which greatly reduces
the amount of keymap api use outside of GDK.
2020-04-05 23:37:13 -04:00
Martin Storsjö
531766fe64
meson: Don't execute post-install.py if cross compiling
2020-04-05 22:57:22 +03:00
Martin Storsjö
25a53276e0
Add a missing extern, to fix building with -fno-common
...
With C compilers defaulting to -fcommon, this isn't an issue, but
upcoming compilers (GCC 10 and Clang 11) will default to -fno-common,
ending up with duplicate definitions of these variables.
2020-04-05 00:43:16 +03:00
Matthias Clasen
1149502767
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1630
2020-04-04 21:09:12 +00:00
Matthias Clasen
33928a52c3
gtk-demo: Fix a crash
...
Using the assistant demo repeatedly was crashing.
2020-04-04 15:35:18 -04:00
Matthias Clasen
b636df7784
Merge branch 'matthiasc/for-master' into 'master'
...
shortcuts: documentation fixes
See merge request GNOME/gtk!1628
2020-04-04 15:33:41 -04:00
Matthias Clasen
005739371c
Merge branch 'matthiasc/for-master' into 'master'
...
shortcuts: documentation fixes
See merge request GNOME/gtk!1628
2020-04-04 16:31:43 +00:00
Matthias Clasen
ec854fc503
shortcuts: documentation fixes
...
Update symbol lists, and add examples for parsing triggers
and actions.
2020-04-04 12:22:43 -04:00
Piotr Drąg
e75e975a38
Update POTFILES.skip
2020-04-04 11:56:04 +02:00
Matthias Clasen
2bf81b51d9
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1626
2020-04-04 05:00:22 +00:00
Matthias Clasen
22211f29fb
colorbutton: Don't add a customize menu
...
The color swatch in the button does not need a
context menu. Turn it off.
2020-04-04 00:28:52 -04:00
Matthias Clasen
8991275fbd
colorbutton: Fix focus
...
The colorbutton contains a button which contains a colorswatch.
We want the focus to go straight to the button, nowhere else,
so mark the swatch as !can-focus.
Adapt tests to match.
2020-04-04 00:28:45 -04:00
Matthias Clasen
f2d6a7b36a
demos: Remove can-focus from ui files
2020-04-04 00:28:34 -04:00
Matthias Clasen
e43eb951d6
Merge branch 'scrollbar-a11y' into 'master'
...
Add GtkScrollbarAccessible
See merge request GNOME/gtk!1623
2020-04-04 04:03:40 +00:00
Matthias Clasen
5205fa0ff7
scrollbar: Be more defensive
...
Somehow the scrollbar accessible manages to call
gtk_scrollbar_get_adjustment when priv->range is NULL.
Survive taht.
2020-04-03 23:31:45 -04:00
Matthias Clasen
842af79e97
Merge branch 'shortcut-action-parse' into 'master'
...
Shortcut action parse
See merge request GNOME/gtk!1625
2020-04-04 03:12:10 +00:00
Matthias Clasen
6b292af6ac
testsuite: Add tests for parsing shortcut actions
2020-04-03 22:42:00 -04:00
Matthias Clasen
1424dd9786
Add an api to parse shortcut actions
...
This is so we can test this code. While doing it
I also fixed the missing else that was caused it
not to work.
2020-04-03 22:41:15 -04:00
Matthias Clasen
339d3e41b0
Add GtkScrollbarAccessible
...
When GtkScrollbar stopped being a GtkRange,
GtkRangeAccessible stopped working for scrollbars.
Update a11y tests to match.
2020-04-03 15:20:27 -04:00
Carlos Garnacho
9a2f7338df
Merge branch 'wip/carlosg/fix-surrounding-text-master' into 'master'
...
imwayland: Clamp the surrounding string end correctly
Closes #2565
See merge request GNOME/gtk!1621
2020-04-03 18:37:44 +00:00
Matthias Clasen
bdb127e54c
Merge branch 'focus-test' into 'master'
...
Focus test
See merge request GNOME/gtk!1622
2020-04-03 18:23:27 +00:00
Carlos Garnacho
e5d23aaaaf
imwayland: Clamp the surrounding string end correctly
...
In the paths where len > MAX_LEN and cursor/anchor are separated by
at least MAX_LEN from text edges, we were clamping the right end of
the surrounding string at MAX_LEN. Oops.
This end anchor may go as far as the string length, although just
up to len - MAX_LEN in real terms (due to the condition above that
caches cursor/anchor positions being near enough the text end).
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2565
(cherry-picked from commit d7fb15c822
)
2020-04-03 19:55:55 +02:00
Matthias Clasen
d662512c44
testsuite: Add a big focus chain testcase
2020-04-03 11:35:34 -04:00
Matthias Clasen
324af2f701
testsuite: Try harder to record a full focus chain
...
It is hard to avoid widgets with the same name in a
large ui file - try harder to record a full focus chain
before decide that we've wrapped, by including the widget
address in the comparison. Note that we don't include
the addresses in the generated output, since that would
make expected output vary from run to run.
2020-04-03 11:35:26 -04:00
Emmanuele Bassi
de481a7b5e
Merge branch 'gir-fixes' into 'master'
...
Annotation fixes
See merge request GNOME/gtk!1616
2020-04-03 15:21:59 +00:00
Matthias Clasen
c8018e267a
Merge branch 'move-gdkgrab-decl' into 'master'
...
gdk: Move GdkGrabStatus and GdkGrabOwnership decl.
See merge request GNOME/gtk!1615
2020-04-03 15:03:51 +00:00
Emmanuele Bassi
4e264a74be
Annotation fixes
...
Match the arguments name in the declaration and the definition, and make
sure we have the proper transfer annotations.
2020-04-03 15:30:56 +01:00
Olivier Fourdan
4f49d83e43
gdk: Move GdkGrabStatus and GdkGrabOwnership decl.
...
With the removal of `gdk_seat_grab` we do not need to keep the
definitions of `GdkGrabStatus` and `GdkGrabOwnership` public.
Move those definitions to become internal only.
2020-04-03 15:23:01 +02:00
Nirbheek Chauhan
eaef24c527
meson: Fix check for builtype arguments
...
`get_option('buildtype')` will return `'custom'` for most combinations
of `-Doptimization` and `-Ddebug`, but those two will always be set
correctly if only `-Dbuildtype` is set. So we should look at those
options directly.
For the two-way mapping between `buildtype` and `optimization`
+ `debug`, see this table:
https://mesonbuild.com/Builtin-options.html#build-type-options
2020-04-03 18:41:55 +05:30
Nirbheek Chauhan
777435c470
meson: Reduce useless relinking on reconfigure
...
When we reconfigure, `configure_file()` is called again, and
`*.gresource.xml` files are regenerated, which causes many (all?)
binaries to be relinked. Now we only write those out if the contents
actually changed (or if the output didn't already exist).
This is exactly what Meson already does with `configure_file()` when
`command:` is not used.
While we're at it, also do the same for `gen-c-array.py` and
`gentypefuncs.py` for completeness. Now even if the input to those
changes, re-building of those custom targets may not result in
relinking if the outputted C files have the same contents.
2020-04-03 18:41:55 +05:30
Timm Bäder
fb325afc79
shortcutcontroller: fix transfer full annotation
2020-04-03 08:03:32 +02:00
Timm Bäder
046190cb8a
window: Don't leak toplevel layout
2020-04-03 07:37:54 +02:00
Matthias Clasen
53592497a4
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1611
2020-04-03 01:07:14 +00:00
Matthias Clasen
cffa45d5ff
wayland: Add a comment about keyboard state handling
...
Clarify a point that took me a few hours to fully track
down, so lets preserve what I found for the next poor
sould coming this way.
2020-04-02 17:43:14 -04:00
Matthias Clasen
14166b09b5
a11y tests: Update for focus state changes
2020-04-02 17:35:15 -04:00
Matthias Clasen
8a0035333a
a11y: Set focus-related states properly
...
Entries and menubuttons are no longer focusable themselves,
they have focusable children. Since we don't have accessible
objects for those, transfer the focus-related state (focusable
and focused) from the children to the main accessible object.
2020-04-02 17:35:09 -04:00
Matthias Clasen
1f8e633fff
window: tie focus to surface state changes
...
We don't get a focus-out on the event controller, when
the surface is losing keyboard focus, since we are not
moving our focus to some other widget, so we are never
unsetting the mnemonics-visible property. Do that in
response to surface state changes instead.
2020-04-02 17:21:01 -04:00
Matthias Clasen
6e6b4a851f
Merge branch 'cherry-picked-wayland-keyboard-fix' into 'master'
...
gdk/wayland: Clear modifiers when we lose keyboard focus
Closes #2112
See merge request GNOME/gtk!1610
2020-04-02 20:43:29 +00:00
Jan Alexander Steffens (heftig)
7444b15d47
gdk/wayland: Clear modifiers when we lose keyboard focus
...
When we `Alt+Tab` away from a GTK application, it loses keyboard focus.
If we don't clear the modifiers, events from other devices that we
receive while unfocused will assume `Alt` is still pressed. This results
in e.g. Firefox navigating through the history instead of scrolling the
page when using the mouse wheel on it.
We don't get any information about modifiers while we are missing
keyboard focus, so assuming no modifiers are active is the best we can
do.
The shell sends us a modifier update immediately before we regain
keyboard focus, so the state shouldn't get out of sync.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2112
2020-04-02 16:18:18 -04:00
Matthias Clasen
dd625abfc1
Merge branch 'wip/smcv/libdir-independent-valgrind-suppressions' into 'master'
...
supp: Use a single suppressions file for lib, lib64 and multiarch
See merge request GNOME/gtk!1603
2020-04-02 14:46:45 +00:00
Matthias Clasen
b6f6df9662
Merge branch 'im-context-wayland-fixes' into 'master'
...
Im context wayland fixes
See merge request GNOME/gtk!1605
2020-04-02 13:29:32 +00:00
Matthias Clasen
aaa4e40a1f
imcontexsimple: Move Compose file loading to class_init
...
This ensures that it is done only once.
2020-04-02 09:04:23 -04:00
Matthias Clasen
8ec254e2bb
imcontextsimple: Simpify Compose file loading
...
We are not loading the Compose file for individual contexts,
it just gets added to a global list. So don't pass an im context
along. This will let us move the loading out of the initialization
of individual contexts, and only do it once.
2020-04-02 09:02:05 -04:00
Matthias Clasen
2a9911724f
imcontextsimple: Load ~/.Compose unconditionally
...
There is nothing display-specific in the ~/.Compose file,
so we can just try to load it without looking at the
display we are on.
2020-04-02 09:02:05 -04:00
Matthias Clasen
a9b4ac3d59
imcontextsimple: Add a profiler mark for IO
...
We are loading a file here, thankfully in a thread, but
we do it every time an entry is created. Add a profiler
mark, to make this visible.
2020-04-02 09:02:05 -04:00
Simon McVittie
9df7f0197d
supp: Use a single suppressions file for lib, lib64 and multiarch
...
In addition to the traditional library directory lib and the 64-bit
multilib directory lib64, this will cover Debian-style multiarch
(lib/x86_64-linux-gnu etc.), Arch Linux 32-bit (lib32), x32 and
various others.
Signed-off-by: Simon McVittie <smcv@debian.org >
2020-04-02 09:18:55 +01:00
Matthias Clasen
f169d23cdb
Merge branch 'fix-menu-flicker' into 'master'
...
Fix crossing event generation
Closes #2536
See merge request GNOME/gtk!1601
2020-04-02 05:19:13 +00:00
Matthias Clasen
fcd36e59b1
Fix crossing event generation
...
We were not properly setting the new_descendent field
in Crossing structs for GTK_CROSSING_OUT events. This
was causing extraneous ::leave signals to be emitted,
and make model buttons in popover menus flicker when
hovered.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2536
2020-04-02 00:39:46 -04:00
Matthias Clasen
8196478b19
Merge branch 'drop-popover-demo' into 'master'
...
gtk-demo: Remove the popover demo
Closes #2429
See merge request GNOME/gtk!1600
2020-04-01 20:40:17 +00:00
Matthias Clasen
e31bbb41d2
gtk-demo: Remove the popover demo
...
It doesn't work anymore, since popovers now need
support in the parent, and we don't really need
a demo just for popovers. They are used everywhere
already.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2429
2020-04-01 15:45:13 -04:00
Emmanuele Bassi
9c948909ac
Merge branch 'flow-box-typo' into 'master'
...
gtkflowbox: Fix a minor typo in the documentation
See merge request GNOME/gtk!1599
2020-04-01 13:45:19 +00:00
Philip Withnall
544b8d5a7f
gtkflowbox: Fix a minor typo in the documentation
...
Signed-off-by: Philip Withnall <withnall@endlessm.com >
2020-04-01 14:04:46 +01:00
Matthias Clasen
6ae5d9ac22
Merge branch 'matthiasc/for-master' into 'master'
...
keynav: Fix Shift-Tab
See merge request GNOME/gtk!1598
2020-04-01 05:04:02 +00:00
Matthias Clasen
63c6af8d13
Merge branch 'cursor-aspect-ratio' into 'master'
...
Add a cursor-aspect-ratio setting
See merge request GNOME/gtk!1597
2020-04-01 05:02:15 +00:00
Matthias Clasen
199a539ae7
Update the settings test
2020-04-01 00:24:56 -04:00
Matthias Clasen
dc3d778e01
keynav: Fix Shift-Tab
...
This was broken by the shortcuts branch merge.
2020-04-01 00:21:19 -04:00
Matthias Clasen
2154b8e745
Add a cursor-aspect-ratio setting
...
Add a setting that controls how thick the text caret is drawn.
The default value is 0.04.
2020-03-31 23:30:20 -04:00
Matthias Clasen
9f93464ea4
3.98.2
2020-03-31 21:09:30 -04:00
Matthias Clasen
5987bc5d71
Merge branch 'wip/carlosg/stuck-pointer-focus' into 'master'
...
gtkmain: Do not try to coalesce/ignore crossing events
See merge request GNOME/gtk!1594
2020-04-01 00:16:26 +00:00
Matthias Clasen
298218b1d2
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1593
2020-03-31 23:19:09 +00:00
Carlos Garnacho
fa7f6ad910
gtkmain: Do not try to coalesce/ignore crossing events
...
Under grabbing circumstances we used to get several crossing events,
some corresponding to the grab itself and some corresponding to
pointer motion.
The backends now do a better job at keeping those simple, which
means we sit listening for events that don't actually arrive. This
triggers pointer focus issues when dragging windows or opening
grabbing popups.
Actually obey those events, they will be the only ones we get now.
2020-04-01 00:40:17 +02:00
Matthias Clasen
b92b7f45b5
testsuite: Add a test for transforms in builder files
2020-03-31 16:49:51 -04:00
Matthias Clasen
2bacc0d4ef
testsuite: Add a test for parsing layout properties
...
and drop the child properties test that doesn't
do anything anymore.
2020-03-31 16:49:51 -04:00
Matthias Clasen
e4fb4b635c
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1591
2020-03-31 18:32:18 +00:00
Matthias Clasen
5432f73095
window: Fix residual resizing issues
...
After the GdkToplevel split, GtkWindow occasionally
forgets its minimum size. Fix this by keeping a GdkToplevelLayout
around and reusing it.
2020-03-31 13:07:44 -04:00
Chun-wei Fan
2f64651a3f
meson.build: Fix Visual Studio builds
...
We need to make the C++ language available before we can access the C++
compiler object...
2020-03-31 12:00:26 +08:00
Matthias Clasen
0852d66f6e
NEWS: Updates
2020-03-30 21:58:24 -04:00
Matthias Clasen
f3e826f4d6
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1589
2020-03-31 00:39:37 +00:00
Matthias Clasen
15eb3bbbf1
shortcutcontroller: Document buildable support
2020-03-30 20:09:29 -04:00
Matthias Clasen
96f822434f
testsuite: Add a builder test for shortcut controllers
2020-03-30 20:08:25 -04:00
Matthias Clasen
ace183f38f
shortcutcontroller: Fix builder support
...
The GtkBuilder support was not working anymore after
triggers and actions have been turned into objects.
Fix this.
2020-03-30 19:02:35 -04:00
Matthias Clasen
5bf030413b
Add new api to the docs
2020-03-30 14:12:14 -04:00
Matthias Clasen
2a3dab5b94
Merge branch 'wip/hadess/portal-fixes' into 'master'
...
Portal fixes
See merge request GNOME/gtk!1585
2020-03-30 17:45:40 +00:00
Matthias Clasen
96f0c26306
Merge branch 'issue982' into 'master'
...
gdk: Add gdk_toplevel_inhibit_system_shortcuts API
Closes #982
See merge request GNOME/gtk!1542
2020-03-30 17:41:12 +00:00
Bastien Nocera
8cf41c1b66
filechoosernativeportal: Fall back if portal is too old
...
Add portal version checking as originally implemented for the GTK 3.x
branch.
See: 35fec1c6b2
2020-03-30 18:31:24 +02:00
Bastien Nocera
027ca22def
Add portal version checking helper
...
Add gtk_get_portal_interface_version() to check the version of a portal.
2020-03-30 18:31:23 +02:00
Bastien Nocera
bd55c5842e
colorpickerportal: Simplify version fetching code
...
Simplify version checking code by using a function to fetch the uint out
of the GVariant and don't throw a warning if it can't be fetched.
2020-03-30 18:31:23 +02:00
Olivier Fourdan
c3ff175e3f
win32: Add inhibit shortcut properties
...
Win32 backend doesn't have support for inhibit shortcuts, yet it needs
support the standard set of GdkToplevel properties.
Add support for the "inhibit-list" object property to GdkToplevel on
win32.
2020-03-30 18:25:36 +02:00
Olivier Fourdan
b22c7b8b77
broadway: Add inhibit shortcut properties
...
Broadway doesn't have support for inhibit shortcuts, yet it needs to
support the standard set of GdkToplevel properties.
Add support for the "inhibit-list" object property to GdkToplevel on
Broadway.
2020-03-30 18:25:36 +02:00
Olivier Fourdan
83027c68f1
x11: Implement inhibit_system_shortcuts API
...
On X11, there is no such equivalent to the inhibit shortcut protocol
found on Wayland.
To implement the inhibit_system_shortcuts API on X11, we emulate the
same behavior using grabs on the keyboard.
To avoid keeping active grabs on the keyboard that would affect other
X11 applications even when the surface isn't focused, the X11
implementation takes care of releasing the grabs as soon as the toplevel
loses focus.
2020-03-30 18:25:36 +02:00
Olivier Fourdan
44931a66df
x11: Use gdk_x11_* rather than gdk_wayland_*
...
Rename the local functions for the x11 backend as gdk_x11_* rather than
gdk_wayland_*
2020-03-30 18:25:36 +02:00
Olivier Fourdan
36d986f33c
wayland: Implement inhibit_system_shortcuts API
...
On Wayland, this is a direct mapping with the inhibit shortcut protocol
that GDK already supports.
Simply wire the new API to the existing entries.
2020-03-30 18:25:36 +02:00
Olivier Fourdan
5ac73be976
wayland: Use a GdkSeat as key for our internal hash table
...
With the current implementation, we use a `wl_seat` as the key for our
internal has table where we store the Wayland shortcuts inhibitors.
There is however no technical reason for this, and we could use a
GdkSeat instead, which will ease the implementation of the GdkToplevel
shortcut inhibition API.
2020-03-30 18:25:36 +02:00
Olivier Fourdan
a07a69e24e
gdk: add internal gdk_surface_get_seat_from_event()
...
This can come handy to get the seat from a surface/event.
2020-03-30 18:25:36 +02:00
Olivier Fourdan
3e1f59af61
gdk: Add gdk_toplevel_inhibit_system_shortcuts API
...
With the removal of grabs from the public API, we need a replacement API
to let applications bypass system keyboard shortcuts.
A typical use case for this API is remote desktop or virtual machine
viewers which need to inhibit the default system keyboard shortcuts so
that the remote session or virtual host gets those instead of the local
environment.
Close: https://gitlab.gnome.org/GNOME/gtk/issues/982
2020-03-30 18:25:36 +02:00
Matthias Clasen
da47ccaf3c
Merge branch 'wip/jimmac/avoid-t-word' into 'master'
...
widget-factory: avoid the T word
See merge request GNOME/gtk!1586
2020-03-30 15:15:51 +00:00
Jakub Steiner
e9082fd9f3
widget-factory: avoid the T word
...
- style variant sound more appropriate
2020-03-30 14:28:47 +02:00
Matthias Clasen
61e88c7421
Merge branch 'matthiasc/for-master' into 'master'
...
widget: Remove a leftover vfunc
See merge request GNOME/gtk!1584
2020-03-30 11:37:57 +00:00
Matthias Clasen
de31bb59a1
window: Remove initial-focus leftovers
...
We removed the way to set initial_focus a year ago,
time to get rid of the leftovers.
2020-03-29 23:39:54 -04:00
Matthias Clasen
07bb29153b
widget: Remove a leftover vfunc
...
The popup-menu signal is gone, so we can remove the vfunc.
2020-03-29 23:18:56 -04:00
Yosef Or Boczko
b35e5eeaf6
Update Hebrew translation
2020-03-29 15:34:36 +00:00
Yosef Or Boczko
c0a450e41b
Update Hebrew translation
2020-03-29 15:33:40 +00:00
Timm Bäder
785b33f169
widget: Return an array from list_controllers
...
Minimize the GList usage throughout the code base.
2020-03-29 15:32:54 +02:00
Matthias Clasen
af749dc1dc
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1583
2020-03-29 13:18:35 +00:00
Matthias Clasen
47982ae272
coloreditor: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
0020b735d9
colorchooserdialog: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
e05c1b0244
colorchooserwidget: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
d0b4f9eb29
notebook: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
03375b723a
listbox: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
e2beb6ec50
levelbar: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
ef32cff771
spinbutton: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
366b007024
filechooserwidget: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
40337aa1b3
printunixdialog: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
0bb38b903e
printjob: Drop the Private struct
2020-03-29 09:04:19 -04:00
Matthias Clasen
8acd9ffc76
testsuite: Fix notify test no not fail on the 30th
...
We are setting the month property to 10 different values,
checking that the change succeeds. But the calendar defaults
to the current date, so on every 30th of the month, we
try to set a date of Febuary 30, which fails.
Lets fix this before the 31st, by setting the calendar
to a good date.
2020-03-29 09:04:19 -04:00
Piotr Drąg
23b29341ba
Update Polish translation
2020-03-29 14:08:56 +02:00
Matthias Clasen
6e52820fd2
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1582
2020-03-28 21:17:29 +00:00
Matthias Clasen
173b1333ca
printing: Avoid a crash
...
When no printer has been selected (e.g. because we don't
find any printers), the 'print at' radio group should be
insensitive, except for the 'now' choice. Selecting another
option in this situation will lead to a crash.
2020-03-28 15:36:15 -04:00
Matthias Clasen
784d6f8d0c
printing: Fix initial page range radio group
...
Only set one radio button as active in the ui file.
Otherwise we end up with multiple options appearing
as selected initially.
2020-03-28 15:36:15 -04:00
Matthias Clasen
3437f85aaf
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1580
2020-03-28 19:35:36 +00:00
Matthias Clasen
7916b95bc5
gesture: Fix gtk_gesture_get_bounding_box
...
When we stopped translating event coordinates in-place,
this function inadvertently started returning surface-relative
bounding boxes instead of widget-relative ones, as expected.
Fix this by using the widget-relative coordinates that we
already store.
2020-03-28 15:03:33 -04:00
Matthias Clasen
7b135c96e4
cellarea: Fix cell editing
...
We need to translate the event coordinates to
widget-relative coordinates. This broke when
we stopped translating event coordinates in-place.
2020-03-28 14:56:26 -04:00
Matthias Clasen
e662438675
button: Fix an event handling gotcha
...
We no longer translate event coordinates in-place,
so gdk_event_get_position() returns surface-relative
coordinates, not widget-relative ones. Just use the
coordinates we are given.
2020-03-28 14:33:01 -04:00
Matthias Clasen
aa2ca80817
imcontextsimple: Don't use g_object_unref on events
...
Events are not objects anymore.
2020-03-28 14:29:08 -04:00
Matthias Clasen
9ccd514682
x11: Don't use g_object_unref on events
...
Events are not object anymore.
2020-03-28 14:28:36 -04:00
Matthias Clasen
2c7afc0556
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1579
2020-03-28 16:09:01 +00:00
Piotr Drąg
182cb81bdb
Update POTFILES.in and POTFILES.skip
2020-03-28 16:04:52 +01:00
Matthias Clasen
ceef86895f
appchooserdialog: Drop the Private struct
2020-03-28 10:59:12 -04:00
Matthias Clasen
001d076e61
image: Drop the Private struct
2020-03-28 10:49:54 -04:00
Matthias Clasen
408dd37944
infobar: Drop the Private struct
2020-03-28 10:48:15 -04:00
Matthias Clasen
9287e0e7fb
texthandle: Drop the Private struct
2020-03-28 10:36:09 -04:00
Matthias Clasen
28eb1fce04
searchentry: Drop the Private struct
2020-03-28 10:28:22 -04:00
Matthias Clasen
49427119ab
statusbar: Drop the Private struct
2020-03-28 10:28:01 -04:00
Matthias Clasen
05891b1238
settings: Drop the Private struct
...
Also drop class padding - pointless for final types.
2020-03-28 10:22:44 -04:00
Matthias Clasen
b14d99ad7a
accellabel: Drop unused class fields
...
We are not using these anymore.
2020-03-28 10:15:50 -04:00
Matthias Clasen
329638280c
accellabel: Drop the Private struct
2020-03-28 10:06:26 -04:00
Matthias Clasen
06365cdc38
actionbar: Drop the Private struct
2020-03-28 09:59:49 -04:00
Matthias Clasen
1f808c479a
aboutdialog: Drop the Private struct
2020-03-28 09:59:07 -04:00
Matthias Clasen
7e8d61b92c
menubutton: Drop the Private struct
2020-03-28 09:49:29 -04:00
Timm Bäder
d01e664c79
applicationaccels: Fix shortcut memory leaks
...
g_list_model_get_item() is transfer-full.
2020-03-28 08:34:35 +01:00
Matthias Clasen
858997d172
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
Closes #2489
See merge request GNOME/gtk!1578
2020-03-28 04:40:52 +00:00
Matthias Clasen
f3d061e879
gtk-demo: Fix the stack demo
...
The GtkSpinner:active property was renamed to :spinning.
2020-03-28 00:08:12 -04:00
Matthias Clasen
e2c327e025
gtk-demo: Fix the sliding puzzle
...
Update for a change in gtk_shortcut_controller_add_shortcut
behavior.
2020-03-28 00:08:12 -04:00
Matthias Clasen
48910a6d8e
gtk-demo: Fix the shortcuts demo
...
We don't have margins anymore.
2020-03-28 00:08:12 -04:00
Matthias Clasen
fbed55dff9
gtk-demo: Fix the rotated text demo
...
Off-by-one on the heart!
2020-03-28 00:08:12 -04:00
Matthias Clasen
059917b83c
gtk-demo: Fix the overlay demo
...
We must use two separate boxes for the label and
the entry, otherwise we can't keep their can-target
properties apart.
2020-03-28 00:08:12 -04:00
Matthias Clasen
163aa82d45
gtk-demo: Use mnemonics in menu buttons
...
Use GtkMenuButton:use-underline in the modelbutton demo.
2020-03-28 00:08:12 -04:00
Matthias Clasen
ba25e08e7b
menubutton: Add a use-underline property
...
This is necessary since apps no longer have direct
access to the label.
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2489
2020-03-28 00:08:12 -04:00
Matthias Clasen
bc2c341d60
gtk-demo: Visual fixes to the model button demo
2020-03-28 00:08:12 -04:00
Matthias Clasen
7e0266004e
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1577
2020-03-27 21:10:19 +00:00
Matthias Clasen
93d54ba10b
gtk-demo: Fix the search entry demo
...
Avoid critical warnings when setting up the context
menu actions.
2020-03-27 16:24:20 -04:00
Matthias Clasen
5d07a66d1d
widget-factory: Fix the radio button example
...
We only want one of the sensitive buttons to be active,
so don't tell them all to be active.
2020-03-27 16:06:03 -04:00
Matthias Clasen
8997dc6f31
Merge branch 'rename-theme-resources' into 'master'
...
Rename GResources for standard GTK themes
See merge request GNOME/gtk!1576
2020-03-27 16:37:31 +00:00
Matthias Clasen
9f72f4225d
Merge branch 'trigger-parser' into 'master'
...
Improve GtkShortcutTrigger parser
See merge request GNOME/gtk!1572
2020-03-27 15:45:08 +00:00
Emmanuele Bassi
f1003d6ae8
Rename GResources for standard GTK themes
...
After commit 2ab9be54fb
we had to rename
the generated CSS files to be included into the GResource bundle; we
kept the URI stable to avoid too much churn, and allow backporting the
change to the 3.24 stable branch. This had the adverse effect of making
it harder to debug issues, as the on-disk file name does not match the
location in the GResource that will be used to print out warnings,
errors, and debugging messages.
2020-03-27 15:20:59 +00:00
Emmanuele Bassi
b1327167e2
Improve GtkShortcutTrigger parsing tests
...
Split off all possible cases into sub-tests, and add more thorough
checks on the invalid strings unit.
2020-03-27 14:56:05 +00:00
Emmanuele Bassi
6719d3044d
Add parsing for GtkAlternativeTrigger
...
Alternative triggers are separate by a pipe character.
2020-03-27 14:35:00 +00:00
Emmanuele Bassi
c75fdda8dd
tests: Add more cases for the trigger parser
2020-03-27 13:57:19 +00:00
Emmanuele Bassi
170e8bd605
Parse keyval name directly for mnemonic triggers
...
We don't need to parse the full accelerator format for mnemonic
triggers.
2020-03-27 13:57:19 +00:00
Emmanuele Bassi
96ccb25f97
Return a full reference when parsing triggers
...
We're not returning a full reference for GtkNeverTrigger, but we are
returning full references for mnemonic and keyval triggers; this means
we're either going to leak mnemonic and keyval triggers if we consider
this function a "transfer none" one, or we are going to trigger an
assertion failure when finalizing a never trigger, if we consider this
function a "transfer full" one.
Let's be consistent, and always return a full reference to the caller.
2020-03-27 13:57:19 +00:00
Timm Bäder
c3c06e60dc
calendar: Only highlight one day as today
...
Fixes #2490
2020-03-27 09:50:30 +01:00
Timm Bäder
ecb8dda309
shortcutscontroller: Make add_shortcut transfer-full
...
Like all the other shortcut api
2020-03-27 08:36:32 +01:00
Timm Bäder
f7975828bc
filechooserwidget: Plug a memory leak
2020-03-27 08:36:32 +01:00
Matthias Clasen
5fdb897f06
Merge branch 'widget-factory-theme' into 'master'
...
widget-factory: Add theme switch
See merge request GNOME/gtk!1573
2020-03-26 18:23:11 +00:00
Matthias Clasen
8ab2e31b58
widget-factory: Add theme switch
...
Add a submenu to test the builtin themes. This is mainly
for the benefit of the artists working on those themes.
2020-03-26 13:51:59 -04:00
Matthias Clasen
0d710b0353
Merge branch 'wip/jimmac/HC-redesign' into 'master'
...
HC: derive from Adwaita
Closes #1450
See merge request GNOME/gtk!1571
2020-03-26 17:24:42 +00:00
Jakub Steiner
06fe4f0205
Adwaita: make insensitive slightly less sensitive
...
- will expose itself even more in HC
2020-03-26 17:22:47 +01:00
Jakub Steiner
910dd7a20a
HC: derive from Adwaita
...
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1450
2020-03-26 17:21:47 +01:00
Jakub Steiner
8d8990ccd7
Revert "Adwaita: make insensitive slightly less sensitive"
...
This reverts commit bf3ccaa1bf
.
2020-03-26 17:19:19 +01:00
Jakub Steiner
bf3ccaa1bf
Adwaita: make insensitive slightly less sensitive
...
- will expose itself even more in HC
2020-03-26 15:55:42 +01:00
Matthias Clasen
eaa20f5cdf
Merge branch 'wip/matthiasc/shortcut-4' into 'master'
...
Shortcuts
See merge request GNOME/gtk!1569
2020-03-26 03:40:22 +00:00
Matthias Clasen
d07e22dc03
Some documentation fixes
2020-03-25 23:14:45 -04:00
Matthias Clasen
1ec2d1d9f1
shortcutmanager: Add some more docs
2020-03-25 23:14:45 -04:00
Matthias Clasen
f59cd392ba
shortcuttrigger: Some documentation fixups
2020-03-25 23:14:45 -04:00
Matthias Clasen
6bacb0b0ae
shortcutaction: Some documentation fixups
2020-03-25 23:14:45 -04:00
Matthias Clasen
530b571d89
shortcutcontroller: Expand the docs
2020-03-25 23:14:45 -04:00
Matthias Clasen
ce22ef18f9
docs: Update the overview input chapter
...
Update the wording around events to reflect current
usage, and add information about shortcuts and the
shortcut controller.
2020-03-25 23:14:45 -04:00
Matthias Clasen
591f6bd7a9
popovermenu: Show mnemonics on keynav
...
This is the expected behavior for menus.
2020-03-25 23:14:45 -04:00
Matthias Clasen
642503afb4
popover: Implement auto mnemonics
...
Unfortunately, this involves copying a bunch of
code from gtkwindow.c. The only difference here
is that we add a private method to turn this off,
which will be used by GtkPopoverMenu to implement
its own auto mnemonics.
2020-03-25 23:14:45 -04:00
Matthias Clasen
fc0b0b14a8
label: Respect GtkPopover::mnemonics-visible
...
When inside a popover, look to the popover for
whether to show mnemonics or not.
2020-03-25 23:14:45 -04:00
Matthias Clasen
2de4fc3ec0
popover: Add a mnemonics-visible property
...
This will be handled separately for popovers, so we
need our own property for it.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b2ac42e576
label: Disconnect visible mnemonics in popovers
...
The controller handling mnemonics is limited to same-native,
so showing mnemonics in other natives.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b19d4b9006
modelbutton: Install accels when inside a popover
...
When a model button in a popover displays a shortcut,
it is probably from the global shortcut controllers,
and will not work inside the popover, since that is
a different native. Install a shortcut using the same
trigger that just activates the model button. This
shortcut will end up in the managed shortcut controller
of the popover.
2020-03-25 23:14:45 -04:00
Matthias Clasen
2c28a0713d
popovermenu: Make mnemonics work without Alt
...
This is expected menu behavior.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b423f974db
shortcutcontroller: Inject accels into the action muxer
...
This is the way model button pic up accels for their actions.
2020-03-25 23:14:45 -04:00
Matthias Clasen
4a430820bd
popover: Implement GtkShortcutManager
...
This makes mnemonics work in popovers.
2020-03-25 23:14:45 -04:00
Matthias Clasen
5153cdc01d
modelbutton: Make activatable
...
This is expected of button-like widgets, and is necessary
to make keynav in popover menus work as expected.
2020-03-25 23:14:45 -04:00
Matthias Clasen
1db5382c6d
modelbutton: Remove accel poking
...
Stop manually poking GtkApplication for accels.
GtkApplication already feeds them into the action
muxer machinery, so that is where will get them.
2020-03-25 23:14:45 -04:00
Emmanuele Bassi
6e8c78714d
Turn GtkShortcutAction into a GObject
...
Just like we did for GtkShortcutTrigger.
This allows language bindings to properly deal with all the actions.
2020-03-25 23:14:45 -04:00
Emmanuele Bassi
457b6657bb
Turn GtkShortcutTrigger into an object
...
The lightweight inheritance mechanism used for GtkShortcutTrigger is not
going to be usable by bindings, because boxed types cannot have derived
types.
We could use GTypeInstance and derive everything from that, like
GParamSpec, but in the end shortcuts are not really a performance
critical paths, unlike CSS values or render nodes.
2020-03-25 23:14:45 -04:00
Emmanuele Bassi
1ddd8586dd
Add definition macro for internal types
...
GTK defines various types that are meant to be derivable only within GTK
itself, and "final" from the perspective of consumers of the GTK API.
The existing macros defined by GObject, such as G_DECLARE_FINAL_TYPE and
G_DECLARE_DERIVABLE_TYPE, lack this functionality.
While we wait for GObject to get this kind of macro, we should define
our own.
2020-03-25 23:14:45 -04:00
Matthias Clasen
5ea45bf57d
widget: Remove some leftover accel group plumbing
...
The ::can-activate-accel and ::accel-closures-changed signals
are not used anymore, remove them.
2020-03-25 23:14:45 -04:00
Matthias Clasen
4e978d6b7a
shortcutcontroller: Only activate shortcuts of visible widgets
...
Our shortcuts are like mnemonics in this respect - they only
activate when the widget is viewable.
2020-03-25 23:14:45 -04:00
Matthias Clasen
b4722b43a1
Drop GtkKeyHash
2020-03-25 23:14:45 -04:00
Matthias Clasen
fd95cc56b1
window: Remove GtkKeyHash remnants
...
It is not used anymore.
2020-03-25 23:14:45 -04:00
Matthias Clasen
d66121c61e
Drop the keyhash test
...
GtkKeyHash is going away.
2020-03-25 23:14:45 -04:00
Matthias Clasen
35332eb3b0
shortcutcontroller: Implement mnemonic cycling
...
Make GtkShortcutController collect matching shortcuts
in the same way GtkKeyHash did (accept fuzzy matches
if we don't have any exact matches), and cycle among
the matches if we have multiple.
2020-03-25 23:14:45 -04:00
Matthias Clasen
586e7749d5
shortcuttrigger: Do elaborate matching for key events
...
Copy the logic from GtkKeyHash for matching key events
to shortcuts.
Adapt shortcuts test to work with the better matching,
by creating more complete key events.
2020-03-25 23:14:45 -04:00
Matthias Clasen
904835d4b1
shortcuttrigger: Introduce partial matches
...
Allow GtkShortcutTrigger to return partial matches.
Currently, no triggers produce such results, and
GtkShortcutController treats partial matches like
exact ones.
2020-03-25 23:14:45 -04:00
Matthias Clasen
cb821d5df3
Add tests for shortcut actions
2020-03-25 23:14:45 -04:00
Matthias Clasen
ff056af249
Add a test for shortcut triggers
2020-03-25 23:14:45 -04:00
Matthias Clasen
9cce474106
widget: Drop the ::popup-menu signal
...
This is now done in widgets which have context
menus.
2020-03-25 23:14:45 -04:00
Matthias Clasen
9d84996fea
placesview: Stop using ::popup-menu
...
This signal is going away.
2020-03-25 23:14:45 -04:00
Matthias Clasen
c2d77a1f37
filechooser: Stop using ::popup-menu
...
This signal is going away.
2020-03-25 23:14:45 -04:00
Matthias Clasen
54a0037c45
mountoperation: Stop using ::popup-menu
...
We can just use a shortcut controller directly.
2020-03-25 23:14:45 -04:00
Matthias Clasen
80b988ef6c
gtk-demo: Stop emitting ::popup-menu
...
The signal was not used anyway, in the font explorer demo.
2020-03-25 23:14:45 -04:00
Matthias Clasen
844801580f
colorchooser: Stop using ::popup-menu
...
This signal is going away. Use an action instead.
2020-03-25 23:14:44 -04:00
Matthias Clasen
28b05eea67
range: Remove ::popup-menu emission
...
This signal is going away, and having context menus
on sliders is not really a thing anyway.
2020-03-25 23:14:44 -04:00
Matthias Clasen
ca1d4322a2
scrollbar: Remove :popup-menu forwarding
...
This signal is going away.
2020-03-25 23:14:44 -04:00
Matthias Clasen
c94ec4a204
emojichooser: Stop using ::popup-menu
...
This signal is going away. Use an action instead.
2020-03-25 23:14:44 -04:00
Matthias Clasen
778d884f70
Use an action for the context menu keybinding
...
The ::popup-menu signal is going away.
2020-03-25 23:14:44 -04:00
Matthias Clasen
e8be45fabc
Print mnemonic triggers clearly
2020-03-25 23:14:44 -04:00
Matthias Clasen
c90b0581dd
inspector: Show shortcuts
...
At a tab that lists the shortcuts contained in a
GtkShortcutController.
2020-03-25 23:14:44 -04:00
Benjamin Otte
43c0ea676d
filechooser: Trigger the location popup via bindings
...
Simplifies code quite a bit.
2020-03-25 23:14:44 -04:00
Benjamin Otte
bb4fbe3d8f
accels: Remove GtkAccelGroup
2020-03-25 23:14:44 -04:00
Benjamin Otte
7c4d8d49b6
testmenubutton: Don't create a GtkAccelGroup
...
It's unused.
2020-03-25 23:14:28 -04:00
Benjamin Otte
cac39526a9
testsuite: Remove GtkAccelGroup usage
2020-03-25 23:14:28 -04:00
Benjamin Otte
4c45410d43
widget: Remove gtk_widget_add_accelerator()
...
People should use shortcut controllers instead (global, capture).
A side effect of this is that GtkAccelLabel now lost its method to
magically look up accelerators to display. Somebody needs to add that
back later.
2020-03-25 23:14:28 -04:00
Benjamin Otte
8e9218df03
doc tools: Create AccelLabel image without using GtkAccelGroup
2020-03-25 23:14:28 -04:00
Emmanuele Bassi
541c478eeb
testgtk: Port keyval example to shortcut controllers
2020-03-25 23:14:28 -04:00
Benjamin Otte
78e3e42042
shortcutcontroller: Implement GtkBuildable
...
Use it to allow adding shortcuts to the controller via the usual <child>
method.
2020-03-25 23:14:28 -04:00
Benjamin Otte
33045c3e0b
shortcutaction: Integrate with GtkBuilder property parsing
...
<property name="action">action(win.quit)</property> style action
specifications now work for GtkShortcutAction properties.
2020-03-25 23:14:28 -04:00
Benjamin Otte
7974751e24
shortcuttrigger: Add gtk_shortcut_triger_new_parse_string()
...
And hook it up into the GtkBuilder infrastructure.
2020-03-25 23:14:28 -04:00
Benjamin Otte
daa7d9072d
application: Replace accelerator handling with shortcuts
...
API remains the same, but activation is now done via a
shortcutcontroller.
The code uses a controller with global scope so that the
shortcuts are managed with all the other global shortcuts.
2020-03-25 23:14:28 -04:00
Benjamin Otte
90a34312d4
accel: Add display arg to gtk_accelerator_parse_with_keycode()
...
It was using the default display unconditionally.
2020-03-25 23:14:28 -04:00
Benjamin Otte
580863b112
accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
...
A parse function should return success or not. So do that.
2020-03-25 23:14:28 -04:00
Benjamin Otte
fb6a8f5fc1
shortcuttrigger: Add hash(), equal(), and compare() functions
...
Those are useful for putting triggers in hash tables or getting sorted
output.
2020-03-25 23:14:28 -04:00
Matthias Clasen
c2e2e2993b
shortcutmanager: Use list models
2020-03-25 23:14:28 -04:00
Matthias Clasen
5763514ab8
shortcutcontroller: Use a list model for shortcuts
2020-03-25 23:14:28 -04:00
Benjamin Otte
4c5d8547be
shortcutaction: Add gtk_shortcut_action_to_string()
...
For all but the callback action, we can print something useful.
2020-03-25 23:14:27 -04:00
Matthias Clasen
34987c0b5c
widget: Only create a controller if we have shortcuts
...
No point in creating objects that just hold empty lists.
2020-03-25 23:14:27 -04:00
Benjamin Otte
3cd4eb0310
widget: Keep keybindings as a GListStore
...
This way, we can use shortcut_controller_new_for_model() and avoid all
the special casing about run_class.
2020-03-25 23:14:27 -04:00
Benjamin Otte
a1e9ae5259
shortcutcontroller: Add gtk_shortcut_controller_new_for_model()
...
This is mainly for internal use, but I can't see a reason to not have it
public for people who want to maintain their own lists.
I'm sure gnome-builder will never ever find a way to misuse it.
2020-03-25 23:14:27 -04:00
Benjamin Otte
e738a4d129
shortcutcontroller: Implement GListModel
...
After all, this controller is a list of shortcuts.
2020-03-25 23:14:27 -04:00
Benjamin Otte
1ec950d14a
gtk-demo: Port the sliding puzzle demo to shortcuts
2020-03-25 23:14:27 -04:00
Benjamin Otte
92e20deca1
shortcut: Change the API for creating shortcuts
...
When creating shortcuts, there almost always are a trigger and an action
available for use. So make gtk_shortcut_new() take those as arguments.
Also add gtk_shortcut_new_with_arguments() so people can easily pass
those in, too.
2020-03-25 23:14:27 -04:00
Benjamin Otte
cd0332aad5
shortcut: Add GtkShortcutAction
...
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.
So far, these different ways are supported:
- do nothing
- Call a user-provided callback
- Call gtk_widget_activate()
- Call gtk_widget_mnemonic_activate()
- Emit an action signal
- Activate an action from the widget's action muxer
2020-03-25 23:14:27 -04:00
Benjamin Otte
cdd33bbee6
accelgroup: Remove unneeded APIs
...
After the removal of GtkAccelMap, these things are no longer necessary.
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
bca1f6b64f
gtk: Remove GtkAccelMap
...
Now that accel paths are gone, the object managing them isn't needed
anymore either.
2020-03-25 23:14:27 -04:00
Benjamin Otte
9b99b89807
gtk: Remove accel paths
...
It's an outdated technology now that everybody is using GActionGroups.
If somebody wanted to support changeable shortcuts, they'd need to
reintroduce it in another way.
2020-03-25 23:14:27 -04:00
Benjamin Otte
62f96bfda6
Remove GtkMnemonicHash
...
It's not used anymore.
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
2c62cde780
window: Remove all old mnemonic handling API
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
aab10ea43b
Add GtkShortcutManager
...
This adds an interface for taking care of shortcut controllers with
managed scope.
Only GtkWindow currently implements this interface, so we need to ensure
that we check if any top-level widget we reach is a shortcuts manager
before we call into it.
2020-03-25 23:14:27 -04:00
Benjamin Otte
9428807c57
label: Implement mnemonics using shortcuts
2020-03-25 23:14:27 -04:00
Benjamin Otte
21e6e4c026
shortcut: Add gtk_shortcut_set_mnemonic_activate()
...
Makes the shortcut call gtk_widget_mnemonic_activate() upon activation.
2020-03-25 23:14:27 -04:00
Benjamin Otte
bde4cbe377
shortcuttrigger: Add support for mnemonics
...
Mnemonics need to be triggered with help from the controllers (who
determine the modifiers). Support for that has been added, too.
Mnemonics do not use this yet though.
2020-03-25 23:14:27 -04:00
Benjamin Otte
0b7e74318b
window: Put F10 accelerator into its own shortcut controller
...
So instead of relying on gtk_window_activate_key(), it's now using
proper infrastructure.
2020-03-25 23:14:27 -04:00
Benjamin Otte
e398f63bf6
window: Get rid of public APIs that shouldn't be
...
Event controllers should have replaced all of them.
And if they haven't, apps need to fix their code (I'm
looking at you Gimp).
2020-03-25 23:14:27 -04:00
Benjamin Otte
2244eeb727
gdk: Remove GDK_RELEASE_MASK
...
It was only ever supported by keybindings and those are gone now.
2020-03-25 23:14:27 -04:00
Benjamin Otte
c3af47f5d9
gtk-demo: Add a dumb demo for shortcut triggers
2020-03-25 23:14:27 -04:00
Benjamin Otte
730154df7d
shortcutcontroller: Add GtkShortcutScope
...
Allow setting the scope for a controller. The scope determines at what
point in event propagation the shortcuts will be activated.
Local scope is the usual activation, global scope means that the root
widget activates the shortcuts - ie they are activated at the very
start of event propagation (for global capture events) or the very end
(for global bubble events).
Managed scope so far is unimplemented.
This is supposed to be used to replace accelerators and mnemonics.
2020-03-25 23:14:27 -04:00
Benjamin Otte
2309e1dd38
shortcuttrigger: Add gtk_shortcut_trigger_to_label()
...
Provide a user-presentable string.
2020-03-25 23:14:27 -04:00
Benjamin Otte
90c7f4608a
accelgroup: Add gtk_accel_group_print_label()
2020-03-25 23:14:27 -04:00
Benjamin Otte
66102dacf1
accellabel: Move gtk_accelerator_get_label() code
...
The function lives in gtkaccelgroup.c, so there's no need to have that
call a private function in another source file. Instead, make that
other source file call gtk_accelerator_get_label() instead.
2020-03-25 23:14:27 -04:00
Benjamin Otte
d84b60e5f9
accellabel: Get rid of class variables
...
We can just look them up as-needed, no need to cache them.
2020-03-25 23:14:27 -04:00
Benjamin Otte
9a03c8b4d8
gtk: Remove bindings
...
The whole binding functionality is now handled by shortcuts.
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
f02521c502
Remove bindings activation from GtkEventControllerKey
...
We're going to use shortcuts soon.
2020-03-25 22:36:03 -04:00
Matthias Clasen
c1247a7993
popover: Add keynav keybindings
...
The shortcut controllers are limited to same-native,
so we need to duplicate the Tab and arrow key bindings
for focus handling, as well as the Enter bindings for
activation.
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
b2a747b4d4
popovermenu: Port to shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
c1ee2fd54a
accelgroup: Actually have a default mod mask
...
Don't just use a value without initializing it.
2020-03-25 22:36:03 -04:00
Benjamin Otte
4c7b00fd20
treeview: Redo event forwarding hack
...
Reorder the event controllers so that key forwarding to the search
entries really happens after shortcut triggering.
2020-03-25 22:36:03 -04:00
Benjamin Otte
3fba7f9dce
combobox: Redo key event forwarding hack
...
Instead of manualling invoking bindings, we now reorder event
controllers inside the treemenu, so that shortcuts run before the event
forwarding.
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
7ca4a94768
widget: Add private accessor to event controllers
2020-03-25 22:36:03 -04:00
Benjamin Otte
1df0a5eab5
iconview: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6a005c815e
infobar: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
cb09211ace
label: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
e430e0e2ff
listbox: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6ad1078595
notebook: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
cd7e9dcc27
scale: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
8752f613d7
scalebutton: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
f54d3a3aca
scrolledwindow: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
db525ef213
searchentry: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
3f00e42ec9
shortcutssection: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
d5fa5b9594
shortcutswindow: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
2e5fc35e51
flowbox: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6ff94f3637
paned: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
80888d7111
spinbutton: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
48b46c8d08
textview: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
df457cadfc
filechooserwidget: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
58e8f2332d
shortcutcontroller: Add gtk_shortcut_controller_add_shortcut()
...
... and gtk_shortcut_controller_remove_shortcut().
2020-03-25 22:36:03 -04:00
Benjamin Otte
376dc4d169
shortcutcontroller: Add private API for running class shortcuts
...
We don't want regular users to be able to run class shortcuts in their
controllers, so we have to special case that.
2020-03-25 22:36:03 -04:00
Benjamin Otte
dfd81f9c64
treeview: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6d418134ee
widget: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
02646d74f4
dialog: Port binding to use shortcuts
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
d62be573ad
text: Port to widget shortcuts
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
17eef48835
Allow installing bindings bound to actions
...
This is just convenience code around GtkShortcut, just like bindings for
signal emission and callback invocation.
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
7ffea02eb4
shortcut: Add action activation
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
0b75edc0e1
bindings: Export action activation internally
...
We're going to use it, just like we use the signal emission code.
2020-03-25 22:36:03 -04:00
Benjamin Otte
d4bba7de88
shortcut: Add gtk_shortcut_set_callback()
...
... and gtk_widget_class_add_binding() to go with it.
This allows shortcuts to invoke manually added callbacks.
2020-03-25 22:36:03 -04:00
Benjamin Otte
a8902da4bc
assistant: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
8ff18b3d39
combobox: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
81fa63260e
trigger: Add an alternative trigger
...
And use it.
I just added it to GtkWidget just to show that I can.
The real reason I want it is for gamepad/joystick triggers
in games, so that it becomes possible to select 2 different
triggers (gamepad and keyboard) for the same shortcut.
2020-03-25 22:36:03 -04:00
Matthias Clasen
6d452f1eb8
shortcut: Add GtkShortcutTrigger
...
Triggers are meant to describe how to trigger a shortcut.
So far only a keyval + modifiers trigger exists.
2020-03-25 22:36:03 -04:00
Benjamin Otte
d51b8ff058
window: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
b11263ae91
bindings: Add more variant types
...
Also marshal types that the code in gtkbindings.c doesn't use. These
will be used by gtk_widget_class_add_binding_signal().
2020-03-25 22:36:03 -04:00
Benjamin Otte
0eb1228902
widget: Add gtk_widget_class_add_shortcut()
...
This allows adding shortcuts as a replacement for keybindings.
2020-03-25 22:36:03 -04:00
Benjamin Otte
d8603864a9
gtk: Add GtkShortcut
...
This is the base class for what is about to take over all sorts of
keyboard shortcuts. The initial version barely deals with keybindings.
2020-03-25 22:36:03 -04:00
Benjamin Otte
f9ee703af4
bindings: Split out function to invoke an action signal
...
We want to use that in shortcuts later.
2020-03-25 22:36:03 -04:00
Benjamin Otte
a232107122
shortcutcontroller: Introduce
...
This is a very barebones controller that currently does nothing but
activate the binding signals. Yay.
And because we have bindings on every widget (Yes, a GtkGrid has a
keybinding - 2 in fact), we need that controller everywhere.
2020-03-25 22:36:03 -04:00
Benjamin Otte
27834b04ae
bindings: Make gtk_binding_parse_signal() use GVariantBuilder
...
And because it's the last user of GtkBindingArg and
gtk_binding_entry_add_signall(), also remove those two.
2020-03-25 22:36:03 -04:00
Benjamin Otte
cbe207a8de
bindings: Parse into GVariantBuilder directly
...
Avoids the indirection via GtkBindingArg
2020-03-25 22:36:03 -04:00
Benjamin Otte
1cab5e03ca
bindings: Add gtk_binding_entry_add_signal_variant()
...
This function is the replacement for
gtk_binding_entry_add_signall().
The GVariant will be demarshalled and passed to the action signal upon
binding activation. The same rules apply as used to apply for
GtkBindingArg, in that long, double and string args are now replaced by
"x", "d" and "s" variant types.
2020-03-25 22:36:03 -04:00
Benjamin Otte
f8c523fa72
bindings: Replace GtkBindingArg arguments with GVariant
...
So far, this only replaces invocation, not yet parsing.
2020-03-25 22:36:03 -04:00
Matthias Clasen
e17db0abde
Merge branch 'matthiasc/for-master2' into 'master'
...
Matthiasc/for master2
See merge request GNOME/gtk!1568
2020-03-26 02:30:54 +00:00
Matthias Clasen
cc9c45a47a
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1567
2020-03-26 01:54:30 +00:00
Emmanuele Bassi
a9c3a33620
passwordentry: Remove unused include
2020-03-25 21:53:12 -04:00
Emmanuele Bassi
f61d520ab1
entry: Remove unused include
2020-03-25 21:53:06 -04:00
Matthias Clasen
7672e6c833
text view: Fix touch selection
...
We forgot to allocated that popover.
2020-03-25 18:48:01 -04:00
Matthias Clasen
faf61cd112
event controller focus: drop include
...
This header is not needed here, and it is going away.
2020-03-25 18:47:54 -04:00
Matthias Clasen
1308ecb0ae
flattenlistmodel: Give access to child models
...
Add an api to retrieve the model containing a given
item in a flatten listmodel. This is useful when the
individual items in the list don't have backpointers.
2020-03-25 18:47:46 -04:00
Matthias Clasen
4f6096947e
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1565
2020-03-25 21:48:38 +00:00
Matthias Clasen
dc18572a59
Merge branch 'wip/chergert/muxer-robustness-fix' into 'master'
...
muxer: force muxer dispoal as part of widget dispose
See merge request GNOME/gtk!1564
2020-03-25 21:34:56 +00:00
Matthias Clasen
8493ebfe98
filechoosererrorstack: Fix object life-cycle
...
Unparent children in dispose, not in finalize.
2020-03-25 17:04:29 -04:00
Matthias Clasen
5870d9d72a
testsuite: Set NO_AT_BRIDGE for gtk tests
...
The a11y stack insists on spewing hard to control warnings
that make our tests fail. So, no accessibility for gtk tests :(
2020-03-25 17:03:58 -04:00
Christian Hergert
b5b836668a
muxer: force muxer dispoal as part of widget dispose
...
We need to cleanup state here immediately so that we do not potentially
access the g_class private data after it been finalized. This ensures that
the borrowed reference is dropped by the muxer.
2020-03-25 14:02:59 -07:00
Timm Bäder
c155ac98c8
Merge branch 'wip/sadiq/fix-leak' into 'master'
...
singleselection: Fix a memory leak
See merge request GNOME/gtk!1554
2020-03-25 09:13:50 +00:00
Timm Bäder
600952e295
magnifier: Don't try to use a null widget paintable
...
We destroy the paintable in dispose, which can be called multiple times.
2020-03-24 10:44:06 +01:00
Timm Bäder
3b2adf5d1f
inspector: Fix child widget life cycle
...
unparent them in dispose
2020-03-24 10:44:06 +01:00
Timm Bäder
56d99ab5cd
Merge branch 'patch-2' into 'master'
...
gtkfilechoosernative: Remove duplicate "the" in the documentation
See merge request GNOME/gtk!1557
2020-03-24 06:08:26 +00:00
LingMan
29c9776daa
gtkfilechoosernative: Remove duplicate "the" in the documentation
2020-03-24 04:58:13 +00:00
Marc-Antoine Perennou
eb8e0910c3
testsuite/gtk/flattenlistmodel.c: fix build
...
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com >
2020-03-22 10:53:59 +01:00
Mohammed Sadiq
cfc44e09a0
singleselection: Fix a memory leak
2020-03-22 14:05:56 +05:30
Matthias Clasen
92b50c5e2a
3.98.1
2020-03-21 21:44:23 -04:00
Matthias Clasen
dabd09bc42
a11y: Don't re turn uninitialized memory
...
For some reason, this was now showing up in the
a11y tests as random image sizes in the about
dialog test.
2020-03-21 21:44:23 -04:00
Matthias Clasen
d7e5f5b368
Merge branch 'filechooser-popover-fixes' into 'master'
...
Filechooser popover fixes
See merge request GNOME/gtk!1553
2020-03-22 00:40:15 +00:00
Matthias Clasen
95209290c4
file chooser: Fix the rename file popover
...
Make this popover work again by attaching it
to the file chooser itself.
2020-03-21 20:14:23 -04:00
Matthias Clasen
90197240d3
filechooser: Fix the file list popover
...
Make this popover work again.
2020-03-21 20:00:15 -04:00
Matthias Clasen
6555a2f661
filechooser: Fix the new folder popover
...
We were listening for change notification on a
no-longer-existing property.
2020-03-21 19:32:08 -04:00
Matthias Clasen
a197b202b8
places sidebar: Fix the popovers
...
We need to check-resize the popovers.
2020-03-21 18:28:57 -04:00
Matthias Clasen
84e58aa393
Merge branch 'portal-dir-chooser' into 'master'
...
filechoosernativeportal: Allowing selecting folder(s)
See merge request GNOME/gtk!1552
2020-03-21 20:29:11 +00:00
Bastien Nocera
e99d1605dc
filechoosernativeportal: Allowing selecting folder(s)
...
Use the "directory" portal option when asked to select folders.
2020-03-21 15:46:05 -04:00
Matthias Clasen
bf988f8d07
Merge branch 'portal-chooser-fail' into 'master'
...
portal file chooser: Handle errors
Closes #2527
See merge request GNOME/gtk!1551
2020-03-21 18:34:07 +00:00
Matthias Clasen
245851a6bb
portal file chooser: Handle errors
...
Fall back to showing a local file chooser
if we get DBus errors from the portal.
Closes : #2527
2020-03-21 13:16:43 -04:00
Matthias Clasen
bb3dc16680
Merge branch 'fix-inspector-picking' into 'master'
...
inspector: Make picking work again
Closes #2528
See merge request GNOME/gtk!1549
2020-03-21 16:21:51 +00:00
Matthias Clasen
fceac594ae
Merge branch 'fix-inspector-key' into 'master'
...
x11: Fix key event state translation
See merge request GNOME/gtk!1550
2020-03-21 14:47:29 +00:00
Matthias Clasen
abeabc39e8
x11: Fix key event state translation
...
In the event refactoring, a bit was lost.
This makes Ctrl-Shift-i work again to open
the inspector.
2020-03-21 10:26:11 -04:00
Matthias Clasen
fd58b116cf
inspector: Make picking work again
...
We used to either make the inspector see- and click-thru
or lower it, but sadly translucency broke after we
removed surface opacity, and lowering doesn't work
on Wayland. So just hide the inspector window while
we are picking.
Fixes : #2528
2020-03-21 09:42:58 -04:00
Matthias Clasen
a67893fe5a
Merge branch 'new-text-attributes' into 'master'
...
New text attributes
See merge request GNOME/gtk!1547
2020-03-21 05:56:22 +00:00
Matthias Clasen
9259efb5d7
Make overline support conditional
...
The ci image does not have Pango 1.45, so for the
time being, make the overline support conditional
on Pango being new enough.
2020-03-21 01:18:54 -04:00
Matthias Clasen
72f06abd13
Require pango 1.44.4
...
This lets use use the insert-hyphen attribute
unconditionally.
2020-03-21 00:39:17 -04:00
Matthias Clasen
923a245a80
gtk-demo: Add hyphenation control to the markup demo
2020-03-20 23:58:33 -04:00
Matthias Clasen
38f1dbaba3
gtk-demo: Allow word breaking in the markup demo
...
We want to show hyphenation control here.
2020-03-20 23:58:33 -04:00
Matthias Clasen
795ef5b4e3
textbuffer: Parse overline and hyphenation attributes
...
When inserting Pango markup into a text buffer, translate
Pango attributes for overlines and hyphenation control
into the corresponding text tag properties.
2020-03-20 23:58:23 -04:00
Matthias Clasen
fd9c911c3a
textlayout: Handle new text tag properties
...
Translate tag properties for overlines and
hyphenation control into Pango attributes.
2020-03-20 23:58:23 -04:00
Matthias Clasen
a8c6ae6085
texttag: Support overline and hyphenation control
...
Add support for recently added Pango attributes
for overlines and hyphenation control. The new
properties of GtkTextTag are
overline, overline-rgba, allow-breaks, show-spaces
and insert-hyphens.
2020-03-20 23:58:23 -04:00
Carlos Garnacho
28e7a0a565
Merge branch 'master_MR1290' into 'master'
...
Copy of !1290 for master
Closes #2365
See merge request GNOME/gtk!1546
2020-03-20 20:20:41 +00:00
Matthias Clasen
7088bd18e6
Merge branch 'wip/chergert/fix-class-private-data-usage' into 'master'
...
Fix GtkWidgetClassPrivate data usage
See merge request GNOME/gtk!1545
2020-03-20 18:49:58 +00:00
Christian Hergert
ccac404f28
widget: fix class private data usage to be _init() safe
...
Before this commit, adding GtkWidgetAction to class private data would
require copying the actions to each subclass as they were built or
modified. This was convenient in that it is a sort of "copy on write"
semantic.
However, due to the way that GTypeInstance works with base _init()
functions, the "g_class" pointer in GTypeInstance is updated as each
_init() function is called. That means you cannot access the subclasses
class private data, but only the parent class private data.
If instead we use a singly linked list of GtkWidgetAction, each subclass
has their own "head" yet all subclasses share the tail of the
GtkWidgetAction chain.
This creates one bit of complexity though. You need a stable way to know
which "bit" is the "enabled" bit of the action so we can track enabled
GAction state. That is easily solved by calculating the distance to the
end of the chain for a given action so that base classes sort ahead of
subclasses. Since the parent class always knows its parent's actions, the
position is stable.
A new dynamic bitarray helper also helps us avoid allocations in all the
current cases (up to 64 actions per widget) and dynamically switches to
malloc if that is to ever be exceeded.
2020-03-20 11:17:56 -07:00
Christian Hergert
6822dce8fb
widget: move class private data to gtkwidgetprivate.h
...
We want access to the private data from the action muxer so we can just
move the structures to the gtkwidgetprivate.h header. Alternatively we
could create accessors, but given that we'll probably need to use this
in other areas, seems reasonable to just put it there.
2020-03-20 11:17:56 -07:00
Matthias Clasen
5b2cdad19e
Merge branch 'test-protocol' into 'master'
...
Test protocol: TAP
See merge request GNOME/gtk!1543
2020-03-20 18:12:09 +00:00
Matthias Clasen
c7caa53917
testsuite: disable performance tests
...
For some reason, these tests are flaky in ci,
they always work locally for me. So, until
we use the data these tests produce for something,
lets just turn them off.
2020-03-20 13:47:58 -04:00
Matthias Clasen
fa4be719d8
Merge branch 'wip/carlosg/text-handle-natives' into 'master'
...
Make text handles use native surfaces
See merge request GNOME/gtk!1487
2020-03-20 17:29:17 +00:00
Alexandr Miloslavskiy
32f088e335
gkimmulticontext: Fix crash due to leaked signal handler
...
The problem is caused by gtk_im_multicontext_set_slave(), which forgets
to disconnect these signal handlers:
* gtk_im_multicontext_retrieve_surrounding_cb
* gtk_im_multicontext_delete_surrounding_cb
If slave GtkImContext emits signal after GtkIMMulticontext context is
destroyed, this leads to reading freed memory, sometimes causing a crash.
Fixes : #2365
2020-03-20 18:02:22 +01:00
Emmanuele Bassi
cb81e3ee47
Merge branch 'ci-dbus-launch' into 'master'
...
ci: Add dbus-launch to the Docker build
See merge request GNOME/gtk!1544
2020-03-20 16:13:07 +00:00
Matthias Clasen
9eda683060
testsuite: Fix an a11y test
...
The derive test wasn't producing TAP, so
running it as part of a tap testsuite wasn't
going well. Fix that.
2020-03-20 12:09:21 -04:00
Matthias Clasen
cbb0ca4902
testsuite: Tell meson we use TAP
...
This makes meson actually parse the individual test
results. Most of the time, it does not make a difference,
but one case where it does is when all the individual
tests of a binary are skipped, meson will mark the
test as skipped.
2020-03-20 11:55:26 -04:00
Matthias Clasen
9403f44aef
reftests: Fix an xfail to work
...
The background-image-multiple.ref.ui file uses
non-existing properties, which gives us a g_warning,
and the glib test framework insists on treating
warnings as fatal, so we end up doing exit(133),
which in turn makes the meson TAP parser ignore
its xfails.
Comment out the nonexisting properties, so we can
fail properly, and then in turn xfail properly.
2020-03-20 11:55:26 -04:00
Matthias Clasen
dc4b7131f1
testsuite: Don't exit unsuccessfully when using TAP
...
The meson TAP parser doesn't take this lightly and
forgets all about xfails when we exit(1), so don't.
2020-03-20 11:55:26 -04:00
Emmanuele Bassi
bf6087f2da
ci: Add dbus-launch to the Docker build
2020-03-20 15:36:39 +00:00
Carlos Garnacho
23f03ca1f2
gtktextview: Set magnifier popover on top
...
At the bottom, it sometimes has to fight for the same position than
text handles, besides might not be ergonomically convenient (eg.
finger/hand partly covering the popover). Move it at the top to fix
both.
2020-03-20 15:52:19 +01:00
Carlos Garnacho
54a4a18bcf
gtktext: Set magnifier popover on top
...
At the bottom, it sometimes has to fight for the same position than
text handles, besides might not be ergonomically convenient (eg.
finger/hand partly covering the popover). Move it at the top to fix
both.
2020-03-20 15:52:19 +01:00
Carlos Garnacho
9a0b70fc84
gtkpopover: Re-present surface if position/pointing-to change while visible
...
This ensures the popover will follow the new position parameters. This is
necessary for popovers like the text magnifier that can be repositioned
while visible.
2020-03-20 15:52:19 +01:00
Carlos Garnacho
6431bdcf91
gtkpopover: Ensure the pointed to rectangle has a minimum w/h
...
On wayland, protocol errors will be raised if the rectangle width/height
are 0. Avoid that situation so it's valid to all popovers.
2020-03-20 15:52:19 +01:00
Carlos Garnacho
0f73e83f44
gtkwindow: Remove internal popover API
...
This was only used by text handles, and not anymore.
2020-03-20 15:52:19 +01:00
Carlos Garnacho
0264a64f29
gtktexthandle: Refactor and use native surfaces
...
Instead of being a GObject managing two GtkWidgets, make GtkTextHandle
a GtkWidget subclass, representing a single handle.
From the perspective of users (GtkText and GtkTextView), this is not a
big leap since they have to be aware of a great deal of text handles'
state. It actually makes things more direct and simple.
With text handles being widgets, those can be actual children of the
widget, and may have their own GdkSurface that we move around at will.
This is the second major aspect of this refactor.
2020-03-20 15:52:19 +01:00
Matthias Clasen
c893f79023
reftests: Don't run tests with --verbose
...
Unexpected output tends to break TAP.
2020-03-20 10:43:25 -04:00
Matthias Clasen
68e1c8d3e9
gsk: Don't unconditionally spew to stdout
2020-03-20 10:43:25 -04:00
Matthias Clasen
cf7dc5b2bb
testsuite: Don't g_print from tests
...
This breaks the TAP output.
2020-03-20 10:03:04 -04:00
Matthias Clasen
068ec58287
testsuite: Fix the accessible test
...
This test was happily doing nothing.
2020-03-20 10:03:04 -04:00
Matthias Clasen
2747dd5c9f
Merge branch 'disable-window-test-2' into 'master'
...
Disable window test 2
See merge request GNOME/gtk!1541
2020-03-20 13:42:38 +00:00
Matthias Clasen
f6fc3073fb
temporarily disable window test
...
This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.
2020-03-19 18:08:06 -04:00
Matthias Clasen
31db615885
Revert "Merge branch 'disable-window-test' into 'master'"
...
This reverts commit 3ac4c76b18
, reversing
changes made to 6ec96d2e98
.
2020-03-19 18:03:16 -04:00
Matthias Clasen
3ac4c76b18
Merge branch 'disable-window-test' into 'master'
...
Disable window test
See merge request GNOME/gtk!1540
2020-03-19 19:35:42 +00:00
Matthias Clasen
89b537bd8a
Fix the action test
...
We have a test that enumerates the GtkText actions,
so when a new open appears, the test needs to be updated.
2020-03-19 14:29:37 -04:00
Matthias Clasen
7d5cfcf61d
Fix a compiler warning
2020-03-19 14:13:26 -04:00
Matthias Clasen
2e70b4c323
temporarily disable window test
...
This test was broken by the GdkToplevel refactoring,
and needs a big gtkwindow.c configure request cleanup
before it will work again.
2020-03-19 11:25:38 -04:00
Matthias Clasen
fcab0943bf
text view: Fix touch selection
...
We forgot to allocated that popover.
2020-03-19 09:46:53 -04:00
Matthias Clasen
c8fd6407a8
widget: Drop the ::popup-menu signal
...
This is now done in widgets which have context
menus.
2020-03-19 00:56:46 -04:00
Matthias Clasen
53f29ba427
placesview: Stop using ::popup-menu
...
This signal is going away.
2020-03-19 00:54:23 -04:00
Matthias Clasen
eb3f4b302f
filechooser: Stop using ::popup-menu
...
This signal is going away.
2020-03-19 00:24:53 -04:00
Matthias Clasen
59df45f3f7
mountoperation: Stop using ::popup-menu
...
We can just use a shortcut controller directly.
2020-03-18 23:00:51 -04:00
Matthias Clasen
98011e6273
gtk-demo: Stop emitting ::popup-menu
...
The signal was not used anyway, in the font explorer demo.
2020-03-18 23:00:51 -04:00
Matthias Clasen
f40965cc40
colorchooser: Stop using ::popup-menu
...
This signal is going away. Use an action instead.
2020-03-18 23:00:51 -04:00
Matthias Clasen
ab9b094f80
range: Remove ::popup-menu emission
...
This signal is going away, and having context menus
on sliders is not really a thing anyway.
2020-03-18 23:00:51 -04:00
Matthias Clasen
4bc60c6110
scrollbar: Remove :popup-menu forwarding
...
This signal is going away.
2020-03-18 23:00:51 -04:00
Matthias Clasen
48ace13635
emojichooser: Stop using ::popup-menu
...
This signal is going away. Use an action instead.
2020-03-18 23:00:51 -04:00
Matthias Clasen
908d996b4f
Use an action for the context menu keybinding
...
The ::popup-menu signal is going away.
2020-03-18 23:00:51 -04:00
Matthias Clasen
4e263b4042
Print mnemonic triggers clearly
2020-03-18 23:00:51 -04:00
Matthias Clasen
f5134a833c
inspector: Show shortcuts
...
At a tab that lists the shortcuts contained in a
GtkShortcutController.
2020-03-18 23:00:51 -04:00
Matthias Clasen
f7021e80a7
Only create a class shortcut controller if we have shortcuts
...
No point in creating objects that just hold empty lists.
2020-03-18 23:00:51 -04:00
Matthias Clasen
3e7d49a8d3
widget: Name the controllers
2020-03-18 23:00:51 -04:00
Matthias Clasen
5a6533d8fb
window: Name the the controllers
2020-03-18 23:00:51 -04:00
Matthias Clasen
5a6a9dc149
shortcutmanager: Name the controllers
...
This is helpful in the inspector.
2020-03-18 23:00:51 -04:00
Matthias Clasen
ad69899a9d
Move shortcut manager initialization code
...
It is just too ugly to use quarks across multiple
source files, so add a private helper function that
attaches the controllers.
2020-03-18 23:00:51 -04:00
Benjamin Otte
3cf56817e7
filechooser: Trigger the location popup via bindings
...
Simplifies code quite a bit.
2020-03-18 23:00:51 -04:00
Benjamin Otte
ff6df33b6a
accels: Remove GtkAccelGroup
2020-03-18 23:00:51 -04:00
Benjamin Otte
e944514664
testmenubutton: Don't create a GtkAccelGroup
...
It's unused.
2020-03-18 23:00:51 -04:00
Benjamin Otte
93bb3f7144
testsuite: Remove GtkAccelGroup usage
2020-03-18 23:00:51 -04:00
Benjamin Otte
17d9ba362c
widget: Remove gtk_widget_add_accelerator()
...
People should use shortcut controllers instead (global, capture).
A side effect of this is that GtkAccelLabel now lost its method to
magically look up accelerators to display. Somebody needs to add that
back later.
2020-03-18 23:00:51 -04:00
Benjamin Otte
b685d2c00a
doc tools: Create AccelLabel image without using GtkAccelGroup
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
1a55f59f23
testgtk: Port keyval example to shortcut controllers
2020-03-18 23:00:51 -04:00
Benjamin Otte
29ced09dc4
shortcutcontroller: Implement GtkBuildable
...
Use it to allow adding shortcuts to the controller via the usual <child>
method.
2020-03-18 23:00:51 -04:00
Benjamin Otte
458fcba457
shortcutaction: INtegrate with GtkBuilder property parsing
...
<property name="action">action(win.quit)</property> style action
specifications now work for GtkShortcutAction properties.
2020-03-18 23:00:51 -04:00
Benjamin Otte
5218dd6a34
shortcuttrigger: Add gtk_shortcut_triger_new_parse_string()
...
And hook it up into the GtkBuilder infrastructure.
2020-03-18 23:00:51 -04:00
Benjamin Otte
df792a088d
application: Replace accelerator handling with shortcuts
...
API remains the same, but activation is now done via a
shortcutcontroller.
The code uses a controller with global scope so that the
shortcuts are managed with all the other global shortcuts.
2020-03-18 23:00:51 -04:00
Benjamin Otte
94ef20ea36
accel: Add display arg to gtk_accelerator_parse_with_keycode()
...
It was using the default display unconditionally.
2020-03-18 23:00:51 -04:00
Benjamin Otte
87df17e4ce
accelerators: Make gtk_accelerator_parse() return TRUE/FALSE
...
A parse function should return success or not. So do that.
2020-03-18 23:00:51 -04:00
Benjamin Otte
673a0463e0
shortcuttrigger: Add hash(), equal(), and compare() functions
...
Those are useful for putting triggers in hash tables or getting sorted
output.
2020-03-18 23:00:51 -04:00
Benjamin Otte
0c81698911
shortcuts: Mananage managed shortcuts with a custom model
...
Reduce the amount of special casing by using a list model
for global and managed shortcuts, too.
This way, the ListModel API will work for the ShortcutController in the
GtkShortcutManager and GtkRoot.
The only special case remaining is shortcut activation, which needs to
pass the right widget to the controller in the global/managed case.
2020-03-18 23:00:51 -04:00
Benjamin Otte
a10a295515
shortcutaction: Add gtk_shortcut_action_to_string()
...
For all but the callback action, we can print something useful.
2020-03-18 23:00:51 -04:00
Benjamin Otte
3b595f5720
widget: Keep keybindings as a GListStore
...
This way, we can use shortcut_controller_new_for_model() and avoid all
the special casing about run_class.
2020-03-18 23:00:51 -04:00
Benjamin Otte
d14807b93d
shortcutcontroller: Add gtk_shortcut_controller_new_for_model()
...
This is mainly for internal use, but I can't see a reason to not have it
public for people who want to maintain their own lists.
I'm sure gnome-builder will never ever find a way to misuse it.
2020-03-18 23:00:51 -04:00
Benjamin Otte
538a1a0461
shortcutcontroller: Implement GListModel
...
After all, this controller is a list of shortcuts.
2020-03-18 23:00:51 -04:00
Benjamin Otte
067bd7019c
gtk-demo: Port the sliding puzzle demo to shortcuts
2020-03-18 23:00:51 -04:00
Benjamin Otte
4a4bfa0766
shortcut: Change the API for creating shortcuts
...
When creating shortcuts, there almost always are a trigger and an action
available for use. So make gtk_shortcut_new() take those as arguments.
Also add gtk_shortcut_new_with_arguments() so people can easily pass
those in, too.
2020-03-18 23:00:51 -04:00
Benjamin Otte
e6d0560a82
shortcut: Add GtkShortcutAction
...
Similar to GtkShortcutTrigger, GtkShortCutAction provides all the
different ways to activate a shortcut.
So far, these different ways are supported:
- do nothing
- Call a user-provided callback
- Call gtk_widget_activate()
- Call gtk_widget_mnemonic_activate()
- Emit an action signal
- Activate an action from the widget's action muxer
- Activate a GAction
2020-03-18 23:00:51 -04:00
Benjamin Otte
4d0bab0c24
accelgroup: Remove unneeded APIs
...
After the removal of GtkAccelMap, these things are no longer necessary.
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
b28da74e90
gtk: Remove GtkAccelMap
...
Now that accel paths are gone, the object managing them isn't needed
anymore either.
2020-03-18 23:00:51 -04:00
Benjamin Otte
ba3882de83
gtk: Remove accel paths
...
It's an outdated technology now that everybody is using GActionGroups.
If somebody wanted to support changeable shortcuts, they'd need to
reintroduce it in another way.
2020-03-18 23:00:51 -04:00
Benjamin Otte
20cfa2e280
Remove GtkMnemonicHash
...
It's not used anymore.
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
a977094e18
window: Remove all old mnemonic handling API
2020-03-18 23:00:51 -04:00
Emmanuele Bassi
09400b6bfe
Add GtkShortcutManager
...
This adds an interface for taking care of shortcut controllers with
managed scope.
Only GtkWindow currently implements this interface, so we need to ensure
that we check if any top-level widget we reach is a shortcuts manager
before we call into it.
2020-03-18 23:00:50 -04:00
Benjamin Otte
bbe98d9f7c
label: Implement mnemonics using shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
ab681b0e05
shortcut: Add gtk_shortcut_set_mnemonic_activate()
...
Makes the shortcut call gtk_widget_mnemonic_activate() upon activation.
2020-03-18 23:00:50 -04:00
Benjamin Otte
ef40f22632
shortcuttrigger: Add support for mnemonics
...
Mnemonics need to be triggered with help from the controllers (who
determine the modifiers). Support for that has been added, too.
Mnemonics do not use this yet though.
2020-03-18 23:00:50 -04:00
Benjamin Otte
bea2dcef8f
window: Put F10 accelerator into its own shortcut controller
...
So instead of relying on gtk_window_activate_key(), it's now using
proper infrastructure.
2020-03-18 23:00:50 -04:00
Benjamin Otte
cc13b47542
window: Get rid of public APIs that shouldn't be
...
Event controllers should have replaced all of them.
And if they haven't, apps need to fix their code (I'm
looking at you Gimp).
2020-03-18 23:00:50 -04:00
Benjamin Otte
8c23ccd86e
gdk: Remove GDK_RELEASE_MASK
...
It was only ever supported by keybindings and those are gone now.
2020-03-18 23:00:50 -04:00
Benjamin Otte
662a8a2885
gtk-demo: Add a dumb demo for shortcut triggers
2020-03-18 23:00:50 -04:00
Benjamin Otte
d4127fe0d4
shortcutcontroller: Add GtkShortcutScope
...
Allow setting the scope for a controller. The scope determines at what
point in event propagation the shortcuts will be activated.
Local scope is the usual activation, global scope means that the root
widget activates the shortcuts - ie they are activated at the very
start of event propagation (for global capture events) or the very end
(for global bubble events).
Managed scope so far is unimplemented.
This is supposed to be used to replace accelerators and mnemonics.
2020-03-18 23:00:50 -04:00
Benjamin Otte
22801f0d4d
shortcuttrigger: Add gtk_shortcut_trigger_to_label()
...
Provide a user-presentable string.
2020-03-18 23:00:50 -04:00
Benjamin Otte
e050288d07
accelgroup: Add gtk_accel_group_print_label()
2020-03-18 23:00:50 -04:00
Benjamin Otte
93af53a2fc
accellabel: Move gtk_accelerator_get_label() code
...
The function lives in gtkaccelgroup.c, so there's no need to have that
call a private function in another source file. Instead, make that
other source file call gtk_accelerator_get_label() instead.
2020-03-18 23:00:50 -04:00
Benjamin Otte
e2a0ed4fcb
accellabel: Get rid of class variables
...
We can just look them up as-needed, no need to cache them.
2020-03-18 23:00:50 -04:00
Benjamin Otte
fb99f834e6
gtk: Remove bindings
...
The whole binding functionality is now handled by shortcuts.
2020-03-18 23:00:50 -04:00
Matthias Clasen
a062b96051
event controller focus: drop include
...
This header is not needed here, and it is going away.
2020-03-18 23:00:50 -04:00
Emmanuele Bassi
5033fc62f2
Remove bindings activation from GtkEventControllerKey
...
We're going to use shortcuts soon.
2020-03-18 23:00:50 -04:00
Emmanuele Bassi
bdde072c06
popover: Remove unused include
2020-03-18 23:00:50 -04:00
Matthias Clasen
f7a4d968e9
popover: Add keynav keybindings
...
The shortcut controllers are limited to same-native,
so we need to duplicate the Tab and arrow key bindings
for focus handling, as well as the Enter bindings for
activation.
2020-03-18 23:00:50 -04:00
Emmanuele Bassi
252030ba59
popovermenu: Port to shortcuts
2020-03-18 23:00:50 -04:00
Emmanuele Bassi
f24cf29326
passwordentry: Remove unused include
2020-03-18 23:00:50 -04:00
Emmanuele Bassi
9b1d593967
entry: Remove unused include
2020-03-18 23:00:50 -04:00
Benjamin Otte
4e3ac8f52b
accelgroup: Actually have a default mod mask
...
Don't just use a value without initializing it.
2020-03-18 23:00:50 -04:00
Benjamin Otte
7f10641fd9
treeview: Redo event forwarding hack
...
Reorder the event controllers so that key forwarding to the search
entries really happens after shortcut triggering.
2020-03-18 23:00:50 -04:00
Benjamin Otte
3ef6be0d25
combobox: Redo key event forwarding hack
...
Instead of manualling invoking bindings, we now reorder event
controllers inside the treemenu, so that shortcuts run before the event
forwarding.
2020-03-18 23:00:50 -04:00
Emmanuele Bassi
56595e7529
widget: Add private accessor to event controllers
2020-03-18 23:00:50 -04:00
Benjamin Otte
4b798e238f
iconview: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
718faf68ac
infobar: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
83dc9dabed
label: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
051f7e4118
listbox: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
cbeb096bb3
notebook: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
bf7c51cc11
scale: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
3803209330
scalebutton: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
fb7d1095d1
scrolledwindow: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
45ec453b76
searchentry: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
e4d628b410
shortcutssection: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
e11d799460
shortcutswindow: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
6e38af4429
flowbox: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
a70635f760
paned: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
2c91f15f6d
spinbutton: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
bad5ee7ed9
textview: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
277aaab041
filechooserwidget: Port bindings to use shortcuts
2020-03-18 23:00:50 -04:00
Benjamin Otte
5ade831cd1
shortcutcontroller: Add gtk_shortcut_controller_add_shortcut()
...
... and gtk_shortcut_controller_remove_shortcut().
2020-03-18 23:00:50 -04:00
Benjamin Otte
3b8a4340da
shortcutcontroller: Add private API for running class shortcuts
...
We don't want regular users to be able to run class shortcuts in their
controllers, so we have to special case that.
2020-03-18 23:00:49 -04:00
Benjamin Otte
ae11b29ee7
treeview: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
ac31979805
widget: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
0b4d0f4d31
dialog: Port binding to use shortcuts
2020-03-18 23:00:49 -04:00
Emmanuele Bassi
00bc9e6b85
text: Port to widget shortcuts
2020-03-18 23:00:49 -04:00
Emmanuele Bassi
d75fd59ddf
Allow installing bindings bound to actions
...
This is just convenience code around GtkShortcut, just like bindings for
signal emission and callback invocation.
2020-03-18 23:00:49 -04:00
Emmanuele Bassi
84a52e3bbd
shortcut: Add action activation
2020-03-18 23:00:49 -04:00
Emmanuele Bassi
9687d69b5a
bindings: Export action activation internally
...
We're going to use it, just like we use the signal emission code.
2020-03-18 23:00:49 -04:00
Benjamin Otte
b18f9da807
shortcut: Add gtk_shortcut_set_callback()
...
... and gtk_widget_class_add_binding() to go with it.
This allows shortcuts to invoke manually added callbacks.
2020-03-18 23:00:49 -04:00
Benjamin Otte
6c13bbb441
combobox: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
4f128a4a21
assistant: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
e62154c91f
trigger: Add an alternative trigger
...
And use it.
I just added it to GtkWidget just to show that I can.
The real reason I want it is for gamepad/joystick triggers
in games, so that it becomes possible to select 2 different
triggers (gamepad and keyboard) for the same shortcut.
2020-03-18 23:00:49 -04:00
Matthias Clasen
78f9940ddc
shortcut: Add GtkShortcutTrigger
...
Triggers are meant to describe how to trigger a shortcut.
So far only a keyval + modifiers trigger exists.
2020-03-18 23:00:49 -04:00
Benjamin Otte
0f6c5da28d
window: Port bindings to use shortcuts
2020-03-18 23:00:49 -04:00
Benjamin Otte
c7f10e570e
bindings: Add more variant types
...
Also marshal types that the code in gtkbindings.c doesn't use. These
will be used by gtk_widget_class_add_binding_signal().
2020-03-18 23:00:49 -04:00
Benjamin Otte
e19b49f5aa
widget: Add gtk_widget_class_add_shortcut()
...
This allows adding shortcuts as a replacement for keybindings.
2020-03-18 23:00:49 -04:00
Benjamin Otte
ff13ee4b66
gtk: Add GtkShortcut
...
This is the base class for what is about to take over all sorts of
keyboard shortcuts. The initial version barely deals with keybindings.
2020-03-18 23:00:49 -04:00
Benjamin Otte
fed7d3833f
bindings: Split out function to invoke an action signal
...
We want to use that in shortcuts later.
2020-03-18 23:00:49 -04:00
Benjamin Otte
5c6be5c0cd
shortcutcontroller: Introduce
...
This is a very barebones controller that currently does nothing but
activate the binding signals. Yay.
And because we have bindings on every widget (Yes, a GtkGrid has a
keybinding - 2 in fact), we need that controller everywhere.
2020-03-18 23:00:49 -04:00
Benjamin Otte
06660874ee
bindings: Make gtk_binding_parse_signal() use GVariantBuilder
...
And because it's the last user of GtkBindingArg and
gtk_binding_entry_add_signall(), also remove those two.
2020-03-18 23:00:49 -04:00
Benjamin Otte
4675d74e42
bindings: Parse into GVariantBuilder directly
...
Avoids the indirection via GtkBindingArg
2020-03-18 23:00:49 -04:00
Benjamin Otte
3b3a5c2d53
bindings: Add gtk_binding_entry_add_signal_variant()
...
This function is the replacement for
gtk_binding_entry_add_signall().
The GVariant will be demarshalled and passed to the action signal upon
binding activation. The same rules apply as used to apply for
GtkBindingArg, in that long, double and string args are now replaced by
"x", "d" and "s" variant types.
2020-03-18 23:00:49 -04:00
Benjamin Otte
385c5e0569
bindings: Replace GtkBindingArg arguments with GVariant
...
This only replaces invocation, not yet parsing.
2020-03-18 23:00:49 -04:00
Matthias Clasen
6ec96d2e98
Merge branch 'wip/chergert/speedup-char_is_invisible' into 'master'
...
textbtree: short-circuit visibility check when possible
See merge request GNOME/gtk!1534
2020-03-19 01:20:21 +00:00
Christian Hergert
6c8d47f585
textbtree: short-circuit visibility check when possible
...
If we have never seen a GtkTextTag in the GtkTextTagTable with the
invisible bit set, then we do not need to go through the process of
checking the accumulated tags.
Not using invisible tags is overwhelmingly the common case.
2020-03-18 11:32:46 -07:00
Matthias Clasen
1bc1b82256
Merge branch 'wip/jimmac/adwaitadark-lighten-switches' into 'master'
...
Adwaita: dark switches/check/radios
Closes #2461
See merge request GNOME/gtk!1532
2020-03-18 12:28:15 +00:00
Matthias Clasen
89c0df6cb7
Merge branch 'wip/chergert/textview-fix-gdk_event_unref' into 'master'
...
textview: use gdk_event_unref()
Closes #2520
See merge request GNOME/gtk!1531
2020-03-18 12:27:08 +00:00
Jakub Steiner
c91dd2cb45
Adwaita: dark switches/check/radios
...
- lighten up radios, switches and checkboxes
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2461
2020-03-18 13:01:17 +01:00
Matthias Clasen
3408ff1dd7
emojichooser: Fix keynav
...
Make arrow and tab keys work in the
variations popover again.
2020-03-17 21:49:29 -04:00
Matthias Clasen
7a46157edf
window: Set min size properly
...
When we are mapping the window, we need to compute
a proper min size, otherwise the 1, 1 sticks and
makes all windows shrinkable to nothing.
2020-03-17 20:46:57 -04:00
Matthias Clasen
01568dc915
Revert "Adwaita: dark switches/check/radios"
...
This reverts commit 435992600f
.
This causes warnings from the CSS parser.
2020-03-17 20:32:23 -04:00
Matthias Clasen
6eb848f0e0
popover: Add keynav keybindings
...
The shortcut controllers are limited to same-native,
so we need to duplicate the Tab and arrow key bindings
for focus handling, as well as the Enter bindings for
activation.
2020-03-17 20:15:26 -04:00
Christian Hergert
e4578b15c3
textview: use gdk_event_unref()
...
Fixes #2520
2020-03-17 13:24:03 -07:00
Matthias Clasen
8fab4ceebb
Assorted migration guide updates
...
Mention GdkEvent, GdkPopup, GdkToplevel, GtkIconTheme
changes.
2020-03-17 16:23:03 -04:00
Jakub Steiner
826f237782
Merge branch 'wip/jimmac/adwaitadark-lighten-switches'
2020-03-17 11:05:26 +01:00
Jakub Steiner
435992600f
Adwaita: dark switches/check/radios
...
- lighten up radios, switches and checkboxes
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2461
2020-03-17 11:03:28 +01:00
Matthias Clasen
5d4b46b2d8
Merge branch 'emoji-chooser-fixes' into 'master'
...
Emoji chooser fixes
See merge request GNOME/gtk!1530
2020-03-17 05:12:12 +00:00
Matthias Clasen
292cea7310
Adwaita: Fix focus in emoji chooser
2020-03-17 00:28:57 -04:00
Matthias Clasen
4d7f0f330b
emojichooser: Make the variation picker work again
...
We can't attach popovers to unsuspecting widget anymore.
2020-03-17 00:07:37 -04:00
Emmanuele Bassi
5bf51adcce
Merge branch 'respect-text-len-gtk4' into 'master'
...
imcontextwayland: Honour len argument in gtk_im_context_wayland_set_surrounding
See merge request GNOME/gtk!1529
2020-03-16 17:08:53 +00:00
Robert Mader
5343ec3345
imcontextwayland: Honour len argument in gtk_im_context_wayland_set_surrounding
...
Clients may pass not `NULL`-terminated strings as the function takes a
`len` argument. Use that argument.
2020-03-16 16:53:33 +01:00
Matthias Clasen
c6cc02637e
Merge branch 'x11-props' into 'master'
...
Drop X11-specific properties
See merge request GNOME/gtk!1526
2020-03-15 00:47:03 +00:00
Matthias Clasen
1576cced0f
Drop GdkToplevel:accept-focus/:focus-on-map
...
These properties were only ever implemented in the
X11 backend. If you want to use them, just use the
X properties directly.
2020-03-14 19:28:00 -04:00
Matthias Clasen
c9ec1c6af1
Drop focus-related properties
...
We don't use these, and they are only implemented on X11.
2020-03-14 19:28:00 -04:00
Matthias Clasen
32b9dd64db
Drop GdkToplevel:keep-above/below
...
These properties were only ever implemented in the X11
backend. If you want to keep windows above or below
on X11, just use the X properties.
2020-03-14 15:46:55 -04:00
Matthias Clasen
6f156dad7f
window: Drop keep above/below
2020-03-14 15:16:56 -04:00
Matthias Clasen
103ef3c195
tests: Stop using keep above/below
2020-03-14 15:16:56 -04:00
Matthias Clasen
60ea97187a
Drop GdkToplevel:sticky
...
This was only ever implemented on X11. If you
want to use it there, just use the X properties
yourself.
2020-03-14 15:16:18 -04:00
Matthias Clasen
fb7ef8f62c
window: Drop sticky
...
This is an X11-only concept that we don't have
on Wayland.
2020-03-14 14:34:39 -04:00
Matthias Clasen
d4f49a8cb9
tests: Stop sticking windows
2020-03-14 14:34:39 -04:00
Matthias Clasen
951f821d6a
Merge branch 'window-attach' into 'master'
...
window: Drop gtk_window_set_attached_to
See merge request GNOME/gtk!1527
2020-03-14 13:19:35 +00:00
Matthias Clasen
dfda88038e
window: Drop gtk_window_set_attached_to
...
We are no longer attaching windows to widgets.
2020-03-14 02:00:10 -04:00
Matthias Clasen
50c2b80c74
gdk: Documentation fixes
2020-03-14 01:23:56 -04:00
Matthias Clasen
0d3df4fb1d
Document gdk_toplevel_set_modal
2020-03-14 01:23:09 -04:00
Matthias Clasen
4be675b0c9
Small documentation fixes
2020-03-14 01:22:31 -04:00
Matthias Clasen
0c25b4cfa8
Update gtk docs
...
Updates for recent api renames and removals.
2020-03-14 01:15:07 -04:00
Matthias Clasen
c2e5aed874
NEWS: Updates
2020-03-14 00:59:16 -04:00
Matthias Clasen
60a9e9d342
Merge branch 'x11-resize' into 'master'
...
x11: Update surface size for popups too
See merge request GNOME/gtk!1525
2020-03-14 03:35:31 +00:00
Matthias Clasen
8010bc4596
x11: Update surface size for popups too
...
Without this, the back buffers of the wrong size
keep being used, causing flickery misdraws, as
seen when expanding the expander in the popover
in widget-factory.
2020-03-13 21:33:23 -04:00
Matthias Clasen
33db28c288
Merge branch 'fix-tools-tests' into 'master'
...
Fix tools tests
See merge request GNOME/gtk!1524
2020-03-13 20:36:54 +00:00
Matthias Clasen
7db490ef2a
testsuite: Specify the test protocol
...
If we don't specify protocol: 'tap', meson things
all is good even though my test yells "not ok".
2020-03-13 15:53:19 -04:00
Matthias Clasen
8b1301cecd
Update the ui file conversion output
...
This changed because the popover property got renamed.
2020-03-13 15:53:19 -04:00
Matthias Clasen
bc6953a081
testsuite: Update the settings test output
2020-03-13 15:53:19 -04:00
Matthias Clasen
4b71ed3f5e
testsuite: Update tools tests
...
These tests need to test GTK4 ui file syntax.
2020-03-13 15:34:54 -04:00
Matthias Clasen
8fd51d761b
testsuite: Actually run tools tests
...
The script was looking in the wrong place for the tests.
2020-03-13 15:11:07 -04:00
Matthias Clasen
66a0a8d53e
Merge branch 'wip/baedert/test-cflags' into 'master'
...
Pass (almost) all our cflags to tests, testsuite, examples, demos, ...
See merge request GNOME/gtk!1516
2020-03-13 18:40:46 +00:00
Piotr Drąg
265d9c8703
Update POTFILES.in
2020-03-13 17:32:39 +01:00
Matthias Clasen
eaf9f7e225
Merge branch 'wayland-max-cursor-scale' into 'master'
...
wayland: Stop capping cursor scales
See merge request GNOME/gtk!1522
2020-03-13 15:49:02 +00:00
Matthias Clasen
331069f378
wayland: Stop capping cursor scales
...
We don't load entire themes anymore, so we can
easily accomodate larger cursor scales now.
2020-03-13 11:13:02 -04:00
Matthias Clasen
9aa270f928
Merge branch 'update-broadway' into 'master'
...
Update broadway
See merge request GNOME/gtk!1521
2020-03-13 15:09:47 +00:00
Matthias Clasen
97d189d726
Merge branch 'popover-accessible-private' into 'master'
...
a11y: Drop the private from GtkPopoverAccessible
See merge request GNOME/gtk!1520
2020-03-13 14:38:51 +00:00
Alexander Larsson
9e2829756f
broadway: Inherit frame clock from parent surface
2020-03-13 15:26:22 +01:00
Alexander Larsson
b74a26b275
broadway: Keep popups above their parent
...
We set the parent as a "transient parent" for popups, which means
they will not be stacked below the parent.
2020-03-13 15:06:02 +01:00
Alexander Larsson
03d6d272f7
broadway: Track surface position correctly
...
surface->x/y (and various x,y arguments) should be in the parent
coordinates, so treat it as such. We also keep track of the root coords
as these are needed for popup positioning.
Also, drop the isTemp property server side and the weird initial
placement at (100, 100) in the daemon. We now fully control window
placement from the client instead. If this is not we want we should do
a serious design for that but until then lets do the simplest thing.
2020-03-13 15:05:59 +01:00
Alexander Larsson
1a763c440f
broadway: Correctly track surface visibility in client
...
We forgot to unset visible when hiding surfaces
2020-03-13 15:00:32 +01:00
Alexander Larsson
43598fc5f2
broadway: Ensure images are decoded, not only loaded
...
In firefox, onload will trigger when the image is loaded, but at
that point it may not be decoded yet so showing it will sometimers
trigger flashes. We use the new decode() feature instead which ensures
both that the image is loaded *and* decoded, thus fixing the flashes.
2020-03-13 15:00:24 +01:00
Alexander Larsson
a4b718da4e
broadway: Fix image updates for firefox
...
For whatever reason we need to assign the function to a variable
to be able to call it.
2020-03-13 15:00:18 +01:00
Alexander Larsson
086a577fd1
broadway: Handle browser hidpi scale factor
2020-03-13 14:59:37 +01:00
Matthias Clasen
c5076675aa
a11y: Drop the private from GtkPopoverAccessible
...
It is not used, and empty structs upset msvc.
2020-03-13 09:51:04 -04:00
Matthias Clasen
9d98707f66
Merge branch 'present-toplevel-2' into 'master'
...
surface api splitup
See merge request GNOME/gtk!1511
2020-03-13 13:34:57 +00:00
Bastien Nocera
179b39eb86
Merge branch 'wip/hadess/fix-remote-filechooser-main' into 'master'
...
Fix crasher/warnings when browsing remote filesystems
Closes #2482
See merge request GNOME/gtk!1490
2020-03-13 12:36:10 +00:00
Matthias Clasen
19e2ab76ce
win32: Build fixes
...
These fixes were done blindly, to make the ci pass,
and will need review by somebody with access to an
actual win32 system to make sure the surface subtypes
are implemented properly.
2020-03-13 07:47:48 -04:00
Timm Bäder
2fe23409fb
Merge branch 'align-docs-fixes' into 'master'
...
gtk: Tweak GTK_ALIGN_BASELINE docs
See merge request GNOME/gtk!1518
2020-03-13 06:17:46 +00:00
Matthew Leeds
1963ff2951
gtk: Tweak GTK_ALIGN_BASELINE docs
2020-03-12 12:36:09 -07:00
Matthias Clasen
2b2d6bf747
win32: implement subtypes
2020-03-12 15:30:11 -04:00
Matthias Clasen
7fd60ab570
Fix up gdk docs
2020-03-12 15:30:11 -04:00
Matthias Clasen
25b90907ad
surface: document gdk_surface_translate_coordinates
2020-03-12 15:30:11 -04:00
Matthias Clasen
f005dfa5fb
toplevel: require GdkSurface
2020-03-12 15:30:11 -04:00
Matthias Clasen
31d2b686d6
popup: require GdkSurface
2020-03-12 15:30:11 -04:00
Matthias Clasen
3e06a9b1d2
Drop root coordinates from _gdk_device_query_state
...
Callers are not using them anyway. Update all callers.
2020-03-12 15:30:11 -04:00
Matthias Clasen
641c8f3252
Drop mwm hints from api
...
The GdkWMDecoration and GdkWMFunction enums
are no longer used in the api, so move them
to the x11 backend where they are used.
2020-03-12 15:30:11 -04:00
Matthias Clasen
f020d77a23
Move fullscreen-mode to GdkToplevel
2020-03-12 15:30:11 -04:00
Matthias Clasen
81be6ff46b
Move edge-constraints to GdkToplevel
2020-03-12 15:30:11 -04:00
Matthias Clasen
b7f51a362e
surface: Drop unused vfuncs
...
These are now entirely unused.
2020-03-12 15:30:11 -04:00
Matthias Clasen
b05408f854
quartz: Drop unused vfuncs
2020-03-12 15:30:11 -04:00
Matthias Clasen
fe19ad7919
win32: Drop some unused vfuncs
...
toplevel_resize is unused in the frontend.
2020-03-12 15:30:10 -04:00
Matthias Clasen
651b746747
wayland: Drop some unused vfuncs
...
show, withdraw, raise, lower, toplevel_resize,
present_popup,
are all unused in the frontend.
2020-03-12 15:30:10 -04:00
Matthias Clasen
3654c05cb3
x11: Drop some unused vfuncs
...
show, withdraw, raise, lower are all unused in the frontend.
2020-03-12 15:30:10 -04:00
Matthias Clasen
b6c8cf72cd
broadway: Drop some unused vuncs
...
show, withdraw, raise, lower, present_popup
are all unused by the frontend.
2020-03-12 15:30:10 -04:00
Matthias Clasen
8b57092958
surface: Drop gdk_surface_show
...
No longer used.
2020-03-12 15:30:10 -04:00
Matthias Clasen
4dc27ee4a6
win32: Stop using gdk_surface_show
2020-03-12 15:30:10 -04:00
Matthias Clasen
90ff8ca797
broadway: Stop using gdk_surface_show
2020-03-12 15:30:10 -04:00
Matthias Clasen
7e15a13f48
wayland: Drop dead code
2020-03-12 15:30:10 -04:00
Matthias Clasen
b2c5d77883
x11: Stop using gdk_surface_show
2020-03-12 15:30:10 -04:00
Matthias Clasen
90dfca290c
gdk: Drop surface-type
...
We have interfaces for surface subtypes now.
2020-03-12 15:30:10 -04:00
Matthias Clasen
a2dbc729f6
wayland: Stop using surface-type
2020-03-12 15:30:10 -04:00
Matthias Clasen
763321e274
x11: Stop using surface-type
2020-03-12 15:30:10 -04:00
Matthias Clasen
df223ae27b
broadway: Stop using surface type
2020-03-12 15:30:10 -04:00
Matthias Clasen
0616fe033d
x11: Stop using gdk_surface_get_surface_type
2020-03-12 15:30:10 -04:00
Matthias Clasen
5a516f2a22
wayland: Stop using surface types
2020-03-12 15:30:10 -04:00
Matthias Clasen
70e45aa229
surface: Stop using surface types
2020-03-12 15:30:10 -04:00
Matthias Clasen
c00ec402c1
surface: Don't implement subtypes in the frontend
...
These are now provided by the backend.
2020-03-12 15:30:10 -04:00
Matthias Clasen
84095febed
x11: Only use state of toplevels
...
Other surface subtypes don't have that property.
2020-03-12 15:30:10 -04:00
Matthias Clasen
4c06c3bb19
broadway: Implement GdkPopup, GdkToplevel and GdkDragSurface
...
Make subclasses of GdkX11Surface that implement these
interfaces.
2020-03-12 15:30:10 -04:00
Emmanuele Bassi
34ff8f3afb
Merge branch 'migration-can-target-docs' into 'master'
...
Docs: Refer to GtkWidget::can_target in migration guide
See merge request GNOME/gtk!1517
2020-03-12 19:25:58 +00:00
Matthias Clasen
bf08bf667c
x11: Implement GdkPopup, GdkToplevel and GdkDragSurface
...
Make subclasses of GdkX11Surface that implement these
interfaces.
2020-03-12 14:56:21 -04:00
Matthias Clasen
cd773e7cb3
wayland: Implement GdkPopup, GdkToplevel and GdkDragSurface
...
Make subclasses of GdkWaylandSurface that implement these
interfaces.
2020-03-12 14:56:21 -04:00
Matthias Clasen
b3cabe638f
Drop gdk_surface_set_opacity
2020-03-12 14:56:21 -04:00
Matthias Clasen
fafddde4bc
x11: Stop using gdk_surface_set_opacity
...
We can just use the backend api directly.
2020-03-12 14:56:21 -04:00
Matthias Clasen
412a593618
widget: Stop using gdk_surface_set_opacity
2020-03-12 14:56:21 -04:00
Matthias Clasen
d6be419050
Drop gdk_surface_show and gdk_surface_resize
...
We can now use GdkDragIcon api for the last cases
where this was used.
2020-03-12 14:56:21 -04:00
Matthias Clasen
ceefe34027
gtkdragicon: Use drag surface api
2020-03-12 14:56:21 -04:00
Matthias Clasen
b25be8a42f
Add a GdkDragSurface interface
...
This will provide functionality specific to drag icons.
2020-03-12 14:56:21 -04:00
Matthias Clasen
3a4e647b2d
surface: Drop redundant toplevel api
...
The toplevel functionality to keep is moving to
GdkToplevel, and unused functions can go.
2020-03-12 14:56:21 -04:00
Matthias Clasen
c67d426dc4
docs: Stop using gdk_surface_get_decorations
2020-03-12 14:56:20 -04:00
Matthias Clasen
a79b6fbf35
testgtk: Stop setting decorations and functions
2020-03-12 14:56:20 -04:00
Matthias Clasen
496bd5783c
tests: Stop using gdk_surface_fullscreen
2020-03-12 14:56:20 -04:00
Matthias Clasen
8ea80801b4
testgtk: Stop using gdk_surface_set_icon_name
...
Its not useful api, and will disappear.
2020-03-12 14:56:20 -04:00
Matthias Clasen
f7aec64e6f
wayland: Stop using gdk_surface_set_title
...
Directly call the backend function for this, and for
gdk_surface_set_transient_for.
2020-03-12 14:56:20 -04:00
Matthias Clasen
8e0ad72875
testgtk: Stop using gdk_surface_get_state
2020-03-12 14:56:20 -04:00
Matthias Clasen
703d69692f
demo: stop using gdk_surface_get_state
2020-03-12 14:56:20 -04:00
Matthias Clasen
f90c0ccaf0
a11y: Stop using gdk_surface_get_state
2020-03-12 14:56:20 -04:00
Matthias Clasen
f78f8655a6
x11: Stop using gdk_surface_get_state
...
All the surfaces we are dealing with here are toplevels.
2020-03-12 14:56:20 -04:00
Matthias Clasen
6edff8cd67
gtk: use toplevel state getter
2020-03-12 14:56:20 -04:00
Matthias Clasen
9266881691
window: Use GdkToplevel
2020-03-12 14:56:20 -04:00
Matthias Clasen
dfbde3da4f
Introduce GdkToplevel
...
This is a new interface for toplevel surfaces.
2020-03-12 14:56:20 -04:00
Matthias Clasen
c0c387020b
Introduce GdkToplevelLayout
...
This will be used in a new GdkTopleve interface in
the near future.
2020-03-12 14:44:03 -04:00
Jason Francis
3830e764d7
Docs: Refer to GtkWidget::can_target in migration guide
...
This makes the docs consistent with the renaming changes in commit
ef982b7d46
.
2020-03-12 14:10:38 -04:00
Timm Bäder
73d8f6a090
build: Add -Wno-typedef-redefinition to build
...
Clang otherwise complains about this
2020-03-12 08:32:34 +01:00
Timm Bäder
822d67295a
Replace a few more fallthrough comments
2020-03-12 08:32:03 +01:00
Matthias Clasen
e7ef4a57ca
testsuite: Stop using type-hints
2020-03-11 19:36:04 -04:00
Matthias Clasen
11c91065cf
window: Drop type hints
2020-03-11 19:36:04 -04:00
Matthias Clasen
eefedccaee
x11: Set type hints based on surface type
...
Set the ewmh type hints based on the surface type and
transient parent, instead of taking it from the type hint.
2020-03-11 19:36:04 -04:00
Matthias Clasen
2ae3b46ee9
Stop setting type hints for dialogs
2020-03-11 19:36:04 -04:00
Matthias Clasen
ef9d7612f6
shortcutswindow: Stop setting type hints
2020-03-11 19:36:04 -04:00
Matthias Clasen
66669e0573
headerbar: Stop looking at type hints
2020-03-11 19:36:04 -04:00
Matthias Clasen
aec3705717
testsuite: Stop using type-hint
2020-03-11 19:35:56 -04:00
Matthias Clasen
ec0fb44958
a11y: Stop using type hints
2020-03-11 19:35:56 -04:00
Matthias Clasen
6c44f7bf07
wayland: Stop tracking orphan dialogs
...
Wayland has no concept of transient-for-group. If we want to
support that, add proper proper protocol for it, don't hack it
in this like.
2020-03-11 19:35:56 -04:00
Matthias Clasen
b2ae6ce8ff
surface: Rename gdk_surface_input_shape_combine_region
...
There is no shape combining going on anymore, so
call this just gdk_surface_set_input_region, and
remove the offset arguments too. All callers pass
0 anyway.
Update all callers and implementations.
2020-03-11 19:35:56 -04:00
Matthias Clasen
72fdf54e07
x11: Stop using gdk_surface_maximize
...
Just use the backend function directly.
2020-03-11 19:35:56 -04:00
Matthias Clasen
78ed520a5b
x11: Stop using gdk_surface_set_geometry_hints
...
Just use the backend function directly.
2020-03-11 19:35:56 -04:00
Matthias Clasen
29606af03e
wayland: Stop using gdk_surface_set_geometry_hints
...
Just use the backend function directly.
2020-03-11 19:35:56 -04:00
Matthias Clasen
513eb11c7c
inspector: Stop raising and lowering windows
...
We should always be composited, so this should not
matter in practice.
2020-03-11 19:35:56 -04:00
Matthias Clasen
2a6c08571f
x11: Stop using gdk_surface_raise
...
Avoid a vfunc roundtrip and just use the backend
implementation directly.
2020-03-11 19:35:56 -04:00
Matthias Clasen
3276021a5b
broadway: Stop using gdk_surface_raise
...
We don't implement this anyway. Add a shortcut
to the backend function in case we ever do.
2020-03-11 19:35:56 -04:00
Matthias Clasen
b1fb049277
x11: Stop abusing type hints for dnd
...
Nothing in GDK depends on this being set, so just
don't do it.
2020-03-11 19:35:55 -04:00
Matthias Clasen
5acbfce264
wayland: Stop abusing type hints
...
Instead of misusing window type hints, introduce
a private flag for drag surfaces.
2020-03-11 19:35:55 -04:00
Matthias Clasen
dc4f7515bd
surface: Drop popup api
...
We have the GdkPopup interface now.
2020-03-11 19:35:55 -04:00
Matthias Clasen
4e8dfdff2e
tooltip: Use GdkPopup
2020-03-11 19:35:55 -04:00
Matthias Clasen
b670bf54f7
popover: Use GdkPopup
2020-03-11 19:35:55 -04:00
Matthias Clasen
530dd5a940
surface: Implement GdkPopup
...
This is not quite right, and only temporary, since
it makes GDK_IS_POPUP (surface) true for every surface.
Eventually, the implementation will be moved to the
backends.
2020-03-11 19:35:55 -04:00
Matthias Clasen
aee8a02fc8
Introduce GdkPopup
...
This is a new interface for popup surfaces.
2020-03-11 19:35:55 -04:00
Matthias Clasen
0791363943
popuplayout: Add docs
2020-03-11 19:35:55 -04:00
Matthias Clasen
fe35831112
Move GdkSurface autocleanup declaration
...
We need this available after including gdksurface.h.
2020-03-11 19:35:55 -04:00
Matthias Clasen
c2f25c0c2f
wayland: Stop calling frontend surface api
...
This is an unnecessary vfunc roundtrip, and the
frontend api is going away shortly.
2020-03-11 19:35:55 -04:00
Matthias Clasen
78d71eb439
Simplify surface move/drag api
...
Drop the with_device variants, and always pass a device.
2020-03-11 19:35:55 -04:00
Matthias Clasen
c488e86caa
testsuite: Update a11y test output
2020-03-11 19:35:55 -04:00
Matthias Clasen
ad322c154c
testsuite: Stop using GtkSpinner::active
...
This property was renamed to ::spinning.
2020-03-11 19:35:55 -04:00
Matthias Clasen
6f36d9865e
Drop gtk_window_begin_move/resize_drag
...
These are just simple wrappers around GdkSurface
api, and we don't need them.
2020-03-11 19:35:55 -04:00
Matthias Clasen
d70c9453ba
disable popover test
...
This is failing atm
2020-03-11 19:35:55 -04:00
Matthias Clasen
ff0909f366
Merge branch 'vfl-error' into 'master'
...
Fix message for VFL parser errors
See merge request GNOME/gtk!1514
2020-03-11 15:56:46 +00:00
Emmanuele Bassi
7de62118a0
Fix message for VFL parser errors
...
The loop is iterating over the wrong variable, and it's reimplementing
g_strfill() in a less efficient way.
2020-03-11 15:14:17 +00:00
Benjamin Otte
8742d42f32
Merge branch 'wip/ricotz/annotations' into 'master'
...
Really fix annotation for GtkDropTarget.get_gtypes()
See merge request GNOME/gtk!1510
2020-03-09 20:47:29 +00:00
Rico Tzschichholz
4af0531e8c
Fix annotation for GdkContentFormats.get_gtypes()
2020-03-09 17:36:08 +01:00
Rico Tzschichholz
4232cbe33f
Really fix annotation for GtkDropTarget.get_gtypes()
2020-03-09 17:03:58 +01:00
sicklylife
2da445f918
Update Japanese translation
2020-03-09 12:49:58 +00:00
sicklylife
5858b56acc
Update Japanese translation
2020-03-09 12:36:08 +00:00
Timm Bäder
7553649c47
testsuite/gtk: Add common_cflags to build
...
With a few exceptions.
2020-03-07 16:28:04 +01:00
Timm Bäder
7789d0e23f
builder: Make object names a const array
...
We don't take ownership.
2020-03-07 15:30:38 +01:00
Timm Bäder
dc36c21835
demos/gtk-demo: Add common_cflags to build
...
With a few exceptions.
2020-03-07 15:30:35 +01:00
Timm Bäder
049f841900
padcontroller: Copy action entries
...
The label and action_name entries of GtkPadActionEntry are supposed to
be const, so copy them into a private ActionEntryData struct that we
later free.
2020-03-07 14:52:45 +01:00
Matthias Clasen
948ab2767b
Merge branch 'master' into 'master'
...
builder-tool: rename show-close-button to show-title-buttons
See merge request GNOME/gtk!1497
2020-03-06 18:02:06 +00:00
Timm Bäder
3c28f6d891
demos/widget-factory: Add common_cflags to build
...
And fix the generated warnings
2020-03-06 18:56:40 +01:00
Timm Bäder
6f6ed1e4af
demos/node-editor: Add common_cflags to build
...
And fix the generated warnings
2020-03-06 18:54:37 +01:00
Timm Bäder
e444d7315c
demos/icon-browser: Add common_cflags to build
...
And fix the generated warnings
2020-03-06 18:53:05 +01:00
Timm Bäder
5d1e006a95
demos/constraint-editor: Add common_cflags to build
...
And fix all the warnings and errors generated.
2020-03-06 18:51:10 +01:00
Timm Bäder
6fcd5d5ab5
testsuite/reftests: Add common_cflags to build
2020-03-06 18:24:58 +01:00
Timm Bäder
e759358402
testsuite/a11y: Add common_cflags to build
2020-03-06 18:22:01 +01:00
Timm Bäder
01bd7910ce
testsuite/css: Add common_cflags to build
...
And fix all the errors coming from that.
2020-03-06 18:22:01 +01:00
Timm Bäder
79c60bb7fd
testsuite/gdk: Add common_cflags to build
2020-03-06 18:22:01 +01:00
Timm Bäder
b3c332ad9c
testsuite/performance: Add common_cflags to build
2020-03-06 18:22:01 +01:00
Timm Bäder
83982a28e7
testuite/gsk: Add common_cflags to build
...
And fix all the warnings and errors.
2020-03-06 18:22:01 +01:00
Timm Bäder
d1cd6aacba
tests: Add common_cflags to build
...
And fix all the errors and warnings resulting from that
See #2491
2020-03-06 18:21:58 +01:00
Timm Bäder
0e8850bf84
examples: Add common_cflags to build
...
And fix all the warnings and errors generated by doing so.
See #2491
2020-03-06 16:36:42 +01:00
Timm Bäder
d7fb33caf7
filechooserwidget: Avoid criticals when in recent mode
...
Don't try to use the browse_files_model just because we have a location
entry. The model might still be NULL at this point.
2020-03-06 16:29:32 +01:00
Alexander Larsson
970d9dc06e
Merge branch 'wip/tbaederr/fallthrough' into 'master'
...
Replace fallthrough comments with G_GNUC_FALLTHROUGH
See merge request GNOME/gtk!1505
2020-03-06 10:48:16 +00:00
Timm Bäder
a1c75795bc
Replace fallthrough comments with G_GNUC_FALLTHROUGH
2020-03-06 10:39:42 +01:00
Benjamin Otte
63126a1b3e
Merge branch 'wip/otte/for-master' into 'master'
...
Wip/otte/for master
See merge request GNOME/gtk!1504
2020-03-06 05:48:56 +00:00
Benjamin Otte
cda9007f0f
stack: Make static analyzer happy
2020-03-06 05:56:29 +01:00
Benjamin Otte
394955cceb
pathbar: Don't do the same thing twice.
...
Don't do the same thing twice.
2020-03-06 05:53:20 +01:00
Benjamin Otte
b1a257c0c3
reftest: Plug memleak
2020-03-06 05:52:44 +01:00
Benjamin Otte
a106b54355
treeview: Don't assign value twice.
2020-03-06 05:51:37 +01:00
Benjamin Otte
510e17d123
cellarea: Be very clear
...
The static analyzer needs to know we absolutely DO NOT want to use this
return value.
2020-03-06 05:50:35 +01:00
Benjamin Otte
317dcddddb
builder-tool: Don't allow property to be both resize and shrink
...
Otherwise builder-tool crashes when you do
<property name="shrink" name="resize">1</property>
Thanks to the static analyzer for figuring that one out.
2020-03-06 05:44:11 +01:00
Benjamin Otte
df282a13bb
applicationaccels: Use g_renew()
2020-03-06 05:44:11 +01:00
Benjamin Otte
e37729756d
liststore: Fix gtk_list_store_iter_is_valid()
...
The iter may be invalid, so we may not read from it.
testsuite/gtk/treemodel tests this and valgrind is shouting about it,
but it never crashed until I just ran it...
This bug is from 2004 and the test is from 2007. I guess invalid memory
accesses don't get caught by CI much.
2020-03-06 05:44:11 +01:00
Benjamin Otte
3b8d9dbd28
testtreeview: Fix 19 year old use-after-free
2020-03-06 05:43:56 +01:00
Benjamin Otte
03e7c7fab1
treepath: Use g_renew()
2020-03-06 05:43:56 +01:00
Benjamin Otte
b231a40106
testsuite: Avoid passing NULL to strcmp()
...
Use g_strcmp0() instead.
2020-03-06 05:43:56 +01:00
Benjamin Otte
be30f78e62
treeview: Don't initialize variable twice
2020-03-06 05:43:56 +01:00
Benjamin Otte
89e5b8cd3a
Merge branch 'wip/otte/for-master' into 'master'
...
Wip/otte/for master
See merge request GNOME/gtk!1502
2020-03-05 18:20:36 +00:00
Benjamin Otte
e356d59a92
build: Add -Wnull-dereference
...
Sprinkle various g_assert() around the code where gcc cannot figure out
on its own that a variable is not NULL and too much refactoring would be
needed to make it do that.
Also fix usage of g_assert_nonnull(x) to use g_assert(x) because the
first is not marked as G_GNUC_NORETURN because of course GTester
supports not aborting on aborts.
2020-03-05 08:14:37 +01:00
Benjamin Otte
4be4799316
icontheme: Remove unused parameter
...
It's only ever set to NULL (and then dereferenced, too)
2020-03-05 07:59:59 +01:00
Benjamin Otte
7dce9e426e
treerbtree: Use for loops
...
Makes the code more readable.
Also does the NULL check for the initial element, which was misisng
before.
2020-03-05 07:59:05 +01:00
Benjamin Otte
4e88d5a7cf
notebook: Don't crash on drags not coming from a notebook
2020-03-05 07:59:05 +01:00
Benjamin Otte
fdd4630952
icontheme: Don't crash on icon lookup failure
2020-03-05 07:59:05 +01:00
Benjamin Otte
a4ed6fde9d
device: Handle missing axis
2020-03-05 07:59:05 +01:00
Benjamin Otte
dc86c744bf
rbtree: Simplify macros
...
* NODE_FROM_POINTER() can not be NULL
* shuffle NODE_TO_POINTER() code for readability so that the NULL check
is on the outside and not the cast
2020-03-05 07:59:05 +01:00
Benjamin Otte
9fedcec82e
rbtree: Simplify code
...
This makes it easier to understand for gcc (and hopefully humans, too)
that by rotating we essentially just swap `node` and `p`.
2020-03-05 07:59:05 +01:00
Benjamin Otte
f6b11a5158
build: Add more useful warning flags
...
I found those on the interwebs and decided they are useful.
2020-03-05 07:56:28 +01:00
Benjamin Otte
38dcc8f63b
mountoperation-x11: Fix copy/paste thinko
2020-03-05 07:05:48 +01:00
Benjamin Otte
18b011a717
tests: Add a test for changing the hovered widget
...
The add/remove one crashes after a few enter/leave events.
2020-03-05 07:05:48 +01:00
Benjamin Otte
8fc360dac5
imcontextwayland: Fix copy/paste error
2020-03-05 04:03:02 +01:00
Benjamin Otte
4313c47113
textview: Fix copy/paste error
2020-03-05 04:03:02 +01:00
Timm Bäder
b376d9617e
Merge branch 'patch-1' into 'master'
...
gdk_monitor_get_model: Fix a typo in the function documentation
See merge request GNOME/gtk!1499
2020-03-04 11:01:30 +00:00
Antenore Gatta
efbae75f3d
gdk_monitor_get_model: Fix a typo in the function documentation
2020-03-04 11:05:46 +01:00
Piotr Drąg
3f7a7d4ca1
Update POTFILES.in
2020-03-03 17:10:36 +01:00
Emmanuele Bassi
2c04e9441a
Merge branch 'doc-fixes' into 'master'
...
Small documentation fixes
See merge request GNOME/gtk!1500
2020-03-03 15:30:43 +00:00
Emmanuele Bassi
a3b9dba13c
Fix annotation for GtkDropTarget.get_gtypes()
...
The argument name must match in the documentation, and the `allow-none`
annotation is deprecated, and should be replaced by `optional` in this
case.
2020-03-03 13:17:31 +00:00
Emmanuele Bassi
5e099e2606
Remove incorrect rename-to annotations
...
The `rename-to` annotation is used to "shadow" a symbol with another
one, which means both symbols need to exist. It can't be used to rename
a symbol to something else.
2020-03-03 13:13:26 +00:00
Emmanuele Bassi
041043eec1
Fix introspection warnings for GtkDragIcon
2020-03-03 13:12:52 +00:00
Emmanuele Bassi
ec9038a8f2
Add missing annotation for GtkIconTheme
2020-03-03 13:04:06 +00:00
sicklylife
c7414db684
Update Japanese translation
2020-03-03 12:09:06 +00:00
sicklylife
6d2c6b1257
Update Japanese translation
2020-03-03 12:06:32 +00:00
Matthias Clasen
9f829ebd4a
Merge branch 'gbsneto/gtkeventcontrollerfocus' into 'master'
...
build: Install gtkeventcontrollerfocus.h
See merge request GNOME/gtk!1498
2020-03-03 08:40:43 +00:00
Georges Basile Stavracas Neto
8e14b21e52
build: Install gtkeventcontrollerfocus.h
...
It's a public class, and is included by gtk.h. Ship it.
2020-03-03 00:38:13 -03:00
Matt Guerrette
46ba019522
builder-tool: rename show-close-button to show-title-buttons
...
For GtkHeaderBar show-close-button has been renamed to
show-title-buttons for GTK4. This commit adds this fixup to the builder
tool
2020-03-02 22:24:46 -05:00
Benjamin Otte
3ef1dca51c
Merge branch 'wip/otte/for-master' into 'master'
...
Wip/otte/for master
See merge request GNOME/gtk!1496
2020-03-02 21:32:20 +00:00
Benjamin Otte
2e55c9cf8c
droptarget: Fast-path local value load
...
This way, we can ensure that for local same-type drops the GValue
is set when ::enter is emitted.
This is the common case for dnd between widgets inside larger
applications, so it's worth it to speed it up.
2020-03-02 21:45:59 +01:00
Benjamin Otte
7427f4f311
drop: Don't use g_object_get()
2020-03-02 21:45:42 +01:00
Benjamin Otte
c0a63e6dd2
dnd: Fix some documentation gotchas
2020-03-02 21:26:08 +01:00
Benjamin Otte
47230f191f
Merge branch 'wip/otte/dnd' into 'master'
...
DND: Sync drop target
See merge request GNOME/gtk!1495
2020-03-02 18:09:05 +00:00
Benjamin Otte
0e72adf6dd
drop: Remove unused convenience APIs
...
With the new event controllers, these are unused.
2020-03-02 04:43:56 +01:00
Benjamin Otte
f5fda3ae58
themes: Set proper foreground color for DND icons
2020-03-02 04:43:56 +01:00
Benjamin Otte
f4a00e7909
calendar: Use a drag source
2020-03-02 04:43:56 +01:00
Benjamin Otte
e7db386018
dnd: Don't create custom color drag icons
...
... use the default one. It looks much better.
2020-03-02 04:43:56 +01:00
Benjamin Otte
2a697827e1
dragicon: Add gtk_drag_icon_create_widget_for_value()
...
... and use it to set a drag icon.
2020-03-02 04:43:56 +01:00
Benjamin Otte
b2c3e39c89
contentformats: Constify some functions
2020-03-02 04:43:56 +01:00
Benjamin Otte
03882e1f96
dragicon: Change how to acquire drag icons
...
Before, gtk_drag_icon_new_for_drag() allowed creating new drag icons.
This could cause multiple drag icons to exist for a single drag.
Now, gtk_drag_icon_get_for_drag() makes sure that only one drag icon is
created.
2020-03-02 04:43:56 +01:00
Benjamin Otte
9efc4e6777
dragicon: Add GtkDragIcon::child
2020-03-02 04:43:56 +01:00
Benjamin Otte
7cd728a0ea
gdk: Make gdk_drop_status() take preferred action
...
This allows textview/text dnd to properly display a MOVE icon when in
the widget the drag started from but a COPY icon otherwise.
2020-03-02 04:43:56 +01:00
Benjamin Otte
c3fb6ca747
colorswatch: Switch to dragged color during dnd
...
This is really simple to implement now, so do it.
2020-03-02 03:18:55 +01:00
Benjamin Otte
3f7b401de0
gtk-demo: Add a simple peg solitaire DND demo
2020-03-02 03:18:55 +01:00
Benjamin Otte
a411959c91
droptarget: Redo
...
This is a huge reorganization of GtkDropTarget. I did not know how to
split this up, so it's unfortunately all one commit.
Highlights:
- Split GtkDropTarget into GtkDropTarget and GtkDropTargetAsync
GtkDropTarget is the simple one that only works with GTypes and offers
a synchronous interface.
GtkDropTargetAsync retains the full old functionality and allows
handling mime types.
- Drop events are handled differently
Instead of picking a single drop target and sending all DND events to
it, every event is sent to every drop target. The first one to handle
the event gets to call gdk_drop_status(), further handlers do not
interact with the GdkDrop.
Of course, for the ultimate GDK_DROP_STARTING event, only the first
one to accept the drop gets to handle it.
This allows stacking DND event controllers that aren't necessarily
interested in handling the event or that might decide later to drop
it.
- Port all widgets to either of those
Both have a somewhat changed API due to the new event handling.
For the ones who should use the sync version, lots of cleanup was
involved to operate on a sync API.
2020-03-02 03:18:55 +01:00
Benjamin Otte
f4ac74795c
placessidebar: Don't use the GdkDrag
...
First, it should have been a GdkDrop, but even then, proper DND code
should not rely on internals.
It's only been used in an unused signal emission anyway.
2020-03-02 03:18:55 +01:00
Benjamin Otte
b64a0273c5
notebook: Make dnd page switching a drop controller
...
This untangles tab dnd from page switching.
2020-03-02 03:18:55 +01:00
Benjamin Otte
b799bc5ce1
textview: Move drop scrolling to drop motion controller
...
Don't confuse the drop target with it.
2020-03-02 03:18:55 +01:00
Benjamin Otte
fdb39b095b
treeview, iconview: Don't return the drop target
...
Not a good idea to hand internal event controllers out to public API.
2020-03-02 03:18:55 +01:00
Benjamin Otte
d9fa839097
testsuite: Use g_assert() in tests
2020-03-02 03:18:55 +01:00
Emmanuele Bassi
35f8f05a63
Merge branch 'piotrdrag/placessidebar-typos' into 'master'
...
placessidebar: Fix a couple of typos and thinkos in menu labels
See merge request GNOME/gtk!1494
2020-03-01 15:07:17 +00:00
Piotr Drąg
810d567cc9
placessidebar: Fix a couple of typos and thinkos in menu labels
2020-03-01 15:05:28 +01:00
Matthias Clasen
c9d3f87e43
Merge branch 'kill-grabs-2' into 'master'
...
Kill grabs
See merge request GNOME/gtk!1492
2020-02-29 01:19:48 +00:00
Matthias Clasen
3d11973df8
Drop gtk_grab_add/remove from public api
...
The only form in which we still allow grabs to take place
is with modal toplevels.
2020-02-28 16:36:17 -05:00
Matthias Clasen
57c8a643ff
Drop gtk_grab_get_current
...
Another grab-related api that we are not using.
2020-02-28 16:29:56 -05:00
Matthias Clasen
0ffb35c9e7
Drop device grabs
...
We were not using this api at all, so lets drop it.
2020-02-28 16:27:42 -05:00
Matthias Clasen
d60097f8fe
Merge branch 'matthiasc/for-master' into 'master'
...
inspector: Fix the "Software GL" switch
See merge request GNOME/gtk!1491
2020-02-28 20:35:11 +00:00
Matthias Clasen
8f87555176
inspector: Fix the "Software GL" switch
...
This was crashing.
2020-02-28 14:42:19 -05:00
Bastien Nocera
8cb45cdeae
filechooser: Fallback if content-type unavailable
...
Fallback to fast-content-type if the content-type attribute isn't
available, as is the case for most remote filesystems.
Closes : #2482
2020-02-28 17:33:08 +01:00
Bastien Nocera
823714cf66
filechooser: Fix crash when file has no content-type
...
This might happen for slow filesystems where a fast-content-type might
be provided instead. Don't try to manipulate that content_type if it's
NULL, otherwise we'll either throw warnings (at best) or crash (at
worse).
Conflicts:
gtk/gtkfilechooserwidget.c
2020-02-28 17:32:48 +01:00
Piotr Drąg
cf2bcef814
Update POTFILES.in and POTFILES.skip
2020-02-27 22:05:24 +01:00
Matthias Clasen
29d033a8b3
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1488
2020-02-27 20:29:04 +00:00
Matthias Clasen
cf873f3426
Remove a stray g_object_unref
...
Events are no longer objects, so this does not do
any good. Use gdk_event_unref instead.
2020-02-27 14:31:19 -05:00
Matthias Clasen
527a8048b6
Avoid a crash in css font features values
2020-02-27 14:30:58 -05:00
Nathan Follens
0c1f93cd7c
Update Dutch translation
2020-02-27 11:05:23 +00:00
Timm Bäder
d86832ad5a
Merge branch 'patch-1' into 'master'
...
Fix a typo in gtkplacessidebar.c
See merge request GNOME/gtk!1486
2020-02-27 10:41:44 +00:00
Krzesimir Nowak
8df045537e
Fix a typo in gtkplacessidebar.c
...
Some mistyped vim command got into the code in commit 60d2813247
.
2020-02-27 10:02:56 +00:00
Matthias Clasen
73d40c2e6e
Merge branch 'matthiasc/for-master' into 'master'
...
Fix a leftover occurrence of ::expand
See merge request GNOME/gtk!1485
2020-02-27 01:12:23 +00:00
Matthias Clasen
90376d6d6e
Fix a leftover occurrence of ::expand
2020-02-26 19:31:25 -05:00
Danial Behzadi
6a359c54fb
Update Persian translation
2020-02-26 23:23:04 +00:00
Matthias Clasen
17b7aabfc1
Merge branch 'matthiasc/for-master' into 'master'
...
gesture: Actually track targets
See merge request GNOME/gtk!1484
2020-02-26 22:34:45 +00:00
Matthias Clasen
dcbecdac31
gesture: Actually track targets
...
Due to a mismerge, this wasn't actually working,
and was causing criticals from gtk_widget_has_grab
when dragging windows.
2020-02-26 17:06:15 -05:00
Matthias Clasen
fa75d7f480
builder-tool: Fix a thinko
...
We can't rely on the pspec for a removed property.
This code worked until I actually removed the properties.
Update the tests to reflect this.
2020-02-26 10:01:38 -05:00
Matthias Clasen
5430c80361
Merge branch 'expand-margin-cleanup' into 'master'
...
expand and margin cleanup
See merge request GNOME/gtk!1479
2020-02-26 14:27:47 +00:00
Matthias Clasen
37a2cae10e
Small fixups
...
Trying to get the ci style test to pass.
2020-02-26 08:13:45 -05:00
Emmanuele Bassi
815e18e069
Merge branch 'docs-fixes' into 'master'
...
Various documentation fixes
See merge request GNOME/gtk!1481
2020-02-26 11:19:09 +00:00
Emmanuele Bassi
c79acb418f
Merge branch 'remove-show-hidden' into 'master'
...
Remove last instances of GtkFileChooser:show-hidden
See merge request GNOME/gtk!1480
2020-02-26 10:41:50 +00:00
Emmanuele Bassi
303e20226c
Add missing ownership transfer annotations
2020-02-26 10:29:59 +00:00
Emmanuele Bassi
3c2312a2dd
Fix gtk-doc stanza for private symbol
2020-02-26 10:25:46 +00:00
Emmanuele Bassi
7eb7ee33ff
Add missing documentation to GdkDevice
2020-02-26 10:23:15 +00:00
Emmanuele Bassi
d4dcb43aa9
Add missing ownership transfer annotations
2020-02-26 10:23:01 +00:00
Emmanuele Bassi
a1bbd25e12
Fix introspection annotation syntax
2020-02-26 10:19:10 +00:00
Emmanuele Bassi
c8f4f903c6
Remove last instances of GtkFileChooser:show-hidden
...
The file chooser widget is still setting the show-hidden property, even
though it was removed.
2020-02-26 10:15:16 +00:00
Matthias Clasen
b5bacb3be6
Drop the margin property
...
Replace it with margin-start, -end, -top, -bottom throughout.
2020-02-25 20:59:04 -05:00
Matthias Clasen
a9c05193a7
Drop the expand property
...
The hexpand and vexpand properties are sufficient.
2020-02-25 18:29:15 -05:00
Matthias Clasen
2d4e1e248d
update testsuite
...
Update the expected results of the tools tests that are
affected by the new property handling for expand and margin.
2020-02-25 18:28:55 -05:00
Matthias Clasen
77ce55b9ac
builder-tool: replace some properties
...
Replace expand by hexpand and vexpand and
margin by margin-left, -right, -top, -bottom.
2020-02-25 17:50:57 -05:00
Emmanuele Bassi
06ff60aa35
Merge branch 'ci-docs' into 'master'
...
Restructure CI jobs
See merge request GNOME/gtk!1476
2020-02-25 19:47:57 +00:00
Emmanuele Bassi
341b2a3d39
ci: Add a static analysis job
...
Use the Clang static analysis tool.
For the time being, we're going to allow it to fail, but the plan is to
fix every issue it raises.
2020-02-25 19:06:39 +00:00
Emmanuele Bassi
7bc50b7466
ci: Update the docker wrapper script
...
Do a better job at detecting whether we have Docker installed.
2020-02-25 19:05:07 +00:00
Emmanuele Bassi
d9608a0357
ci: Move style-check to .pre phase
...
We want the style checks running at the start of the CI pipeline, no
need to have a specific phase for it.
2020-02-25 17:57:46 +00:00
Emmanuele Bassi
92d86c4a9f
ci: Update all fedora images to v14
2020-02-25 17:19:08 +00:00
Emmanuele Bassi
382340c158
ci: Add clang-analyzer to the fedora build image
2020-02-25 17:18:23 +00:00
Emmanuele Bassi
a87966b2bf
ci: Rename the "style-check" phase to "analysis"
...
We want to re-use it for other jobs.
2020-02-25 17:15:00 +00:00
Emmanuele Bassi
8a6d5a77bb
ci: Fix style check script
...
Propagate the exit status from clang-format-diff.py to avoid it being
overwritten by the `echo` at the end of the script.
2020-02-25 17:13:39 +00:00
Emmanuele Bassi
97b5775c1f
ci: Add a separate "docs" stage
...
Don't build the API reference on deploy; build it in a separate job,
instead, so we can run it on all pipelines, and deploy it only for
master.
2020-02-25 17:09:24 +00:00
Timm Bäder
64ff12dbd7
Merge branch 'wip/baedert/for-master' into 'master'
...
wip/baedert/for-master
See merge request GNOME/gtk!1466
2020-02-25 13:35:34 +00:00
Timm Bäder
02e295ec5d
statusbar: Remove _get_message_area() from public API
...
The message should be manipulated via push() and pop().
2020-02-25 14:18:24 +01:00
Timm Bäder
6ff057f36a
scrolledwindow: Remove an unnecessary cast
2020-02-25 14:18:24 +01:00
Timm Bäder
54bf739e8f
scrolledwindow: Remove useless local variables
2020-02-25 14:18:24 +01:00
Timm Bäder
d5327a61e6
widget: Remove gtk_widget_input_shape_combine_region()
...
Widget's don't have surfaces anymore these days.
2020-02-25 14:18:24 +01:00
Timm Bäder
0bca4a276a
inspect-button: Use new gtk_window_set_extra_input_region
2020-02-25 14:18:24 +01:00
Timm Bäder
6056ca9265
window: Carry an extra input region
...
This will be used in the inspector to make it possible to click through
the inspector window.
2020-02-25 14:18:24 +01:00
Timm Bäder
73c212d89b
popover: Stop using gtk_widget_input_shape_combine_region()
...
We control the surface anyway, we can as well set the input shape on it
directly.
2020-02-25 14:18:24 +01:00
Timm Bäder
6b970c6813
widget: Remove set_csd_input_shape
...
Replace the only caller (unsurprisingly from gtkwindow.c) with a direct
call to gdk_surface_input_shape_combine_region.
2020-02-25 14:18:24 +01:00
Timm Bäder
e552adf05a
widget: Remove surface member
...
Only GtkNatives are supposed to have a surface, so use the widget's
native.
2020-02-25 14:18:23 +01:00
Timm Bäder
a1fc94f1f7
range: Remove an outdated comment
...
What even is a CList.
2020-02-25 14:18:23 +01:00
Timm Bäder
b81cd8c929
range: Inline function into only caller
2020-02-25 14:18:23 +01:00
Timm Bäder
838fc4fdf4
range: Clean up compute_slider_position()
2020-02-25 14:18:23 +01:00
Timm Bäder
596be280c9
menusectionbox: Avoid a gtk_widget_destroy() call
2020-02-25 11:08:25 +01:00
Timm Bäder
b1d4d24c7b
pathbar: Inherit from GtkWidget
2020-02-25 11:08:25 +01:00
Timm Bäder
1baae1f288
colorchooser: Fix typo in checkerboard color
2020-02-25 11:08:25 +01:00
Timm Bäder
dae06d82ae
inspector: Remove double borders in recorder
2020-02-25 11:08:25 +01:00
Timm Bäder
549a3a81ae
headerbar: Replace gtk_widget_destroy() call
2020-02-25 11:08:25 +01:00
Timm Bäder
ff4a33b69b
headerbar: Remove size request on icon button
...
Doesn't make sense that we force this one button to be this big.
2020-02-25 11:08:25 +01:00
Timm Bäder
68b4c061cf
shortcutlabel: Remove unnecessary includes
2020-02-25 11:08:25 +01:00
Timm Bäder
dbd1180ce4
stackswitcher: Avoid calling gtk_widget_destroy()
2020-02-25 11:08:25 +01:00
Timm Bäder
df3b88483d
modelbutton: Fix wrong function name in doc comment
2020-02-25 11:08:25 +01:00
Timm Bäder
60d2813247
placessidebar: Convert popover menu to proper GtkPopoverMenu
2020-02-25 11:08:23 +01:00
Timm Bäder
995277f57d
placessidebar: Avoid calling gtk_widget_destroy()
2020-02-25 10:43:15 +01:00
Timm Bäder
e1ca83ddbd
pathbar: Avoid calling gtk_widget_destroy()
2020-02-25 10:43:15 +01:00
Timm Bäder
f4202c5075
headerbar: Avoid calling gtk_widget_destroy()
2020-02-25 10:43:15 +01:00
Timm Bäder
103b6a9205
popovermenubar: Avoid calling gtk_widget_destroy()
2020-02-25 10:43:15 +01:00
Timm Bäder
ceabe70a42
emojichooser: Avoid using gtk_widget_destroy()
2020-02-25 10:43:15 +01:00
Timm Bäder
73faa9c84a
popovermenu: Avoid a gtk_widget_destroy() call
2020-02-25 10:43:15 +01:00
Timm Bäder
1b278b0636
colorchooserwidget: Get rid of a gtk_widget_destroy() call
2020-02-25 10:43:15 +01:00
Matthias Clasen
648a67085f
testsuite: Remove outdated exclusions
...
There were mentions of GtkCList and GtkColorSelection
in these test. The memories!
2020-02-24 23:08:34 -05:00
Matthias Clasen
9d80db29de
Merge branch 'spinning-spinner' into 'master'
...
Rename GtkSpinner::active to ::spinning
See merge request GNOME/gtk!1475
2020-02-25 04:04:46 +00:00
Matthias Clasen
e73a40733f
Rename GtkSpinner::active to ::spinning
...
And add a setter and getter. The old name was
confusing with the widget state of the same
name. 'Active' is just too overloaded.
2020-02-24 22:37:02 -05:00
Matthias Clasen
00f6d1c24b
Merge branch 'kill-rtl-media-icons' into 'master'
...
Drop rtl variants of media-playback-start
See merge request GNOME/gtk!1474
2020-02-25 02:09:52 +00:00
Matthias Clasen
52c948e4e0
Merge branch 'kill-popover-relative-to' into 'master'
...
Drop GtkPopover::relative-to
See merge request GNOME/gtk!1471
2020-02-25 02:00:50 +00:00
Matthias Clasen
8628c573b5
Drop rtl variants of media-playback-start
...
According to #2469 , they are unwanted.
2020-02-24 20:49:10 -05:00
Matthias Clasen
a43d13aa74
popover: Drop ::relative-to
...
It is enough to just set the parent (and make the parent
call gtk_native_check_resize in size_allocate).
This commit removes the relative_to argument to the
constructors of GtkPopover and GtkPopoverMenu, and
updates all callers.
2020-02-24 20:46:41 -05:00
Matthias Clasen
259f465e01
Merge branch 'surface-get-mapped' into 'master'
...
Add gdk_surface_get_mapped
See merge request GNOME/gtk!1473
2020-02-25 00:26:42 +00:00
Matthias Clasen
6fb50ccd0d
Drop gdk_surface_is_visible
...
It has been replaced by gdk_surface_get_mapped.
2020-02-24 19:07:03 -05:00
Matthias Clasen
7a39f2d49d
Replace gdk_surface_is_visible by _get_mapped
...
The property is called ::mapped, and we want to get
to standard getter naming.
2020-02-24 19:07:03 -05:00
Matthias Clasen
96b7c5f575
Add gdk_surface_get_mapped
...
Returns the value of the ::mapped property. This is
a direct replacement for gtk_surface_is_visible.
2020-02-24 17:59:12 -05:00
Matthias Clasen
90fb0caf28
Merge branch 'getters-and-setters' into 'master'
...
gdk:Getters and setters
See merge request GNOME/gtk!1472
2020-02-24 20:31:22 +00:00
Matthias Clasen
3c95798cd3
Add missing GdkDrag getters
2020-02-24 14:38:42 -05:00
Matthias Clasen
ec76f65d09
surface: Add a getter for autohide
2020-02-24 14:38:42 -05:00
Matthias Clasen
6be9e44786
gdk: Drop GdkDevice::input-mode and rename ::input-source
...
Drop the input-mode, since it only makes sense for
floating devices, which we don't have anymore. And renamt
::input-source to ::source, to match the getter.
Update all users.
2020-02-24 14:38:42 -05:00
Matthias Clasen
9ce6e98487
device: Add missing getters
...
This adds getters for a few properties that were
missing them, and renames the input-mode and input-source
properties to match their existing getters.
2020-02-24 08:40:16 -05:00
Matthias Clasen
4ca0a93324
Add a getter for GdkAppLaunchContext::display
2020-02-24 08:32:34 -05:00
Matthias Clasen
3735c9d155
Fix the build with docs
...
This is fallout from filechooser api changes.
2020-02-24 08:22:51 -05:00
Matthias Clasen
7f46b25c04
Merge branch 'wip/ebassi/filechooser-new' into 'master'
...
Clean up the GtkFileChooser API
Closes #2455
See merge request GNOME/gtk!1454
2020-02-24 00:32:23 +00:00
Matthias Clasen
78d63a412c
Merge branch '138-gtk4-install-valgrind-suppressions' into 'master'
...
build: Install Valgrind suppressions files
Closes #138
See merge request GNOME/gtk!1467
2020-02-24 00:23:11 +00:00
Matthias Clasen
5af865f8cb
Merge branch 'matthiasc/for-master' into 'master'
...
broadway: Remove SURFACE_IS_TOPLEVEL
See merge request GNOME/gtk!1469
2020-02-24 00:03:09 +00:00
Matthias Clasen
247a68d602
broadway: Remove SURFACE_IS_TOPLEVEL
...
All surfaces are toplevels now.
2020-02-23 18:15:59 -05:00
Philip Chimento
e123853b8b
build: Install Valgrind suppressions files
...
This is so that other programs linking to GTK can use GTK's suppressions
files when performing their own Valgrind analysis.
Closes : #138
2020-02-23 15:00:37 -08:00
Piotr Drąg
9d2d4a69a5
Update POTFILES.in
2020-02-23 12:32:30 +01:00
Matthias Clasen
9036d49bea
Merge branch 'wip/otte/dnd' into 'master'
...
Get rid of GdkAtom
See merge request GNOME/gtk!1465
2020-02-23 01:50:52 +00:00
Benjamin Otte
cc7c1fe108
gdk: Remove GdkAtom
...
finally!!!!!
2020-02-23 01:59:26 +01:00
Benjamin Otte
f536cf0a43
win32: Get rid of GdkAtom
2020-02-23 01:59:26 +01:00
Benjamin Otte
60307da5b1
wayland: Replace final mention of GdkAtom
2020-02-23 01:59:26 +01:00
Benjamin Otte
6e935d469a
x11: Get rid of GdkAtom and APIs supporting it.
...
replace all uses with const char * (non-interned).
Also remove a lot fo juggling from atom to GdkAtom to string and back.
The X Atom hash table is now mapping to (again, non-interned) strings.
2020-02-23 01:59:26 +01:00
Benjamin Otte
4280ca2263
device: gdk_device_list_axes() => gdk_device_get_axis_names()
...
Turn a GList of GdkAtom into a char ** - and rename the function to not
cause problems.
2020-02-23 01:59:26 +01:00
Benjamin Otte
28dced597f
gdk: Remove gdk_text_property_to_utf8_list_for_display()
...
A lot of files became empty now, so they have been removed, which makes
this commit seem larger than it is.
2020-02-23 01:59:26 +01:00
Benjamin Otte
6c61c7bf0b
Don't use GdkAtom where const char * is used
...
Those are all forgotten transitions while updating code to new APIs.
2020-02-23 01:59:19 +01:00
Benjamin Otte
6442ec2f8d
gdk: Remove gdk_utf8_to_string_target()
...
Only keep the X11 version around in the backend.
2020-02-23 01:59:00 +01:00
Benjamin Otte
a62d78bf70
selection: Remove GtkSelectionData
2020-02-23 01:59:00 +01:00
Benjamin Otte
a4f7e2ca09
droptarget: Remove selectiondata read functions
...
They are unused now.
2020-02-23 01:59:00 +01:00
Benjamin Otte
a19066b17c
filechooserwidget: Stop using selection data
...
Use gdk_drop_read_async()
2020-02-23 01:59:00 +01:00
Benjamin Otte
992173c382
x11: Register DND atoms with all other atoms
...
It's 2020, there's no need to be restrained with registering atoms.
2020-02-23 01:59:00 +01:00
Benjamin Otte
b0f6996892
gdk: Remove gdk_surface_register_dnd()
...
All surfaces are expected to be DND surfaces from creation.
2020-02-23 01:59:00 +01:00
Matthias Clasen
8d5cece080
Merge branch 'x11-dnd-fixes' into 'master'
...
X11 dnd fixes
See merge request GNOME/gtk!1464
2020-02-23 00:21:54 +00:00
Matthias Clasen
ec383a2388
Add detail to gdk_drag_begin docs
...
Mention that GTK keeps a reference while the drag
operation is ongoing.
2020-02-22 19:10:16 -05:00
Matthias Clasen
7c1cfc5533
x11: Fix dnd coordinate handling
...
We were not properly converting the coordinates we
got to root coordinates. This was showing up as offsets
between the actual drop target and the area where drops
can happen, e.g. when dragging over a stack switcher
to switch pages.
2020-02-22 19:10:16 -05:00
Matthias Clasen
14122d1acb
x11: Export gdk_x11_surface_get_root_coords privately
...
This lets us avoid a roundtrip through the surface vfuncs.
2020-02-22 19:10:16 -05:00
Matthias Clasen
f93d0f8fb5
x11: Keep a ref on GdkDrag objects
...
It is expected that backends keep a ref on the GdkDrag
objects that they create as long as the drag is ongoing.
2020-02-22 19:02:13 -05:00
Matthias Clasen
833b564946
x11: Avoid crashes in dnd
...
We were forgetting to clean up the ::xevent signal
handler in some error cases. Move the signal connection
later, when we know the drag is going forward, and
use g_signal_connect_object to make sure the signal
handler is not forgotten.
2020-02-22 19:02:13 -05:00
Matthias Clasen
7edfcc37a3
Merge branch 'wip/wayland-fix-popup-grabs' into 'master'
...
Fix Wayland popup grabs
See merge request GNOME/gtk!1463
2020-02-22 20:51:32 +00:00
Jonas Ådahl
f0b0076a1c
wayland/popup: Emit un-withdrawn event earlier
...
Otherwise grabbing the seat will appear to have failed.
2020-02-22 20:09:38 +01:00
Jonas Ådahl
71323a8b48
wayland/popup: Remove unnecessary checks when mapping popup
...
We only call this when we're not already mapped so don't check that. We
also only call this when we should be mapped so don't check that either.
2020-02-22 20:08:37 +01:00
Matthias Clasen
b8db9e124b
Merge branch 'matthiasc/for-master' into 'master'
...
Fix a hard-to-spot typo
See merge request GNOME/gtk!1462
2020-02-22 19:01:18 +00:00
Matthias Clasen
ddd126740e
Fix a hard-to-spot typo
...
The symptom caused by this was scales in
popovers not reacting to dragging.
2020-02-22 13:49:12 -05:00
Emmanuele Bassi
9bf03cfeec
docs: Add migration notes for GtkFileChooser
2020-02-22 18:07:11 +00:00
Matthias Clasen
011f58fa64
Merge branch 'matthiasc/for-master' into 'master'
...
x11: Fix a crash in event handling
See merge request GNOME/gtk!1461
2020-02-22 16:41:29 +00:00
Matthias Clasen
1af94d0bce
x11: Fix a crash in event handling
...
This was overlooked in 79b4510c6d
.
2020-02-22 16:41:29 +00:00
Emmanuele Bassi
ff6772fd98
Remove preview widget from GtkFileChooser
...
The preview widget harks from a platform before time, when we didn't
have GIO, or a thumbnail specification.
Very few applications use it correctly, if at all; it has an horrid hack
to deal with the ownership of the widget's instance when accessed
through the getter function; it messes up the layout of the widget and
its label is less than useful when it comes to file names longer than a
dozen characters; it's a poor substitute for a proper thumbnail view.
2020-02-22 16:39:01 +00:00
Matthias Clasen
be25905a8d
Fix gdk docs build
2020-02-22 10:44:21 -05:00
Emmanuele Bassi
e5ef26efa8
Remove GtkFileChooserEntry:local-only
...
We don't use it any more in GtkFileChooserWidget.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
ebd23737c0
Remove GtkPlacesSidebar:local-only
...
We don't use it any more in GtkFileChooserWidget.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
6e699e3f04
Remove GtkPlacesView:local-only
...
We don't use it any more from the file chooser widget.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
4a3742979d
Remove GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
...
We don't need a whole separate action, now that the file chooser widget
can create folders; we can create use SELECT_FOLDER and create one.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
b09e7df81b
Remove GtkFileChooser:local-only
...
Now that the whole API goes through GFile we don't have the weird split
between local-only and non-local-only modes.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
516eab5c43
Remove GtkFileChooser:show-hidden
...
This is a user setting and a user action, not something that ought to be
programmatically set via the file selection API.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
063ad28b1a
Remove overwrite confirmation machinery from GtkFileChooser
...
Overwrite confirmation should not be optional, and it should not loop
into application code to create their own dialog and user response.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
d505573ee6
Drop GtkFileChooser:extra-widget
...
We have "choices" as a more rational (and portable) API; additionally,
the ownership semantics of the extra widget property getter are a hack.
2020-02-22 15:22:06 +00:00
Emmanuele Bassi
5f070ff233
Remove filename/URI API from GtkFileChooser
...
GtkFileChooser's API predates GIO by a few years, so it started off with
filenames and URI as character arrays. After introducing GIO as a
dependency, the API included GFile-based entry points.
It's much more appropriate to use GFile everywhere, as we want to
encourage people to use GIO instead of passing random bytes to low level
POSIX API.
See: #2455
2020-02-22 15:22:06 +00:00
Benjamin Otte
b002572824
Merge branch 'wip/otte/dnd' into 'master'
...
stuff
See merge request GNOME/gtk!1460
2020-02-22 14:53:13 +00:00
Matthias Clasen
767849d6d2
Remove GdkSeatGrabPrepareFunc from headers
...
It is not used in public api anymore.
2020-02-22 08:11:34 -05:00
Matthias Clasen
76e115b910
Add a warning when a grab fails
...
This reveals that the grabs for popover menus
always fail now, causing the menus to not properly
hide.
2020-02-22 08:11:34 -05:00
Benjamin Otte
8a098b1343
tests: Guard variables with necessary macros
2020-02-22 07:44:52 +01:00
Benjamin Otte
9d915ff431
treeviewcolumn: Inline variable into return_if_fail()
2020-02-22 07:44:52 +01:00
Benjamin Otte
6f0a0ce7f1
testsuite: Don't use g_return_if_fail()
...
Use g_assert()
2020-02-22 07:44:52 +01:00
Benjamin Otte
18d7187e4b
testsuite: Don't use return_if_fail()
...
Use assert() instead
2020-02-22 07:35:23 +01:00
Benjamin Otte
d9e3eaaec8
treeview: Guard code by right compiler macros
2020-02-22 07:33:41 +01:00
Benjamin Otte
0c4c88b449
scrolledwindow: Inline variable into return_if_fail()
2020-02-22 07:33:41 +01:00
Benjamin Otte
2cb0007b89
iconview: Inline variables into return_if_fail()
2020-02-22 07:33:41 +01:00
Benjamin Otte
eb70173646
levelbar: Guard function by right compiler macros
2020-02-22 07:33:41 +01:00
Benjamin Otte
2e941acb29
filesystemmodel: Guard variable with correct compiler flags
2020-02-22 07:33:41 +01:00
Benjamin Otte
42d71f1016
combobox: Inline variables into return_if_fail()
2020-02-22 07:33:41 +01:00
Benjamin Otte
99fc31865a
comboboxtext: Inline functions into return_if_fail()
2020-02-22 07:33:40 +01:00
Benjamin Otte
f9b7825a47
device: Inline function into return_if_fail()
2020-02-22 07:33:40 +01:00
Benjamin Otte
e3aee62b18
drop: Guard variable with correct compiler flags
2020-02-22 07:33:40 +01:00
Benjamin Otte
ce3ed45e81
surface: Inline function
...
Fixes compile error with -DG_DISBALE_CHECKS
2020-02-22 07:33:40 +01:00
Benjamin Otte
a12e563cd2
main: Don't synthesize crossing events when nothing changed
...
This was especially bad because it was confusing the event controllers
so much, they'd emit leave + enter events every time the mouse moved.
2020-02-22 07:33:40 +01:00
Benjamin Otte
a5e2275a72
stackswitcher: Use GdkDropControllerMotion
...
... and use one controller per button instead of using it on the
switcher and then going through lots of pain attempting to find the
right button for the location under the mouse.
2020-02-22 07:33:40 +01:00
Benjamin Otte
d680e2e344
Port simple cases to GtkDropControllerMotion
2020-02-22 07:33:40 +01:00
Benjamin Otte
2a8fd25a4b
testsuite: Check proper notify emissions, too
...
This is in particular relevant for the ::is-focus property, because
updating that one doesn't cause enter/leave events.
But it also checks that notify and enter/leave happen in the right
order.
2020-02-22 07:33:40 +01:00
Benjamin Otte
34e5f36fdf
Add GtkDropControllerMotion
2020-02-22 07:33:40 +01:00
Benjamin Otte
9223d1ee04
eventcontrollermotion: Fix docs
2020-02-22 07:33:40 +01:00
Benjamin Otte
fc43ec0bbc
gtk: Bubble drag events like motion events
...
Emit crossing events - with a new GTK_CROSSING_DROP type - like we do
for motion events. There is no more special casing for them.
Note that the gesture has not been updated yet, so some obscure behavior
may occur.
2020-02-22 07:33:40 +01:00
Benjamin Otte
be4b34aa8f
events: Use GdkDrop as event sequence
...
This allows treating drop events like touch events, which GTK groups by
event sequence.
It's a bit ugly that we just case the GdkDrop pointer, but event
sequences are only meant to be unique pointer ids, so it's fine.
2020-02-22 07:33:40 +01:00
Benjamin Otte
6f73a750a7
widget: Simplify adjust_allocation()
...
And in particular, only do it if the widget doesn't use ALIGN_FILL.
This avoids lots of measuring in the common case and speeds up
size_allocate() by about 25%.
And because size_allocate() is the bottleneck in the fishbowl, this also
gets ~25% more fishies.
2020-02-22 07:33:40 +01:00
Benjamin Otte
4128ee88b0
widget: Pull margin computation out of adjust_allocation
...
It's way cheaper to just do it.
Also simplifies adjust_size_allocation a lot.
2020-02-22 07:33:23 +01:00
Benjamin Otte
418bdc87ef
sizerequest: Stop clamping for_size to natural size
...
Widgets should be given the actual size they will be allocated, so they
can do something with it.
If they want to clamp themselves to their natural size, nothing's
stopping them, they know their natural size after all.
2020-02-22 07:33:23 +01:00
Benjamin Otte
612ba7ec15
widget: Don't check for natives
...
It's the native's job to request a 1px x 1px size, not the job of
gtk_widget_size_allocate()
Also saves 10% of size_allocate() time because checking for an interface
is really expensive.
2020-02-22 05:50:07 +01:00
Benjamin Otte
f656cbdc5b
Ensure all natives request at least a 1px wide surface
...
FIXME: Is this necessary?
Could the surfaces just clamp to 1x1 themselves?
We recently declared that surfaces can decide on whatever size they want
so natives need to inspect the size they requested anyway.
2020-02-22 05:50:07 +01:00
Matthias Clasen
3eea9f3e79
Merge branch 'color-float-fix' into 'master'
...
color chooser: Fix fallout from floatification
See merge request GNOME/gtk!1459
2020-02-22 03:19:01 +00:00
Matthias Clasen
9fa7a47081
color chooser: Fix fallout from floatification
...
We are using (dddd) variants to store colors in variants,
which is dangerous now that GdkRGBA members are just floats.
Avoid passsing the GdkRGBA members directly to any varargs
functions.
2020-02-21 19:56:44 -05:00
Matthias Clasen
13ed531301
Merge branch 'wip/xdg-popup-layout-no-op' into 'master'
...
gdk/wayland: Avoid relayout with the same properties
See merge request GNOME/gtk!1457
2020-02-22 00:27:59 +00:00
Matthias Clasen
7a28118f3a
Merge branch 'wip/gdkpopuplayout-section' into 'master'
...
docs: Add GdkPopupLayout to gdk4-sections.txt
See merge request GNOME/gtk!1458
2020-02-22 00:26:42 +00:00
Jonas Ådahl
b4bce2ff8a
docs: Add GdkPopupLayout to gdk4-sections.txt
2020-02-21 23:25:30 +01:00
Jonas Ådahl
2f13ac2e4d
gdk/wayland: Avoid relayout with the same properties
...
When a popup is already showing, and gdk_surface_present_popup() is
called, if the layout didn't change, we're not really interested in
relayouting.
In the future, we'll be able to get notified if position of the popup
would change by some environmental changes, but until then, just don't
support it.
2020-02-21 21:55:16 +01:00
Jonas Ådahl
1d6100e7b0
gdk/popup-layout: Remove leftover struct field
...
The layouts never "seal", as they did in an earlier revision, so remove
the seal field.
2020-02-21 21:42:52 +01:00
Benjamin Otte
112bc964cb
Merge branch 'wip/otte/for-master' into 'master'
...
surface: Don't take a display argument in gdk_surface_new_popup()
See merge request GNOME/gtk!1456
2020-02-21 20:35:47 +00:00
Benjamin Otte
5577cfa40c
surface: Don't take a display argument in gdk_surface_new_popup()
...
The display can be taken from the surface, it must not be different.
2020-02-21 21:13:09 +01:00
Benjamin Otte
c73ac2ed70
Merge branch 'wip/otte/for-master' into 'master'
...
Wip/otte/for master
See merge request GNOME/gtk!1455
2020-02-21 18:24:56 +00:00
Benjamin Otte
7597f6b594
transform: Don't crash for gsk_transform_transform (id, id)
...
See attached tests
2020-02-21 18:30:13 +01:00
Benjamin Otte
b50093d044
transform: Make sure the identity transform is equal to NULL
2020-02-21 18:25:05 +01:00
Benjamin Otte
608e624ecf
x11: When clearing old Drop, emit LEAVE event
...
This can happen when the old DND operation died (like due to a crash or
a broken XWayland compositor.
2020-02-21 18:19:16 +01:00
Benjamin Otte
808961564c
gdk: Make DRAG_ENTER event take x/y coordinates
...
Make it mirror the behavior of ENTER/LEAVE events.
2020-02-21 18:19:16 +01:00
Benjamin Otte
41ef6e9fa5
transform: Add optimization for common case
...
Transforming identity by an other transform does not mean we need to
painstakingly apply the individual steps of other to construct a new
transform, it means we can just return other.
Or in math terms:
I * B = B
so just return B.
2020-02-21 18:19:16 +01:00
Piotr Drąg
4180ad57bc
Update POTFILES.in
2020-02-21 18:11:15 +01:00
Matthias Clasen
d7d7957b04
profiling: Avoid one extra printf
...
We already format the message, no need to use
printf again to combine that with the kind string.
2020-02-21 07:26:19 -05:00
Matthias Clasen
376f5eacbd
profiling: Avoid criticals
...
With events no longer GObjects, the type class is
longer around for peeking.
2020-02-21 07:23:40 -05:00
Matthias Clasen
77e1fd01c3
Merge branch 'readonly-events-1' into 'master'
...
Redo events
See merge request GNOME/gtk!1443
2020-02-21 06:18:25 +00:00
Matthias Clasen
43aa6d9c49
docs: Remove some no-longer existing api
2020-02-21 00:51:04 -05:00
Matthias Clasen
5ebe5be225
Stop exporting gtk_get_event_widget
...
This is non-essential convenience API, and we
don't really expose events to applications anymore.
2020-02-21 00:51:03 -05:00
Matthias Clasen
1c7191f45c
gtk-demo: Stop using gtk_get_event_widget
...
This is convenience api that will be going away.
2020-02-21 00:51:03 -05:00
Matthias Clasen
497a43a4ba
gdk: Drop event structs from the headers
...
All events are GdkEvents now.
2020-02-21 00:51:03 -05:00
Matthias Clasen
b2226ea1e3
gtk: Stop using GtkEventButton
...
Same as the previous commit. All events are
just GdkEvents now.
2020-02-21 00:51:03 -05:00
Matthias Clasen
8823882f97
gtk: Stop using GdkEventKey
...
We should just use GdkEvent, instead of taking
a GdkEventKey, and then cast it everywhere.
2020-02-21 00:51:03 -05:00
Matthias Clasen
9e415ad017
a11y: drop unused code
...
We are no longer using key snoopers.
2020-02-21 00:51:03 -05:00
Matthias Clasen
e062137b2c
motion controller: Match focus event propagation
...
Make the crossing event generation for pointer events
match what we do for focus now.
2020-02-21 00:51:03 -05:00
Matthias Clasen
77aed615e8
Keep more event controller api private
...
We don't want to expose the GtkCrossingData struct, and manually
feeding events to event controllers is not something we want to
encourage, going forward.
2020-02-21 00:51:03 -05:00
Matthias Clasen
4947b94a41
Stop exporting check_event_sanity
2020-02-21 00:51:03 -05:00
Matthias Clasen
0c96b2d8f7
Bring back im context focus-in/out
...
The key controller still needs to track focus,
in order to emit these signals when required.
2020-02-21 00:51:03 -05:00
Matthias Clasen
cadeca74e2
Go back to ::enter/::leave for pointer changes
...
These signals are behaving a little differently from
what ::focus-in/::focus-out used to do.
2020-02-21 00:51:03 -05:00
Matthias Clasen
5a2f829a40
Split off GtkEventControllerFocus
...
Split the focus tracking into a separate
GtkEventControllerFocus, and change the API one more time.
We are back to having ::focus-in and ::focus-out signals.
Update all users.
2020-02-21 00:51:03 -05:00
Matthias Clasen
89c3a7ab24
wip: Add more information to crossing events
...
Add fields for direct descendents to GtkCrossingData,
and populate them when emitting focus change events.
Also add accessors for these fields to GtkEventControllerKey,
and verify that they are set properly in the focus test.
Not done yet: Do the same for pointer crossing events.
2020-02-21 00:51:03 -05:00
Matthias Clasen
7bb6abb1d4
win32: Remove some leftover event struct access
...
And leftover old event api calls.
2020-02-21 00:51:03 -05:00
Matthias Clasen
de91e10a1b
wayland: Fix a release build warning
2020-02-21 00:51:03 -05:00
Matthias Clasen
4098653974
Update the focus test
...
This needs an update to handle the new focus-change signal.
2020-02-21 00:51:03 -05:00
Matthias Clasen
71b3f47909
Update event docs section
2020-02-21 00:51:03 -05:00
Matthias Clasen
1ef30c110f
Clean up GdkEventType docs
2020-02-21 00:51:03 -05:00
Matthias Clasen
6fd913b361
Some event struct packing improvements
...
Rearrange a few things, and move some booleans
into the Any struct, by using a bitfield there.
Some more cleanup could be done - the flags field
with its PENDING and FLUSHED members appears
entirely unused. Nobody is setting those flags.
2020-02-21 00:51:03 -05:00
Matthias Clasen
84edce3732
Streamline event structs
...
Use proper types (GdkModifierType, double), and drop
some unused fields (send_event, display).
2020-02-21 00:51:03 -05:00
Matthias Clasen
2cce508b33
x11: Remove some leftover event struct access
2020-02-21 00:51:03 -05:00
Matthias Clasen
56d44b4cec
x11: Stop using the send_event event field
...
The only use of this field is printing it out in a
debug message. We are going to drop it.
2020-02-21 00:51:03 -05:00
Matthias Clasen
563dd65530
Always deliver focus events to toplevels
...
Its was GTK expects. This change gets rid of the "Ignoring an
unexpected focus event from GDK on a non-toplevel surface."
warning.
2020-02-21 00:51:03 -05:00
Matthias Clasen
0fc2505ed6
Drop gtk_widget_event from API
...
We don't want events to be injected randomly from
the outside. Plus, there's no way to create such
events from the outside now.
2020-02-21 00:51:03 -05:00
Matthias Clasen
b1eaa502df
events: reorganize getters
...
Restructure the getters for event fields to
be more targeted at particular event types.
Update all callers, and replace all direct
event struct access with getters.
As a side-effect, this drops some unused getters.
2020-02-21 00:51:03 -05:00
Matthias Clasen
f1cf0eb3fc
Drop gdk_set/get_show_events
...
We don't need a separate api to turn on debugging
for events.
2020-02-21 00:51:02 -05:00
Matthias Clasen
31bf9da63a
Strip const from GdkEvent
...
Events are refcounted structs, and we generally don't
pass these as const.
2020-02-21 00:51:02 -05:00
Matthias Clasen
1026bfb1ac
events: Drop all setters
...
GdkEvent is now truly readonly.
2020-02-21 00:51:02 -05:00
Matthias Clasen
92288205d4
events: Drop target and related target
...
GTK no longer uses this, so we can drop it.
2020-02-21 00:51:02 -05:00
Matthias Clasen
e5223b1cee
main: Stop calling gdk_event_set_target
...
GTK is no longer relying on this.
2020-02-21 00:51:02 -05:00
Matthias Clasen
2416b4e2a0
Stop using gdk_event_get_target
...
We can now get the target widget from the gesture
that we are using to find the event in the first
place.
2020-02-21 00:51:02 -05:00
Matthias Clasen
2bac066a63
gesture: Keep the target widget for events
...
We already store the events; keep the target widget
in addition. This is a step towards getting rid of
gdk_event_get_target.
2020-02-21 00:51:02 -05:00
Matthias Clasen
cd601ffb9e
eventcontroller: Make the target widget available
...
Make it possible for event controllers to obtain
the target widget during handle_event.
2020-02-21 00:51:02 -05:00
Matthias Clasen
e54e48f6d1
Explicitly pass the target to handle_event
...
Pass the event propagation target explicitly down to
the event controllers. This is a step towards getting
rid of gdk_event_set_target.
2020-02-21 00:51:02 -05:00
Matthias Clasen
b38869b3aa
Stop looking at the related target for filtering
...
We are now sending crossing events (which are the only ones
where a related target makes sense) via handle_crossing.
2020-02-21 00:51:02 -05:00
Matthias Clasen
d063b6b6cc
Reinstate filtering for crossing events
...
The event propagation limit should apply to crossing events
as well.
2020-02-21 00:51:02 -05:00
Matthias Clasen
e3158a1bfb
Make crossing events handled the same way
2020-02-21 00:50:59 -05:00
Matthias Clasen
23c67f8c67
New focus change handling
...
Instead of relying on gdk's antiquated crossing events,
create a new GtkCrossingData struct that contains the
actual widgets, and a new event controller vfunc that
expects this struct. This also saves us from making sense
of X's crossing modes and details, and makes for a
generally simpler api.
The ::focus-in and ::focus-out signals of GtkEventControllerKey
have been replaced by a single ::focus-change signal that
takes GtkCrossingData as an argument. All callers have
been updated.
2020-02-21 00:47:53 -05:00
Matthias Clasen
9402e335d0
wip: scrolledwindow stop using targets
2020-02-21 00:47:53 -05:00
Matthias Clasen
64b9c6aaaa
main: Drop gtk_get_event_target
...
This is no longer used.
2020-02-21 00:47:53 -05:00
Matthias Clasen
61c32f3651
tooltip: stop using gtk_get_event_target
2020-02-21 00:47:53 -05:00
Matthias Clasen
1b2289ad9b
Stop using gtk_get_event_target
...
This is just a thin wrapper around gdk_event_get_target,
so use that directly.
2020-02-21 00:47:53 -05:00
Matthias Clasen
dd251d85c4
Pass translated coordinates outside the event
...
We want to make events readonly, so stop translating
their coordinates and instead pass the translated
coordinates separately, when propagating events.
2020-02-21 00:47:53 -05:00
Matthias Clasen
cd2b58574d
Drop GDK_NOTHING
...
Events of type GDK_NOTHING are good for nothing.
2020-02-21 00:47:53 -05:00
Matthias Clasen
3830e13b98
Make GdkEvent a boxed type
2020-02-21 00:47:53 -05:00
Matthias Clasen
c343031a0e
Stop using g_object_ref/unref on events
...
Use gdk_event_ref/unref instead of g_object_ref/unref.
Events will stop being object soon.
2020-02-21 00:47:53 -05:00
Matthias Clasen
835556c270
Drop gdk_event_new and gdk_event_copy
...
These functions are no longer used outside of gdkevents.c.
2020-02-21 00:47:52 -05:00
Matthias Clasen
59cc216985
display: Stop using gdk_event_copy
...
Events are effectively readonly in GDK now, so we can just
take a reference, no need for a copy.
2020-02-21 00:47:52 -05:00
Matthias Clasen
fe21223d48
win32: Use event constructors
2020-02-21 00:47:52 -05:00
Matthias Clasen
f11b1d258b
x11: Pass the right surface to the dnd filter
2020-02-21 00:47:52 -05:00
Matthias Clasen
e45711e727
x11: Remove an unnecessary check
...
We are not creating GDK_NOTHING events anymore. Yay
2020-02-21 00:47:52 -05:00
Matthias Clasen
79b4510c6d
x11: change event translator interface
...
Make the event translator return a new event, instead of
filling in a half-constructed one.
Update the two implementation in GdkX11Display and
GdkDeviceManagerXI2.
2020-02-21 00:47:51 -05:00
Matthias Clasen
15501afdbb
x11: Change the wm protocols filter api
...
Instead of passing a half-constructed event and expect
it to be filled in, pass the surface as in argument, and
add an out argument for a newly constructed GdkEvent.
2020-02-21 00:40:52 -05:00
Matthias Clasen
94fe0944cc
x11: Don't pass a GdkEvent to shape cache filters
...
The filter functions never look at that event, and
we want to get out of the business of passing half-
constructed events around.
2020-02-21 00:40:52 -05:00
Matthias Clasen
9c4f19e8ed
x11: Don't pass a GdkEvent to xsettings filters
...
The filter functions never look at that event, and
we want to get out of the business of passing half-
constructed events around.
2020-02-21 00:40:52 -05:00
Matthias Clasen
9a1497f582
events: Drop GDK_DESTROY
...
No backend is emitting GDK_DESTROY events anymore, so no
need to carry this around.
2020-02-21 00:40:52 -05:00
Matthias Clasen
7db8be93f4
gtk: Stop handling GDK_DESTROY differently from GDK_DELETE
...
We don't have child windows anymore, so there is no difference.
2020-02-21 00:40:52 -05:00
Matthias Clasen
047c18844c
x11: Don't generate GDK_DESTROY events
...
GTK does not differentiate between GDK_DESTROY and GDK_DELETE
anyway.
2020-02-21 00:40:52 -05:00
Matthias Clasen
30740f0e2c
x11: use event constructors
...
This is not quite complete and only handles the
simple cases.
2020-02-21 00:40:52 -05:00
Matthias Clasen
c9d9ccdb8c
broadway: Use event constructors
...
Convert all of Broadways event handling to use the new
constructors.
2020-02-21 00:40:52 -05:00
Matthias Clasen
4cf63f3eb3
wip: Use event constructors in the testsuite
...
This doesn't work because the constructors aren't exported,
so remove the gestures text temporarily, until we figure
out how to deal with it.
2020-02-21 00:40:52 -05:00
Matthias Clasen
c4a2cf03b2
textview: Stop using gdk_event_copy
2020-02-21 00:40:52 -05:00
Matthias Clasen
495de0b78b
main: Use constructors instead of gdk_event_copy + rewriting
2020-02-21 00:40:52 -05:00
Matthias Clasen
dac61b3cce
imcontextsimple: Use event constructors
2020-02-21 00:40:52 -05:00
Matthias Clasen
080e5de786
widget: Port emulation code to constructors
...
Use the new event constructors when generating events
for emulating presses.
2020-02-21 00:40:52 -05:00
Matthias Clasen
374c9dd880
window: Use event constructors
2020-02-21 00:40:52 -05:00
Matthias Clasen
a5f58e8d28
main: Use event constructors
...
At the same time, stop setting child_surface in
crossing events. Nothing in GTK looks at it.
2020-02-21 00:40:52 -05:00
Matthias Clasen
324aa39cb8
gdk: Use constructor for grab broken
2020-02-21 00:40:52 -05:00
Matthias Clasen
d6c5ecbea3
gdk: Use event constructors for dnd
2020-02-21 00:40:50 -05:00
Matthias Clasen
ef004c64c6
events: Drop x_root/y_root
...
We are not using these fields anymore.
2020-02-21 00:39:43 -05:00
Matthias Clasen
f15e90b194
broadway: Stop setting x_root/y_root in events
...
These fields are not used in GTK anymore, and are
going away soon.
2020-02-21 00:39:43 -05:00
Matthias Clasen
91b94f51f2
x11: Stop setting x_root/y_root in events
...
These fields are not used by GTK anymore and
will be going away soon.
2020-02-21 00:39:43 -05:00
Matthias Clasen
a8e9d6c1f5
x11: Stop relying on root coordinates in events
...
The X11 dnd code was still using x_root/y_root in
GdkEventMotion in a couple of places. Stop doing so,
these field are going away soon.
2020-02-21 00:39:43 -05:00
Matthias Clasen
7e80c39aee
Remove root coords from the GdkDrop api
2020-02-21 00:39:41 -05:00
Matthias Clasen
7f2564aabe
wayland: Clean up coordinate handling
...
Get rid of the get_coordinates function and just
use the structs directly.
2020-02-21 00:39:12 -05:00
Matthias Clasen
07ffa9ad6b
wayland: Use event constructors
...
Convert all of Waylands event handling to use the new
constructors.
2020-02-21 00:39:12 -05:00
Matthias Clasen
67035d2e35
gdk: Add event constructors
...
Add private API to construct events. This is a step towards
making events readonly, and not objects anymore.
The constructors here are sufficient to convert the Wayland
backend over. More may be added for other backends as needed.
Open issues:
- history
2020-02-21 00:39:12 -05:00
Matthias Clasen
9330158f11
Make a11y testsuite pass
2020-02-21 00:39:12 -05:00
Matthias Clasen
8318d3bed3
Merge branch 'master' into 'master'
...
build: gdk/wayland/cursor depends on wayland-client
See merge request GNOME/gtk!1453
2020-02-20 19:08:45 +00:00
Dominique Leuenberger
8b9ad1e963
build: gdk/wayland/cursor depends on wayland-client
...
On distros where wayland-client.h might not be directly in /usr/include
we fail to find the correct headers otherwise.
2020-02-20 17:07:02 +01:00
Timm Bäder
018870643a
scale: Remove useless extra local variable
2020-02-20 10:30:14 +01:00
Timm Bäder
aa53fef39c
scale: Remove unused member
2020-02-20 10:23:09 +01:00
Timm Bäder
faddbb18d3
emojichooser: Add style class to emoji toolbar
...
Closes #1013
2020-02-20 10:23:09 +01:00
Timm Bäder
f14978c68f
filechooserwidget: Fold function into only caller
2020-02-20 10:23:09 +01:00
Timm Bäder
c0de02520c
filechooserwidget: Use a proper GtkPopoverMenu
...
Instead of a fake one where we add .menu to a normal popover. This makes
the menu look like other context menus.
2020-02-20 10:23:09 +01:00
Timm Bäder
b58f9e2aa2
filechoosererrorstack: Set a layout manager
...
Otherwise it doesn't know what to do with its child widget.
2020-02-20 10:23:09 +01:00
Timm Bäder
b8a752c751
filechooserwidget: Allow typing a location in recent mode
...
This is triggered by typing / or hitting Ctrl+L. Since we don't have a
visual indicator for this mode right now anyway, the reason for not
allowing it in recent mode cited in the comment just above the
early-exit is irrelevant.
Closes #2178
2020-02-20 10:23:09 +01:00
Timm Bäder
194039c749
filechooserwidget: Remove unused constants
2020-02-20 10:23:09 +01:00
Timm Bäder
64d0f848bc
text: Remove gtk_text_get_im_context()
...
Unused.
2020-02-20 10:23:09 +01:00
Timm Bäder
d8a61b3185
docs: Remove focus_tracking.txt
...
All the info in there is outdated and not useful.
2020-02-20 10:23:09 +01:00
Timm Bäder
d3936f8d93
docs: Remove developers.txt
...
Everything in there has either been removed in the past or is outdated
information.
2020-02-20 10:23:09 +01:00
Timm Bäder
63bb1c2aaa
docs: Remove dnd_internals.txt
...
This is either already completely outdated or will be soon.
2020-02-20 10:23:09 +01:00
Timm Bäder
e18a159f16
spinbutton: Remove manual queue_draw() calls
...
Everything is automatically redrawn when changing the value, etc.
2020-02-20 10:23:09 +01:00
Timm Bäder
a1bc3ae2c8
popvermenu: Clarify css node docs
...
We add the .menu css class to the popover main node, not its contents
node.
2020-02-20 10:23:09 +01:00
Timm Bäder
2ad6c045b4
aboutdialog: Clarify docs and fix preconditions
2020-02-20 10:23:09 +01:00
Timm Bäder
ec6d5839bd
modelbutton: Un-select on mouse leave
...
This brings us closer to the old GtkMenuItem behavior and also makes
more sense.
2020-02-20 10:23:09 +01:00
Timm Bäder
2bf9a5bd29
aboutdialog: Replace visited_links GList with GPtrArray
2020-02-20 10:23:09 +01:00
Timm Bäder
b5d4815eb7
aboutdialog: Use new GtkStackPage API
2020-02-20 10:23:09 +01:00
Timm Bäder
188f00e05a
stack: Add GtkStackPage:visible accessors
2020-02-20 10:23:09 +01:00
Benjamin Otte
9660ae5556
Merge branch 'wip/xdg-popup-async-relayout' into 'master'
...
Synchronous popup layout
See merge request GNOME/gtk!1241
2020-02-19 18:57:14 +00:00
Emmanuele Bassi
da828a9d0c
Merge branch 'ci-flatpak' into 'master'
...
ci: Update flatpak jobs
See merge request GNOME/gtk!1451
2020-02-19 15:35:21 +00:00
Emmanuele Bassi
3a054d5a90
ci: Update flatpak jobs
...
The CI infrastructure was changed to run with fewer privileges, so we
need to adapt our Flatpak jobs to compensate.
See: https://mail.gnome.org/archives/desktop-devel-list/2020-February/msg00055.html
2020-02-19 15:04:58 +00:00
Jonas Ådahl
ca71119a40
gdk/surface: Replace move_to_rect() with GdkPopupLayout based API
...
Replace the gdk_surface_move_to_rect() API with a new GdkSurface
method called gdk_surface_present_popup() taking a new GdkPopupLayout
object describing how they should be laid out on screen.
The layout properties provided are the same as the ones used with
gdk_surface_move_to_rect(), except they are now set up using
GdkPopupLayout.
Calling gdk_surface_present_popup() will either show the popup at the
position described using the popup layout object and a new unconstrained
size, or reposition it accordingly.
In some situations, such as when a popup is set to autohide, presenting
may immediately fail, in case the grab was not granted by the display
server.
After a successful present, the result of the layout can be queried
using the following methods:
* gdk_surface_get_position() - to get the position relative to its
parent
* gdk_surface_get_width() - to get the current width
* gdk_surface_get_height() - to get the current height
* gdk_surface_get_rect_anchor() - to get the anchor point on the anchor
rectangle the popup was effectively positioned against given
constraints defined by the environment and the layout rules provided
via GdkPopupLayout.
* gdk_surface_get_surface_anchor() - the same as the one above but for
the surface anchor.
A new signal replaces the old "moved-to-rect" one -
"popup-layout-changed". However, it is only intended to be emitted when
the layout changes implicitly by the windowing system, for example if
the monitor resolution changed, or the parent window moved.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
37f4c644d3
gdk/surface: Reset position after hiding
...
The x and y position of GdkSurface is only valid when visible, so reset
them to their inital state after hiding.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
46d40cd4bd
wayland: Simplify logic deciding whether to use xdg_popup
...
From a handful of hueristics and guess-work, to a single
`surface->surface_type == GDK_SURFACE_POPUP`.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
11dbc384ab
wayland: Fix top-most-popup check
...
We can map a non-grabbing popup wherever, it's just the grabbing
popup-chain that needs to be ensured not to break any ordering rules.
Fix this by managing two lists; one of open popups, and another for
grabbing ones.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
ebd3ee9880
gdk: Move GdkGeometry declaration to gdktypes.h
2020-02-19 09:47:18 +01:00
Jonas Ådahl
339a04da7c
gdk: Move GdkGravity to gdktypes.h
2020-02-19 09:47:18 +01:00
Jonas Ådahl
40693412d3
x11: Make gdk_surface_get_position() return relative position
...
The returned position should be relative to the parent surface, but
GdkSurface::x,y were only managed properly for O-R windows. This makes
it correct for regular windows too.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
2bb0eddfb5
wayland: Simplify popup parent discovery
...
Now popups surfaces are always created with the parent set, so we don't
need to implement vorious guess work to try to find what the parent
might be. Remove that code and just use GdkSurface::parent which is
where the parent set during construction ends up at.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
49fcbc27ca
wayland: Remove old "gdk-attached-grab-surface" hackery
...
The corresponding code in gtk/ is long gone, so it's luckly unused these
days.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
7fafa5133b
wayland/surface: Add per surface configuration event queues
...
Add event queues specifically for surface configuration events
(xdg_surface.configure, xdg_toplevel.configure, xdg_popup.configure etc)
so that a configuration can be completed without having side effects on
other surfaces. This will be used to synchronously configure specific
GdkSurfaces, as is needed by the Gtk layout mechanisms.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
0d086872ae
gdk/wayland/surface: Use dedicated bool for frame callback freezing
...
The freezing is conditioned on various state, so lets make the thawing a
bit more robust. Without this there was a risk that we'd thaw too many
times if there was a frame callback requested while the conditions for
the freezing were not met.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
f284e1d483
wayland: Remove position method split
...
Position can only be done via gdk_surface_queue_relayout(); the legacy
way is no longer possible, so remove the legacy positioning code.
2020-02-19 09:47:18 +01:00
Jonas Ådahl
4e78dd2ae0
gdk/surface: Use enum type for surface type
2020-02-19 09:47:18 +01:00
Jonas Ådahl
6eaeadb3b9
tests/popover: Add check box for switching autohide prop
2020-02-19 09:47:18 +01:00
Jonas Ådahl
f43717a42e
popover: Unrealize when autohide prop changes
...
Changing the autohide property means the popover needs to be remapped.
Remapping may need user interaction, so lets just unrealize the popover
if the property changes, forcing the application to remap it should it
be shown again.
2020-02-19 09:47:18 +01:00
Timm Bäder
5097c1defc
Merge branch 'file-filter-name-property' into 'master'
...
GtkFileFilter: Add a GObject property for the name
See merge request GNOME/gtk!376
2020-02-19 07:43:51 +00:00
Matthias Clasen
d58a381c93
Merge branch 'icontheme-api' into 'master'
...
Icontheme api
Closes #2410
See merge request GNOME/gtk!1449
2020-02-19 01:50:49 +00:00
Matthias Clasen
66307f00f1
icontheme: Update the api
...
Add properties, and use string arrays instead of lists.
Among other things, this renames gtk_icon_theme_list_icons
to gtk_icon_theme_get_icon_names.
Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2410
2020-02-18 20:32:17 -05:00
Matthias Clasen
db1ca92790
Merge branch 'wip/otte/for-master' into 'master'
...
debug: When debug-printing, treat NULL as the default display
See merge request GNOME/gtk!1450
2020-02-19 01:18:04 +00:00
Benjamin Otte
732716ba95
debug: When debug-printing, treat NULL as the default display
...
Otherwise we lose debug prints from all code that allows NULL displays.
2020-02-19 01:21:33 +01:00
Matthias Clasen
03ee4229f2
Merge branch 'wip/otte/dnd' into 'master'
...
More DND rework
See merge request GNOME/gtk!1445
2020-02-18 22:15:56 +00:00
Emmanuele Bassi
e64cce2ca3
Merge branch 'dialog-headerbar-type-annotation' into 'master'
...
GtkDialog: Add `type Gtk.HeaderBar` annotation to headerbar getter return value
See merge request GNOME/gtk!1447
2020-02-18 10:58:06 +00:00
Sebastian Dröge
8378eb22a3
GtkDialog: Add type Gtk.HeaderBar
annotation to headerbar getter return value
2020-02-18 10:55:31 +02:00
Benjamin Otte
0d4d4e9a8c
colorbutton: Fix drag source
...
By running it in the capture phase, it will not be starved for events by
the button's click source and make drags actually start a color drag
operation.
2020-02-18 02:58:58 +01:00
Benjamin Otte
7ca149ff90
Remove gdk_content_provider_new_with_formats()
...
See the removal of gdk_content_provider_new_with_callback() for a
rationale.
2020-02-18 02:40:00 +01:00
Benjamin Otte
7ae5fd357c
tests: Modernize testdnd2
2020-02-18 02:40:00 +01:00
Benjamin Otte
b8cf7ea1c6
dnd: Port the TreeModel machinery to GValue DND
2020-02-18 02:40:00 +01:00
Matthias Clasen
308d2caf31
Merge branch 'text-emoji-history' into 'master'
...
text: Treat Emoji insertion like clipboard
See merge request GNOME/gtk!1444
2020-02-17 22:31:17 +00:00
Benjamin Otte
1145da3ea5
placessidebar: Modernize DND
...
No more shooting pointers through pipes
2020-02-17 21:56:16 +01:00
Benjamin Otte
27d7aa1407
notebook: Use proper DND
...
Actually use GValues for the DND operation instead of sending GBytes of
pointer addresses through pipes.
This is a bit complicated because we need to special-case rootwindow
drops, because they're handled on the source side, so we need a custom
ContentProvider.
2020-02-17 21:56:16 +01:00
Benjamin Otte
9703fcc605
notebook: Move dnd scrolling via arrows to own drop target
...
This removes excess code from the tab dnd machinery
2020-02-17 21:56:16 +01:00
Benjamin Otte
e25bfa6a61
dragdest: Handle NULL content formats everywhere
...
NULL means we don't do content formats checks and accept everything.
We use this for notebook arrows or expanders that react to ongoing
drags.
2020-02-17 21:56:16 +01:00
Benjamin Otte
9a7607b419
contentprovider: Add a union content provider
2020-02-17 21:56:16 +01:00
Matthias Clasen
a838a54dca
text: Treat Emoji insertion like clipboard
...
Enter the Emoji inseration in the undo history.
Also, stop stashing away the selection when we
pop up the Emoji chooser, and use the selection
as-is when we insert the Emoji.
2020-02-17 15:05:09 -05:00
Benjamin Otte
f5e3584b5b
placessidebar: Don't claim to support text dnd
...
Because you don't. And never did.
2020-02-17 04:04:21 +01:00
Benjamin Otte
80ba7fd682
dragdest: Make gtk_drop_target_new() args be transfer full
...
Saves tons of code.
2020-02-17 04:04:21 +01:00
Benjamin Otte
91d91a29e8
colorbutton, colorswatch: Simplify DND
...
- Use GDK_TYPE_RGBA and let GDK do the conversion from
application-x-color
- Don't do extra mime type checks when accept() does that for us already
2020-02-17 04:04:21 +01:00
Benjamin Otte
3a7e3cf90d
dragdest: Simplify function
...
Make it obvious that the functions checks one condition and then the
other.
2020-02-17 04:04:21 +01:00
Benjamin Otte
e1f8c1430f
dnd: simplify code
...
The old code did mimetype checks everywhere when type compatibility has
since been moved to the GtkDropTarget::accept signal.
So the code can now just assume a compatible mime type exists.
2020-02-17 04:04:21 +01:00
Benjamin Otte
da83457a60
dnd: Remove gdk_content_provider_new_with_callback()
...
Content providers are meant to be immutable, apart from very special
cases, but in those cases they need to emit
gdk_content_provider_content_changed().
Having a constructor that just uses a get_func invites abuse of this
by not making developers aware of those requirments.
In fact, all users in GTK failed to do this.
Instead, code should use the GtkDragSource::prepare signal to create
content providers when needed.
The same problem exists with gdk_content_provider_new_with_formats(),
but this commit doesn't touch that.
2020-02-16 20:10:31 +01:00
Benjamin Otte
dbad440468
testdnd3: Use GValue dnd
2020-02-16 20:10:30 +01:00
Benjamin Otte
8d2ed36a1b
contentprovider: Add gdk_content_provider_new_typed()
...
Gets around the boilerplate required to create and initialize a GValue
by having this function doing it via G_VALUE_COLLECT().
2020-02-16 20:10:30 +01:00
Benjamin Otte
762c4602fb
wayland: Destroy the offer on gdk_drop_finish()
...
Otherwise the compositor won't be aware the dnd failed and will in turn
not notify the drag source.
2020-02-16 20:10:30 +01:00
Benjamin Otte
5a726bc665
drop: Add a state machine for tracking events
2020-02-16 20:10:30 +01:00
Benjamin Otte
410dbdf671
widget: Fix namespacing problem
...
In Vala and JS at least, gtk_widget_get_css_name() and
gtk_widget_class_get_css_name() are resolved to
GtkWidget.get_css_name().
To avoid this problem, we rename the class version.
2020-02-16 20:05:05 +01:00
Benjamin Otte
43b8aff62c
widget: Fix typos for css-clases property
2020-02-16 19:57:45 +01:00
Benjamin Otte
47c8026e38
Merge branch 'wip/otte/dnd' into 'master'
...
some DND fixes
See merge request GNOME/gtk!1440
2020-02-15 23:45:25 +00:00
Benjamin Otte
b844f34cda
tests: Do proper local DND
...
Just transfer GValues.
2020-02-15 22:33:57 +01:00
Benjamin Otte
46bbb397e1
wayland: Use a magic mime type for local DND
...
Otherwise the compositor gets all confused when it's trying to make
drag happen but we know it's not going to happen.
After all, we exchange data behind its back, we just need to keep it
informed.
2020-02-15 22:33:57 +01:00
Benjamin Otte
894ac6c126
dragdest: Use format matching APIs
2020-02-15 21:04:33 +01:00
Benjamin Otte
a824da66d9
drop: Ensure all relevant formats are available
...
1. GdkDrop does deserialization, so add the deserialize formats
2. If the drop is local, we can copy straight from the drag, so we can
also copy all its formats. This fixes cases where the backend would
drop formats it doesn't support.
2020-02-15 20:02:44 +01:00
Timm Bäder
08501c9510
calendar: Emit {next,prev}-{month,year} signals
...
Fixes #833
2020-02-15 17:18:27 +01:00
Timm Bäder
a4ecfd8f33
widget: Use get_css_name() in get_property()
...
Instead of reimplementing it there.
2020-02-15 17:18:27 +01:00
Timm Bäder
28482e52be
Adwaita: Add focus outlines back to scale troughs
...
Fixes #189
2020-02-15 17:18:27 +01:00
Timm Bäder
bf839dbb88
coloreditor: Scale h value to 360
...
Fixes #1321
2020-02-15 17:18:27 +01:00
Timm Bäder
2529464e21
range: Avoid rounding errors when allocating highlight
...
Fixes #2438
2020-02-15 17:18:26 +01:00
Timm Bäder
7e43034068
widget: Add css-classes property
...
Mirroring the values added and removed via {add,remove}_css_class().
2020-02-15 17:18:26 +01:00
Timm Bäder
52979a0e93
infobar: Remove _get_{action,content}_area()
...
Accessors like these are weird to have and we can add widgets to the
content area via gtk_container_add() as well as add widgets to the
action area via gtk_info_bar_add_action_widget().
2020-02-15 17:18:26 +01:00
Timm Bäder
78a5bf8e21
Remove gtk_info_bar_get_content_area() uses
...
We can just add() to the info bar directly.
2020-02-15 17:18:26 +01:00
Timm Bäder
8612a8a39f
testinfobar: Stop using gtk_info_bar_get_content_area()
...
We have an easier way of adding widgets to the content area of an
infobar: Just gtk_container_add() them like usual.
2020-02-15 17:18:26 +01:00
Timm Bäder
a7de8e6b2f
infobar: Don't store close button visibility separately
...
We can already set and query that value via
gtk_widget_{get,set}_visible() on the close button.
2020-02-15 17:18:26 +01:00
Timm Bäder
3cc57c2e3a
actionbar: Use a bin layout
2020-02-15 17:18:26 +01:00
Timm Bäder
a1d47ec59f
calendar: Add style class to today's label
...
Add the .today style class to the label indicating the current day.
Fixes #230
2020-02-15 17:18:26 +01:00
Timm Bäder
43a9f9bd02
calendar: Document style classes
...
Fixes #790
2020-02-15 17:18:26 +01:00
Matthias Clasen
e5d83eea30
events: Make proximity and scroll events have tools
...
The Wayland backend tries to set device tools on these
events, and it was just an oversight that they don't
carry them.
2020-02-15 09:44:34 -05:00
Robert Ancell
b530c83d98
GtkFileFilter: Don't set the name from the GtkBuilder ID
...
Don't use the GtkBuilder ID for the filter name - this is an ID, not a human
readable name. The name can now be set with a property.
2020-01-27 16:01:54 +13:00
Robert Ancell
b83caec6b9
GtkFileFilter: Add a GObject property for the name
...
The name field was previously not a property, which meant you couldn't set in in
GtkBuilder as translatable.
2020-01-27 16:01:54 +13:00