Commit Graph

27783 Commits

Author SHA1 Message Date
Hugo Lefeuvre
adbaee796d gtkstack: fix null pointer dereference
The gtk_stack_snapshot_slide() function dereferences the
last_visible_child pointer without proper != NULL ckeck. This might
result in NULL pointer dereference and crash if last_visible_child is
invalid.

Add a != NULL check before dereferencing the pointer.

cherry-picked from https://gitlab.gnome.org/GNOME/gtk/merge_requests/361
2018-10-07 18:31:03 +01:00
Benjamin Otte
4ef082d2ed Merge branch 'wip/arnaudb/fix-dashed-border' into 'gtk-3-24'
Make dashed border-style work correctly

See merge request GNOME/gtk!349
2018-09-24 18:21:02 +00:00
Daniel Boles
ed57e564a9 SidebarRow: Set ::no-show-all on end_icon_widget
All the other conditionally visible child widgets have this. Without it,
it seems some cases can wrongly reveal it, with a nonsensical home icon.

https://gitlab.gnome.org/GNOME/gtk/issues/1345
2018-09-22 19:57:59 +01:00
Arnaud B
0feebcf145 Make dashed border-style work correctly
There’s a short-path done for focus rectangles, but it can be taken in other conditions, and then fail occasionally to render a dashed line if the border-width is too big.
2018-09-21 12:25:23 +00:00
Matthias Clasen
8fd2d461fc gtk_application_inihit: allow no reason
We document this argument as nullable, so treat it as such.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1327
2018-09-13 23:32:45 -04:00
Matthias Clasen
b1d3beedc3 Add a missing include
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1325
2018-09-12 23:02:26 -04:00
Chun-wei Fan
5d903cb094 builds: Fix introspection with MSVC builds
For building the introspection dumper program on Visual Studio, leave out
the G_LOG_DOMAIN as g-ir-scanner does not like it when it constructs the
compiler command line for Visual Studio.

Also ensure that we are looking for the freshly-built libraries by looking
for the .lib's from the output directories of the Visual Studio project files.
2018-09-11 18:13:10 +08:00
Jakub Steiner
416feacfe3 Merge branch 'adwaita-fixes-3' into 'gtk-3-24'
Adwaita: Fix errors in two recent MRs

See merge request GNOME/gtk!330
2018-09-10 19:07:26 +00:00
Adrien Plazas
f893e668c8 Adwaita: Fix sidebar separator styling
Simplify the styling of sidebar separators by not setting their borders
and margins rather than trying to drop it afterward, which was actually
not working anyway.
2018-09-10 15:05:22 +02:00
Adrien Plazas
a0acdcd08c Adwaita: Fix dropping the backgroud on nested headerbars
Make the selector less greedy to not remove the background on
non-titlebar headerbars contained in non-headerbar titlebars and only to
the ones contained in headerbar titlebars. This avoid issues in some
applications.

Also make dropping the background more agressive to actually remove it.
2018-09-10 14:54:19 +02:00
Jakub Steiner
6ab9a85ac9 Merge branch 'wip/adwaita/linked-entry-error-state-fix-3-24' into 'gtk-3-24'
Adwaita: Fix linked elements in error state

See merge request GNOME/gtk!316
2018-09-10 10:46:03 +00:00
Jakub Steiner
7e0aba77ff Merge branch 'selection-mode-ancestor-3' into 'gtk-3-24'
Adwaita: Set selection mode to headerbars if it's on ancestors

See merge request GNOME/gtk!325
2018-09-10 08:59:37 +00:00
Jakub Steiner
cbf76d4693 Merge branch 'separator-sidebar-3' into 'gtk-3-24'
Adwaita: Style separator.sidebar

See merge request GNOME/gtk!323
2018-09-10 08:59:04 +00:00
Adrien Plazas
43c458f45f Adwaita: Set selection mode to headerbars if it's on ancestors
This allows to set the container of the headerbars in selection mode
rather than having to set the mode to each element of the title bar.
2018-09-07 15:27:22 +02:00
Adrien Plazas
f0696dfae0 Adwaita: Drop the background of nested headerbars
This is needed to work around headerbar sliding animation issues without
refactoring Adwaita's support of titlebars and headerbars as it may
break applications.

https://gitlab.gnome.org/GNOME/gtk/issues/1264
2018-09-07 13:07:46 +02:00
Adrien Plazas
f9ba306116 Adwaita: Style separator.sidebar
Let separators be declared as sidebars to have the same style as those
drawn by GtkStackSidebar. This also let them handle the selection-mode
class, whether they are assigned it or they descend from something in
selection mode.

This is convenient when building a custom sidebar using a GtkSeparator
and to extend a sidebar to the title bar.
2018-09-07 12:42:26 +02:00
Matthias Clasen
47122288b8 Fix portal path handling
This was broken when I recently introduced this helper
function.
2018-09-05 19:58:03 -04:00
Jan Alexander Steffens (heftig)
3c7d5e749c
GtkApplication: Fix CRITICAL on shutdown when register_session=FALSE 2018-09-05 21:46:28 +02:00
Alex Monday
e33b93a97e themes: Fix linked elements in error state
Add instructions for color of linked elements border which ajoints
entry, when parent linked entry is in error state.
2018-09-02 14:43:13 +05:00
Matthias Clasen
813c7b19ea GtkApplication: track screensaver state
A number of applications want to track the state of the screensaver.
Make this information available as a boolean property. We only listen
for state changes when ::register-session is set to TRUE.

This is implemented for unsandboxed D-Bus access by talking
directly to org.gnome.ScreenSaver or org.freedesktop.ScreenSaver,
and for sandboxed D-Bus by using a (new) portal API.
A Quartz implementation is missing.
2018-08-30 23:17:37 -04:00
Matthias Clasen
3fc319ff1b GtkApplication: Respect GTK_USE_PORTAL
When the environment variable is set, don't connect
to the session manager, but instead rely on the
inhibit portal.
2018-08-30 23:17:37 -04:00
Matthias Clasen
f734c3d3b0 file chooser portal: use request path utilities
Less code duplication, more sticky toffee!
2018-08-30 23:10:13 -04:00
Matthias Clasen
c3077467d0 print portal: use request path utilities
Less code duplication, more cookies!
2018-08-30 23:10:13 -04:00
Matthias Clasen
e2d066a2ec color picker portal: Add request path utility
Less code duplication, more cake!
2018-08-30 23:10:13 -04:00
Matthias Clasen
6829719d6d Add utility functions for portal paths
The paths that we create for requests and sessions
need some icky code to create. Keep it in one place.
2018-08-30 23:10:13 -04:00
Kai Willadsen
5111f7af99 FileChooserWidget: Don't show recent items with private hint set 2018-08-28 20:14:16 +00:00
Matthias Clasen
aa69b3af5a Merge branch 'gtk-3-24.win.updated' into 'gtk-3-24'
Fix pre-C99 builds of the gtk-3-24 branch

See merge request GNOME/gtk!310
2018-08-28 20:10:04 +00:00
Matthias Clasen
2307f8ec67 Merge branch 'fix-warning-combobox-destroy' into 'gtk-3-24'
Fix warning on GtkComboBox destroy

See merge request GNOME/gtk!311
2018-08-28 19:27:24 +00:00
Luca Bacci
aa5d926c84 Check for NULL priv->popup_window in gtk_combo_box_popdown()
Fixes issue #125
2018-08-28 18:39:05 +02:00
Matthias Clasen
61921eba57 Fix a typo
Its Hieroglyphs!

Closes: #1292
2018-08-28 12:26:49 -04:00
Chun-wei Fan
6cf7297653 gtk/gtkeventcontrollerscroll.c: Include fallback-c89.c
... instead of just math.h, as it uses the C99 function trunc().  This
is so that the code builds on pre-C99 compilers.
2018-08-28 17:43:11 +08:00
Chun-wei Fan
723e50990f gtk/fallback-c89.c: Add C89 fallback for trunc()
Check for trunc() during configure and provide a fallback implementation
for it if it is not found.
2018-08-28 17:43:04 +08:00
Matthias Clasen
ac654740f3 Deprecate GtkRange::upper/lower-stepper-sensitivity
These properties have been removed in GTK+ 4.
Deprecate them here.
2018-08-26 18:58:59 -04:00
Benjamin Otte
da8994f941 Don't deprecate gtk_widget_show_all()
After discussions on IRC, the conclusion was reached that deprecations
only make sense if an action can be taken to not use the deprecated code
that makes the code more current and simplifies a later port to a newer
GTK version.

In this particular case, the suitable action would be adding
gtk_widget_show() calls whenever a widget is created, so that a call to
show_all() is not necessary.
However, in GTK4 these calls would not be necessary and end up just
bloating the codebase unnecessarily.

So it was decided the better solution would be to not deprecate the API
and instead leave this work to be done during potential GTK4 ports of
applications.

This reverts commit 4d71d2303d.

Fixes !1282
2018-08-22 19:48:20 +02:00
Rico Tzschichholz
2306c82df7 gesturestylus: Add missing array g-i annotation for *_get_axes params 2018-08-20 17:01:59 +02:00
Iain Lane
dce33fa830 colorpickershell: Unpack the tuple returned from PickColor()
When calling PickColor on org.gnome.Shell, we get back an "a{sv}", which
GDBus provides to us as "(a{sv})".

At the minute we're not unpacking this tuple, and so picking fails with
messages like:

  GLib-CRITICAL **: 13:38:19.439: g_variant_lookup_value: assertion 'g_variant_is_of_type (dictionary, G_VARIANT_TYPE ("a{s*}")) || g_variant_is_of_type (dictionary, G_VARIANT_TYPE ("a{o*}"))' failed

  Gtk-WARNING **: 13:38:19.439: Picking color failed: No color received

Let's unpack it.
2018-08-17 09:10:59 -04:00
Matthias Clasen
c9f875bd77 Merge branch 'fix-shifted-scrolling-gtk3' into 'gtk-3-24'
gtkscrolledwindow: Consider shift key presses when decelerating [gtk3]

See merge request GNOME/gtk!287
2018-08-15 22:02:45 +00:00
Jonas Ådahl
14d22cb323 tooltip: Implement positioning using gdk_window_move_to_rect()
In order to make tooltip positioning portable, make use of the
move_to_rect API. Some semantical changes are made, as identical
semantics cannot be implemented using the move-to-rect API.

Primarily the implemented semantics are:

Position the tooltip in the center pixels slightly below (defaults to 4
units below) the tooltipped widget. This is always the case for keyboard
driven tooltips; the case where it tries to avoid the pointer cursor is
not implemented.

For pointer position triggered tooltips, implement the following
additional semantics:

Use the current cursor size to determine the padding used to enlarge the
anchor rectangle. This is to try to avoid the cursor overlapping the
tooltip.

If the anchor rectangle is too tall (meaning if we'd be constrained
and flip on the Y axis, it'd flip too far away from the originally
intended position), rely only on the pointer position to position the
tooltip. The approximate pointer cursor rectangle is used as a anchor
rectangle. Ideally we should use the actual pointer cursor rectangle
(image used as well as hotspot coordinate), but we don't have API to
get that information.

If the anchor rectangle isn't to tall, just make sure the tooltip isn't
too far away from the pointer position on the X axis.

Closes: #134
Closes: #432
Closes: #574
Closes: #579
Closes: #878
2018-08-10 18:32:54 +02:00
Matthias Clasen
2dde4e2ff8 Merge branch 'gtk-3-24-improve-error-message' into 'gtk-3-24'
gtkplacessidebar: Improve error message when unlocking volume fails

See merge request GNOME/gtk!266
2018-08-08 09:18:32 +00:00
Matthias Clasen
6b6e53fd23 Make color picker circular
The need for center alignment was pointed out by Timm Baeder.
2018-08-05 01:50:01 +00:00
Matthias Clasen
926f25aaec color picker: Also try kwin
use a kwin color picker when we run under kwin.
2018-08-05 01:48:29 +00:00
Matthias Clasen
7e74beec5b Only use the portal color picker when appropriate
This is just moving this check around.
2018-08-05 01:47:35 +00:00
Matthias Clasen
fc44f9755a Add a kwin color picker
This uses the org.kde.kwin.ColorPicker interface.
2018-08-05 01:47:04 +00:00
Sebastian Keller
5c6596ad99 gtkscrolledwindow: Consider shift key presses when decelerating
Otherwise horizontal scrolling using the shift key would decelerate
vertically.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/770
2018-08-04 16:36:47 +02:00
Benjamin Otte
6e4da8fbdb container: Deprecate focus chains 2018-07-31 22:46:15 +02:00
Matthias Clasen
4d71d2303d Deprecate show_all apis
These functions are gone in GTK+ 4, so deprecate them here.
2018-07-31 13:32:55 -04:00
Andrea Azzarone
06800b22ff window: Fallback to CSD titlebar in focus-chain
CSD titlebar are included in the focus-chain. The logic used makes sure that the
initial focus avoids the titlebar, but tabbing around will eventually get there.
This logic fails in case the window has no other focusable widgets apart from
the ones in the header-bar. If this happens keynav focus will be lost. To handle
the above scenario, we need to fallback to focus the header-bar (if any).

Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/404
2018-07-31 02:37:12 +00:00
Matthias Clasen
9bae0758eb color picker: Better debug spew
This will help in debugging issues.
2018-07-30 18:10:27 -04:00
Matthias Clasen
7f290426dc Add a color picker implementation for gnome-shell
This adds a GtkColorPicker implementation that talks
to gnome-shell to get a color.
2018-07-30 18:10:17 -04:00
Matthias Clasen
740fc3eeff Add a color picker implementation for portals
This adds a GtkColorPicker implementation that talks
to the screnshot portal to get a color.
2018-07-30 18:10:17 -04:00