Commit Graph

70243 Commits

Author SHA1 Message Date
Christian Hergert
3fd931d392 macos: implement GdkDrop for macOS
This gets the basic mechanics of the drop portion of DnD working on the
macOS backend. You can drag, for example, from TextEdit into GNOME
Text Editor when using the macOS backend.

Other content formats are supported, and match what is currently
supported by the clipboard backend as the implementation to read
from the pasteboard is shared.

Currently, we look up the GdkDrag for the new GdkDrop. However,
nothing is stashing the drag away for further lookup. More work is
needed on GdkMacosDrag for that to be doable.
2021-06-17 17:26:42 -07:00
Christian Hergert
6c1dce2878 macos: make pasteboard usage reusable
We will want to be able to reuse the pasteboard reading code from
the macOS DnD drop backend. This just removes the pasteboard
bits from the implementation and allows that to be passed in as in
both clipboard and DnD cases we'll have a specific NSPasteboard
to read from.
2021-06-17 17:19:19 -07:00
Christian Hergert
ad1260505d macos: check for GdkMacosBaseView before using as such
We can get events for external windows such as those from native
file chooser dialogs.
2021-06-17 17:18:19 -07:00
Christian Hergert
b64370cd48 macos: move drag motion to GdkMacosDrag
This doesn't help to be pushed off into the surface, as it makes things
more different than the X11 implementation.
2021-06-17 13:24:39 -07:00
Christian Hergert
6c8e176cc0 macos: fix position of drag surface 2021-06-17 13:23:38 -07:00
Christian Hergert
057bda6cd7 macos: register known clipboard types for drag destination 2021-06-17 13:23:18 -07:00
Christian Hergert
352898ae9e inspector: fix compilation with broadway 2021-06-17 11:54:00 -07:00
Matthias Clasen
1bda665662 Merge branch 'matthiasc/for-master' into 'master'
action muxer fixes

See merge request GNOME/gtk!3678
2021-06-17 17:53:16 +00:00
Hugo Carvalho
fad4c60499 Update Portuguese translation
(cherry picked from commit 807537dd5d)
2021-06-17 14:44:54 +00:00
Matthias Clasen
47bb556327 testsuite: Avoid a compiler warning
This was showing up in ci on macos.
2021-06-17 09:37:45 -04:00
Matthias Clasen
4d00f1903a widget-factory: Show Ctrl-? in the menu
We use our own action for showing the shortcuts window,
so we need to associate this shortcut with our action
for it to show up.
2021-06-17 08:59:30 -04:00
Matthias Clasen
7344a03aa3 shortcutcontroller: Don't reinject menu accels
The normal way to associate accels with actions is
to attach a shortcut controller to the widget. The shorcut
controller will inject the accel into the action muxer
tree, so that it can get displayed in widgets that activate
the action (say, in menus.

This approach does not works for generated menus, since the
widgets are not in the hands of the app developer, so attaching
shortcut controllers to them is impractical.

Instead, GtkModelButton has an accel property that gets
bound to the accel coming from the action muxer tree (most
likely put there via gtk_application_set_accel_for_action),
and creates a shortcut controller itself.

The change in this commit is to prevent the shortcut controller
from injecting the accel into the action muxer tree in this case.
Otherwise, the accels get 'stuck' and we won't update them if the
global accels are later changed.

This is a hack, and needs a better solution.
2021-06-17 08:50:26 -04:00
Matthias Clasen
64af90111e window: Propagate accel changes
When the global accels change, tell the
shortcut controller to re-inject them into
the action muxer hierarchy.
2021-06-17 08:50:26 -04:00
Matthias Clasen
3254a3feab shortcutcontroller: Add a way to update accels
This will be used to make accel changes propagate.
2021-06-17 08:50:26 -04:00
Matthias Clasen
d5054f9b99 action muxer: Propagate registrations further up
We were pretty aggressive about not registering
observers further than necessary, stopping at the
first muxer that provides an action.

But even though action changes further up in the tree
won't be relevant in that case, we need to listen to
accel changes, since they may come from higher up
in the tree (e.g. when using
gtk_application_set_accels_for_action with an action
that is defined on a widget.

So, register all the way to the top, and stop propagating
action changes when we hit a muxer that provides the action.
2021-06-17 08:50:26 -04:00
Matthias Clasen
db93090ea8 menutrackeritem: Be more careful with accel changes
In some cases (such as when getting a new parent), the
action muxer doesn't know exactly which detailed actions
have changed accels, so we call primary_accel_changed with
just an action name.

Make the menu tracker item handle that case by matching
either against the detailed name or the the action name.
2021-06-17 08:50:26 -04:00
Matthias Clasen
15c65595b8 action muxer: Propagate accel changes
When we set a new parent on an action muxer,
accels may change, so call primary_accel_changed
for involved actions.
2021-06-17 08:50:26 -04:00
Benjamin Otte
e59e9ad6a9 Merge branch 'wip/otte/for-master' into 'master'
spinner: Behave like any other icon

See merge request GNOME/gtk!3677
2021-06-17 11:47:28 +00:00
Benjamin Otte
e6c4dbfc6d spinner: Behave like any other icon
Take the size from -gtk-icon-size.

Note that min-width/height still works, as those properties are handled
by the generic widget sizing machinery in GTK4.
2021-06-17 12:54:56 +02:00
Matthias Clasen
424dd8a463 actionobserver: Clarify primary_accel_changed docs
Either action_name or action_and_target may be NULL
here, and observer implementations should be careful
when checking those values.
2021-06-16 10:34:37 -04:00
Matthias Clasen
7b1a7629bc print-editor: Make accels work
Sadly, they don't show up anymore with this.
2021-06-16 10:17:49 -04:00
Matthias Clasen
df1116a010 bloatpad: Add icons as resources
This can serve as a useful example for how to add
themed icons as resources.
2021-06-16 09:35:00 -04:00
Matthias Clasen
11916bac7e bloatpad: Give the toolbar a facelift
Make it look more like a toolbar.
2021-06-16 09:26:15 -04:00
Matthias Clasen
d675ae5cc5 bloatpad: Improve accel dialog
Make this dialog a bit less of an eyesore.
2021-06-16 09:09:24 -04:00
Matthias Clasen
43eeff8f15 examples: Use existing icons
The sunny icon doesn't exist anymore.
2021-06-16 08:45:04 -04:00
Matthias Clasen
ece9e7e240 examples: Drop a redundant frame
The frame in the drawing example adds nothing
and looks wrong.
2021-06-16 08:40:01 -04:00
Matthias Clasen
1abbf00dcf Merge branch 'fix-3793' into 'master'
gdksurface-win32.c: Fix up popup placement (fix issue #3793)

Closes #3793

See merge request GNOME/gtk!3674
2021-06-16 10:08:52 +00:00
Matthias Clasen
10564514e8 Merge branch 'media-stream-name-collision' into 'master'
mediastream: Some more api renaming

Closes #4023

See merge request GNOME/gtk!3673
2021-06-16 10:07:29 +00:00
Chun-wei Fan
ba7ec29dc0 gdksurface-win32.c: Fix up popup placement
If we are undergoing a surface move, just apply the next_layout anyways,
even if we are not moving a toplevel surface.

Update the way how we obtain the x and y coordinates of a surface, if it
is a toplevel, apply the x and y coordinates from the results from we
obtained the underlying Win32 HWND, as we did before.  But if it is a
popup, use gdk_win32_surface_get_geometry() to obtain the correct x and
y coordinates to place our popup surface.

Also correct how we compute the shadow dimensions, and the final popup
rectangle as we attempt to layout the popup surface, since GDK-Win32
keeps track of the shadow dimensions in system (unscaled) units, not GDK
units.

Fixes issue #3793.
2021-06-16 16:25:29 +08:00
Chun-wei Fan
85b595bd14 gdksurface-win32.c: Fix formatting for popup functions 2021-06-16 15:02:56 +08:00
Matthias Clasen
56c486abbf Merge branch 'drop-target-name-collision' into 'master'
droptarget: Rename :drop to :current-drop

Closes #4028

See merge request GNOME/gtk!3669
2021-06-16 00:12:53 +00:00
Matthias Clasen
96fc5dc3a7 mediastream: Some more api renaming
Also rename gtk_media_stream_ended to
gtk_media_stream_set_ended, to avoid naming
collision with GtkMediaStream:ended.

The existing entry points still exist, deprecated
and marked as non-introspectable.

Update all internal uses.

Fixes: #4023
2021-06-15 18:33:23 -04:00
Matthias Clasen
b09087d634 droptarget: Rename :drop to :current-drop
Rename the GtkDropTraget:drop property to :current-drop,
to avoid naming collision with the signal of the same
name.

We leave the old property and getter in place, deprecated
and marked as non-introspectable.

Fixes: #4028
2021-06-15 18:21:28 -04:00
Matthias Clasen
5e99513507 Merge branch 'cherry-pick-4ba89f25' into 'master'
cellarea: Don't shrink area too much

See merge request GNOME/gtk!3672
2021-06-15 20:29:28 +00:00
Matthias Clasen
0a9d2f248e Merge branch 'label-underline-markup' into 'master'
label: Fix mnemonic handling

Closes #4041

See merge request GNOME/gtk!3670
2021-06-15 19:43:40 +00:00
Benjamin Otte
16ff055b42 cellarea: Don't shrink area too much
Do not compute rectangles with negative width/height. This avoids
assertion failures further down when those rectangles were actually
checked.

https://bugzilla.redhat.com/show_bug.cgi?id=1962215


(cherry picked from commit 4ba89f25b8)
2021-06-15 18:00:25 +00:00
Matthias Clasen
89f57d4ff6 Add a mnemonic testcase
Add a testcase that tests the label mnemonic handling
that was fixed in the previous commit.
2021-06-15 13:32:31 -04:00
Matthias Clasen
c4a2234a28 label: Fix mnemonic handling
We were not handling the case right in which we
want to use underlines, but not use markup. Since
we are now using pango_parse_markup for this case,
we need to escape the xml markup.

Fixes: #4041
2021-06-15 13:06:10 -04:00
Matthias Clasen
a3882763d8 Revert "progressbar: Avoid redundant storage"
This reverts commit 95747b1a40.

This was wrong - it turns out that while GtkProgressBar
allows you to change its orientation, its box layout is
always vertical.

Fixes: #4037
2021-06-15 07:37:57 -04:00
Emin Tufan Çetin
787fa6bd0d Update Turkish translation 2021-06-15 09:02:34 +00:00
Matthias Clasen
a6b4e53dca Merge branch 'macos-input-method' into 'master'
fix: make input method work again in gtk4

Closes #3968

See merge request GNOME/gtk!3668
2021-06-14 19:20:06 +00:00
Matthias Clasen
00d25ae89c Merge branch 'media-stream-name-collision' into 'master'
mediastream: Rename an api to avoid name collisions

Closes #4023

See merge request GNOME/gtk!3667
2021-06-14 18:44:10 +00:00
Zhi
5776fcd955 fix: make the new nsview as the first responder.
Make the new view as the first responder(focused) so the new view can
accept events from input method.

Fixes #3968.
2021-06-15 00:09:46 +08:00
Matthias Clasen
86b5dba43b mediastream: Rename an api to avoid name collisions
Some bindings can't handle the coexistence of
GtkMediaStream:prepared and gtk_media_stream_prepared.
Help them out by renaming the function to
gtk_media_stream_set_prepared, and rename
gtk_media_stream_unprepared as well, to match.

The existing entry points still exist, deprecated.

Update all internal uses.

Fixes: #4023
2021-06-14 07:50:12 -04:00
Matthias Clasen
e888364d3c Merge branch 'columnview-double-activation' into 'master'
listitemwidget: Claim gesture when activating

Closes #4015

See merge request GNOME/gtk!3663
2021-06-14 10:39:43 +00:00
Matthias Clasen
276f85c9e3 listitemwidget: Claim gesture when activating
Claim the gesture when we are activating a list item.

Otherwise we end up with double activations in
columnviews: first GtkColumnViewCell handles
the event, and then GtkListItemWidget handles
it again.

Fixes: #4015
2021-06-13 08:03:39 -04:00
Matthias Clasen
68eb422333 listitemwidget: Match activation conditions
Make the conditions used for activation in the single-
and double-click case properly match, so that it is
obvious that we won't trigger both of them.
2021-06-13 08:02:06 -04:00
Matthias Clasen
c0f54f899d Merge branch 'filename-annotations' into 'master'
Add type annotations for filename arguments

Closes #633

See merge request GNOME/gtk!3665
2021-06-13 11:38:50 +00:00
Matthias Clasen
65212535df Merge branch 'msvc-fix' into 'master'
Fix illegal instruction crash on x64 CPUs without POPCNT instruction when compiled with MSVC

See merge request GNOME/gtk!3664
2021-06-13 11:38:22 +00:00
Sebastian Cherek
106ac7c782 Update gtkpopcountprivate.h: undefined macro outside msvc 2021-06-12 17:35:13 +00:00