Commit Graph

37579 Commits

Author SHA1 Message Date
Emmanuele Bassi
fc4402b456 docs: Ignore gtkpasswordentryprivate.h 2020-12-16 16:29:00 +00:00
Emmanuele Bassi
077aec5d32 docs: Add missing documentation for GtkTextCharPredicate 2020-12-16 16:29:00 +00:00
Emmanuele Bassi
548949214c docs: Add missing documentation GtkNative 2020-12-16 16:29:00 +00:00
Emmanuele Bassi
2aec47f56f docs: Add missing documentation for GtkCellRenderer 2020-12-16 16:29:00 +00:00
Jonas Ådahl
142f7862ed gdk/toplevellayout: Change API to be about intent, not full state
When being fullscreen, and wanting to unfullscreen but not caring about
whether to go unmaximized or maximized (as this information is lost), if
the GdkToplevelLayout represents the full intended state, we won't be
able to do the right thing.

To avoid this issue, make the GdkToplevelLayout API intend based, where
if one e.g. doesn't call gdk_toplevel_set_maximized() with anything, the
backend will not attempt to change the maximized state.

This means we can also remove the old 'initially_maximized' and
'initially_fullscreen' fields from the private GtkWindow struct, as we
only deal with intents now.
2020-12-16 14:16:08 +01:00
Jonas Ådahl
b6412adc32 gtk/window: Check widget mappdness and not surface mappedness
When deciding whether to call gdk_toplevel_present(), check the
mappedness of GtkWidget instead of the mapped-ness of GdkSurface, as the
latter is mapped asynchronously, while the former is direct state of the
GtkWindow itself.

This fixes an issue where calling e.g. gtk_window_maximize() shortly
after showing it didn't take effect, as hadn't been mapped yet. While
maximizing after showing is racy, and will likely glitch from time to
time, the correct thing to do is still to maximize and handle whatever
state the compositor configured the window to be in.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3466
2020-12-16 11:56:41 +01:00
Emmanuele Bassi
ea5e186bb8 Hide GtkTextAttributes functions
The type is private, so making functions operating on it public is
pointless.
2020-12-15 16:20:21 +00:00
Emmanuele Bassi
69b181f263 Remove boxed type for GtkCrossingData
The GtkCrossingData type is completely private, so there's no point in
having a boxed type for it.
2020-12-15 15:55:15 +00:00
Emmanuele Bassi
474b4ac1af build: Use Meson support for dylib versions
Do not hand-code it inside GTK's meson.build.
2020-12-15 12:47:05 +00:00
Emmanuele Bassi
99e0929d6c build: Use a consistent style for Meson files 2020-12-15 12:46:59 +00:00
Emmanuele Bassi
e75e44bdcc build: Remove duplicate definition
The `GTK_COMPILATION` symbol is defined in gir_args.
2020-12-15 11:47:32 +00:00
Emmanuele Bassi
7975bbfcaa build: Remove linker flags from static libraries
We only need hardening linker flags on the libgtk shared library;
internal static libraries don't really need them.
2020-12-15 11:36:20 +00:00
Matthias Clasen
e2afb59a0b Merge branch 'matthiasc/for-master' into 'master'
Avoid adding // to resource paths

Closes #3469

See merge request GNOME/gtk!2947
2020-12-14 13:14:32 +00:00
Jakub Steiner
daa5d5aead Merge branch 'dropdown-searchbar' into 'master'
dropdown: Improve search bar styling

See merge request GNOME/gtk!2948
2020-12-14 09:39:38 +00:00
nana-4
34d99ea1d0 Adwaita: Improve emoji picker styling
- Add borders around the main scrollable content, like most other
  places.
- Set padding and spacing on .emoji-searchbar and .emoji-toolbar in a
  more proper way.
- Remove unused button.emoji-section label styles.
2020-12-14 05:26:39 +09:00
nana-4
90355c0b27 emojichooser: Add .emoji-searchbar style class
Similar to .emoji-toolbar, it would be nice to have this for styling.
2020-12-14 05:26:13 +09:00
nana-4
538cf9e294 dropdown: Improve search bar styling
As per the mockup. See:

https://gitlab.gnome.org/Teams/Design/os-mockups/-/blob/master/dropdown-lists/dropdown-lists.png
2020-12-14 05:08:59 +09:00
Matthias Clasen
96a300b2de Merge branch 'wip/jimmac/button-shed' into 'master'
headerbar window controls & clean up flat button extend

Closes #3427

See merge request GNOME/gtk!2942
2020-12-12 02:51:05 +00:00
Matthias Clasen
aeca9cb7ba Avoid adding // to resource paths
The GResource machinery is not forgiving about this
sort of thing.

Fixes: #3469
2020-12-11 21:47:54 -05:00
Carlos Garnacho
612d3bca7d gtk/window: Bring back L-shaped resize corners
These ended up square in the various refactors. Make them again L-shaped
by extending these along the edge being checked. This means we have to
check for corner positions in all edges, though.
2020-12-12 01:42:42 +01:00
Carlos Garnacho
e9fe270e94 gtk/scrolledwindow: Handle full scroll sequences only
In order to do this, leverage smooth scroll handling into the capture
phase scroll controller, controlled by ::scroll-begin in the propagation
phase controller.

There's 2 cases here:
- A child widget handles scroll. The scrolled window does not get
  ::scroll-begin, the child widget handles the full scroll sequence.
- No child handles scroll, the scrolled window gets ::scroll-begin,
  and transfers control of scrolling to the capture phase controller.
  As scrolling is performed, the pointer may fall into scrollable children,
  but the scrolled window will be capturing the scroll events, so these
  won't be seen by the child widgets.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/593
2020-12-12 01:42:42 +01:00
Carlos Garnacho
8402665c55 gtk/eventscrollerscroll: Handle smooth events in discrete controllers
We let smooth scroll events that don't trigger a ::scroll signal through.
This is unintended, these are handled, even if just accumulated.

This fixes cases like GtkSpinButton inside GtkScrolledWindow, where both
would handle events, until the GtkSpinButton eventually shifts away from
underneath the pointer.

Brought up at https://gitlab.gnome.org/GNOME/gtk/-/issues/593
2020-12-12 01:42:42 +01:00
Carlos Garnacho
79090f1755 gtk/entrycompletion: Ensure to show first row when shown, not allocated
This code was here in gtk3 to cater for the completion window being
positioned. That was only to meant once as long as the completion window
was shown.

This doesn't work as well for gtk4, ::size-allocate gets propagated from
the toplevel, so happens much more often for the completion window, this
ends up with the completion position being reset to the first row
frequently.

Do this simply once when popping up the completion, instead.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3083
2020-12-12 01:42:42 +01:00
Carlos Garnacho
3d84a38867 gtk/treeview: Position editable widgets correctly wrt left border
The coordinates are already widget-local here, not transformed by the
adjustment positions. Using the adjustment value here ends up pushing
the entry far from the left border.

The correct minimum value here is 0, which matches the treeview left
border.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3009
2020-12-12 01:42:42 +01:00
Carlos Garnacho
5155fac94f gtk/modelbutton: Handle unpaired releases
Let model buttons handle unpaired releases, these may happen indirectly
e.g. due to other child menus being opened at the time. Clicking would
dismiss the menu, but the menu item beneath the pointer would not get
activated.

We can handle that button release though via ::unpaired-release, so
there's no second click required.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3463
2020-12-12 01:42:42 +01:00
Carlos Garnacho
7a4d15dc67 gtk/range: Move button release handling to GtkGestureDrag
Tracking it through the GtkGestureClick becomes a bit cumbersome for
handling of simultaneously pressed buttons. We can track ::stopped,
but that also emits for a number of situations where we want drag to
continue.

However, the GtkGestureDrag is grouped with the click gesture, and
knows better when to finish the drag gesture (not just because of a
button release), so hook drag and zoom mode finalization there.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3426
2020-12-12 01:42:42 +01:00
Emmanuele Bassi
2c97d44281 docs: Fix the Widget as Buildable example
The layout properties use an old name.
2020-12-11 23:41:51 +00:00
Matthias Clasen
324683993e docs: Update references to GtkWindow:fullscreened
The property got renamed from fullscreen to fullscreened.
Update all references.
2020-12-10 09:10:21 -05:00
Jakub Steiner
f6f6241627 Adwaita: special case flat headerbar buttons
- make sure the hovers and pushed states are legible on a tintend headerbar

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3427
2020-12-10 14:24:29 +01:00
Jakub Steiner
6a33bed353 Adwaita: flat button :hover and :active
- special case undecorated button hovers
2020-12-10 14:16:25 +01:00
Jakub Steiner
f83ee0be23 Adwaita: headerbar_color > headerbar_bg_color
- semantic correction
2020-12-10 13:58:42 +01:00
Jakub Steiner
7442bdc383 Adwaita: duplicate selector
- awkward duplicate selector that should have no effect
  (resulting in the same css)
2020-12-10 13:51:10 +01:00
Emmanuele Bassi
b8a651df47 Share the popcount() fallback for MSVC
We use __builtin_popcount() in a couple of places, so it makes sense to
have it in one header.
2020-12-09 16:06:52 +00:00
Matthias Clasen
c5dd34344f Merge branch 'wip/carlosg/for-master' into 'master'
Wip/carlosg/for master

Closes #3426 and #3264

See merge request GNOME/gtk!2933
2020-12-09 15:04:01 +00:00
Matthias Clasen
c90cc976a5 Merge branch 'wip/jimmac/row-transitions-and-spacing' into 'master'
Adwaita: row transitions and spacing

Closes #3434

See merge request GNOME/gtk!2937
2020-12-09 13:35:54 +00:00
Jakub Steiner
a76ee61e97 Adwaita: row transitions and spacing
- no fading out of row hovers. Many feel like it's a slow
  refresh rather than intentional effect.
- give some margin to navigation lists

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3434
2020-12-09 12:16:15 +01:00
Emmanuele Bassi
c4b768a4ec Rename GtkWindow:fullscreen to :fullscreened
Having a property with the same name of a method makes some languages
which put properties and method names in the same flat namespace not
really happy about our choices. To avoid collisions, let's put the the
"fullscreen" property into the past, alongside the "maximized" property.
2020-12-09 00:11:49 +00:00
Emmanuele Bassi
6d1be832d9 Fix the documentation for GtkWindow state properties
Drop the "don't write code that crashes" folksy bit; don't start
sentences with conjunctions; remove copy-pasted references to
"iconified" states; point to the corresponding property notification in
a consistent manner.
2020-12-08 23:49:45 +00:00
Carlos Garnacho
43e4848872 gtk/main: Keep implicit grab until all buttons are released
Currently, the implicit grab is broken on the first button release,
in the case of pressing multiple buttons simultaneously. This means
that we emit crossing events early, and the next button releases
are sent to the pointer focus widget instead.

Consider the implicit grab effective until all buttons are released,
and only unset the pointer implicit grab (and emit crossing events)
after there are no further buttons pressed. We do this by checking
event modifiers, given button release events do contain the modifiers
in effect at the time the event was generated, we have to look for
exactly one active button modifier.

Fixes weird pointer states after pressing multiple buttons on a
widget.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3426
2020-12-08 23:27:03 +01:00
Carlos Garnacho
47d0b5ad0c gkt/textview: Set an iter position for event-less menu activation
This went missing. Use the current insertion position as a reference.
Fixes invoking the menu via keyboard.
2020-12-08 23:27:03 +01:00
Matthias Clasen
08ca8a361e docs: Remove a mention of gtk_window_get_size
That function has been removed.
2020-12-08 10:44:33 -05:00
Matthias Clasen
1f141c1953 Merge branch 'wip/surface-state-rework' into 'master'
Rework surface state and geometry computation

See merge request GNOME/gtk!2885
2020-12-08 15:38:36 +00:00
Jakub Steiner
1e14a91cb9 Merge branch 'wip/jimmac/no-inner-shadow-sidebars' into 'master'
Adwaita: no 3d shadow for pressed sidebar

Closes #3413

See merge request GNOME/gtk!2928
2020-12-08 14:18:44 +00:00
Jonas Ådahl
d2c95a1b13 gdk: Replace 'WITHDRAWN' state with async 'is-mapped' boolean
It was used by all surfaces to track 'is-mapped', but still part of the
GdkToplevelState, and is now replaced with a separate boolean in the
GdkSurface structure.

It also caused issues when a widget was unmapped, and due to that
unmapped a popover which hid its corresponding surface. When this
surface was hidden, it emitted a state change event, which would then go
back into GTK and queue a resize on popover widget, which would travel
back down to the widget that was originally unmapped, causing confusino
when doing future allocations.

To summarize, one should not hide widgets during allocation, and to
avoid this, make this new is-mapped boolean asynchronous when hiding a
surface, meaning the notification event for the changed mapped state
will be emitted in an idle callback. This avoids the above described
reentry issue.
2020-12-07 20:37:30 +01:00
Jonas Ådahl
8f8c5040db gtk/headerbar: Remove unused 'state' field 2020-12-07 20:37:30 +01:00
Matthias Clasen
3db0d06901 Properly remove gtk_window_get_size
It was still in the headers and the docs, but did
not have an implementation anymore.
2020-12-07 20:37:30 +01:00
Jonas Ådahl
2e5eeb6b92 gtk/window: Add 'fullscreen' prop and gtk_window_is_fullscreen()
This makes it possible to set 'fullscreen' to 'true' in a .ui file to
start an application in fullscreen mode.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
eb0eac0f03 gtk/window: Make R/O is-maximized R/W maximized prop
This makes it possible to set 'maximized' to true in .ui files, and the
window will show up maximized.

gtk_window_is_maximized() will return the intended maximized state until
actually mapped, it will then show the actual maximized state. The same
applies to reading the property.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
27077d5be8 gtk/window: Make 'default-size' adapt to configured size
This commit changes the behavior of window size computation and the
default size properties to:

 * The default-width and default-height properties are updated to the
   current window size unless the size is fixed by e.g. being maxmized,
   tiled etc.
 * The compute-size semantics are to just pick the default size, or if
   not adequate, use the measured size, and consequently update the
   default size, unless unresizable.
 * gtk_window_get_size() is removed, what's more likely relevant is the
   gtk_window_get_default_size() which will now contain more sensible
   values.

Various places that used gtk_window_get_size() were updated to use
gtk_window_get_default_size() to remember and restore previous sizes.

This also changes the default value of 'default-width' and
'default-height' from -1 to 0. The gtk builder simplify tool is taught
how to omit when the default size is set to both -1 and 0.
2020-12-07 20:37:29 +01:00
Jonas Ådahl
40a9baa2db gtk/native: Remove gtk_native_check_resize()
This is now handle by the corresponding implemenatations using per
non-gobject-type API.
2020-12-07 20:37:29 +01:00