Commit Graph

31124 Commits

Author SHA1 Message Date
Daniel Boles
c9f1c56776 Adwaita: Regenerate CSS to get window.devel styles
This step was missed before, again.

SASS 3.6 emits rgba(0, 0, 0, 0) instead of transparent, so it wants to
change those too, but that patch was only committed in March and isn't
being backported to the previous stable, so I don't know if others'
versions will do the same - so until it's shown that anyone else (A) is
regenerating CSS and (B) also has 3.6, I'm skipping those changes. See:
c287f312ac
2018-09-02 09:27:38 +01:00
Matthias Clasen
2bb97bc136 GtkApplication: Improve the docs
Expand the docs for ::register-session a bit.
2018-08-31 13:38:01 -04:00
Matthias Clasen
d4d12171f4 Avoid a pointless goto
We can just return here.
2018-08-31 13:24:17 -04:00
Matthias Clasen
21e484731a Add a helpful comment 2018-08-31 13:23:25 -04:00
Matthias Clasen
b82a32676b 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 22:53:36 -04:00
Matthias Clasen
d7228ae025 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 22:53:36 -04:00
Matthias Clasen
04c02e9aec file chooser portal: use request path utilities
Less code duplication, more sticky toffee!
2018-08-30 22:53:36 -04:00
Matthias Clasen
d6945d81f0 print portal: use request path utilities
Less code duplication, more cookies!
2018-08-30 22:53:36 -04:00
Matthias Clasen
6d6559f982 color picker portal: Add request path utility
Less code duplication, more cake!
2018-08-30 22:53:36 -04:00
Matthias Clasen
b271db253f 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 22:53:36 -04:00
Jakub Steiner
72498b9e28 Merge branch 'selection-mode-separator' into 'master'
Adwaita: Add color to separator.selection-mode

See merge request GNOME/gtk!309
2018-08-30 07:40:46 +00:00
Matthias Clasen
b904fc6ee0 Add a missing cast
This fixes a warning introduced in the previous commit.
2018-08-29 19:55:58 -04:00
Matthias Clasen
3b8d206143 The file chooser is no box anymore
Don't treat it as one, it does not like it.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1297
2018-08-29 13:11:06 -04:00
Kai Willadsen
ba6c5ef201 FileChooserWidget: Don't show recent items with private hint set 2018-08-28 16:15:45 -04:00
Matthias Clasen
c3e72c4d7e Fix a typo
Its Hieroglyphs!

Closes: #1292
2018-08-28 12:24:13 -04:00
Timm Bäder
a6c47cb3ab Merge branch 'revealer-clipping' into 'master'
revealer: Only clip child when animating

See merge request GNOME/gtk!301
2018-08-28 14:49:37 +00:00
Timm Bäder
9fbcbc55d7 Revert "paned: Use a GtkIcon as separator"
This reverts commit 749ef4d71c.

The GtkIcon and GtkGizmo measure code is different, the former uses
-gtk-icon-size.
2018-08-27 18:55:31 +02:00
Timm Bäder
00a27c1e28 box: Remove gtk_box_get_size
One function to measure the box in the opposite of its internal
direction is enough.
2018-08-27 18:53:56 +02:00
Timm Bäder
f5f6597abc box: Rename avail_size to for_size everywhere
So we call it like we call it everywhere else.
2018-08-27 18:48:09 +02:00
Timm Bäder
fade0afbef box: Simplify compute_size_for_orientation 2018-08-27 18:45:03 +02:00
Adrien Plazas
a4790b7eaa Adwaita: Add color to separator.selection-mode
This makes separators to look good when separating two header bars in
selection mode.

https://gitlab.gnome.org/GNOME/gtk/issues/1286
2018-08-27 14:07:17 +02:00
Timm Bäder
911627fa0b menuitem: Remove duplicate include 2018-08-25 08:06:34 +02:00
Timm Bäder
ec576088bb picture: Fix doc typo 2018-08-25 08:06:28 +02:00
Timm Bäder
ab0b54db76 spinner: Remove private struct
Since priv->active is equivalent to the widget state being CHECKED, we
can as well use that everywhere.
2018-08-25 08:06:21 +02:00
Timm Bäder
fb51f8be9a colorswatch: Remove dead assignment 2018-08-25 08:06:18 +02:00
Timm Bäder
eb22c7c9c3 image: Fix gtkdoc property syntax 2018-08-25 08:06:14 +02:00
Timm Bäder
749ef4d71c paned: Use a GtkIcon as separator
And save a few lines that way.
2018-08-25 08:06:11 +02:00
Timm Bäder
f6fae1dd09 menubutton: Remove outdated line
.menu-button is not a style class we use anywhere.
2018-08-25 08:06:07 +02:00
Timm Bäder
f21abba82f renderborder: Remove unused function 2018-08-25 08:06:03 +02:00
Timm Bäder
bf222a9292 renderborder: Pull some locals into the closest scope
Especially the bounds graphene_rect_t, which is unused in the
non-border-image case.
2018-08-25 08:05:57 +02:00
Timm Bäder
96e465b6d9 checkbutton: Remove snapshot implementation
It just does when the default GtkWidget implementation does anyway:
snapshot all child widgets
2018-08-25 08:05:52 +02:00
Timm Bäder
016de68ceb radiobutton: Save signal IDs like everything else 2018-08-25 08:05:48 +02:00
Timm Bäder
d2178bcb94 fixed: Remove unused struct member 2018-08-25 08:04:43 +02:00
Ernestas Kulik
f40eb8a1fe revealer: Only clip child when animating
Currently, GtkRevealer clips the child if the transition type is
sliding, regardless of whether the animation had already ended. An
example where that is a problem would be in Nautilus: the file
operations popover button is animated on reveal to draw attention, but,
given that the button is in turn stashed inside a revealer with a
sliding animation, things suddenly fall apart.
2018-08-23 11:13:36 +03:00
Matthias Clasen
9e0f43e8cb entry completion: Avoid critical warnings
We must not call move-to-rect unless we have
a transient parent.
2018-08-20 19:15:27 +00:00
Matthias Clasen
3e4d7250a0 Merge branch 'fix-shifted-scrolling' into 'master'
gtkscrolledwindow: Consider shift key presses when decelerating

Closes #770

See merge request GNOME/gtk!286
2018-08-20 18:26:28 +00:00
Rico Tzschichholz
4ebd14c045 gesturestylus: Add missing array g-i annotation for *_get_axes params 2018-08-20 16:57:54 +02:00
Matthias Clasen
a32fb5b849 Merge branch 'kill-subsurface' into 'master'
Kill subsurfaces

See merge request GNOME/gtk!299
2018-08-19 03:50:40 +00:00
Matthias Clasen
eed19c9269 Move tools to a subdirectory
A small step towards splitting up gtk/
2018-08-19 03:41:25 +00:00
Matthias Clasen
a7aed5af4b Drop gtk_window_set_use_subsurface
This is no longer used.
2018-08-18 23:24:59 -04:00
Matthias Clasen
220a51e7cb entry completion: stop using subsurfaces
Instead, use a popup and gdk_surface_move_to_rect.
I have not tried to reproduce all details of the old
positioning logic, but moving the popup above/below
the entry works as before.
2018-08-18 23:24:53 -04:00
Jonas Ådahl
6df28420d7 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-19 01:26:20 +00:00
Timm Bäder
ce9ce8a5bc menu: Remove key_controller member
Unused.
2018-08-18 20:54:29 +02:00
Timm Bäder
2322f38bf9 menu: Remove initially_pushed_in flag
Unused.
2018-08-18 20:54:29 +02:00
Timm Bäder
dcb6c9b4cf menu: Remove seen_item_enter flag
Unused.
2018-08-18 20:54:29 +02:00
Timm Bäder
afdeffd820 menu: Remove have_position flag
It's always FALSE.
2018-08-18 20:54:29 +02:00
Timm Bäder
10439aaefe menu: Remove an unnecessary gtk_widget_destroy() call
The unref will already properly free the menu item's resources.
2018-08-18 20:54:29 +02:00
Matthias Clasen
d13cd9cb67 Merge branch 'fix-shell-colorpicker' into 'master'
colorpickershell: Unpack the tuple returned from PickColor()

See merge request GNOME/gtk!296
2018-08-17 12:35:46 +00:00
Matthias Clasen
79b87cc543 print portal: don't leak window handles
Pointed out by Christian Persch.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1274
2018-08-15 23:21:15 +00:00
Matthias Clasen
3c2aceba63 print portal: Plug a memory leak
Pointed out by Christian Persch.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1271
2018-08-15 23:13:15 +00:00
Matthias Clasen
a01feae15b Use defines for bus names
This helps eradicate typos (we had some here).

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1267
2018-08-15 15:54:34 -07:00
Matthias Clasen
b4d4f73d9f Merge branch 'sort' into 'master'
updateiconcache: Sort list of entries

See merge request GNOME/gtk!297
2018-08-15 22:00:13 +00:00
Matthias Clasen
c1de6219ed font chooser: Remove an unneeded ifdef
We can just always create the axes hashtable.
2018-08-15 14:52:37 -07:00
Bernhard M. Wiedemann
b364827a5b updateiconcache: Sort list of entries
because filesystem readdir order is indeterministic.

Without this patch, building openSUSE's balsa package
had variations between builds in /usr/share/balsa/icon-theme.cache
2018-08-15 03:15:14 +02:00
Iain Lane
08f32c6560 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-13 13:52:41 +01:00
Yi-Soo An
b3c8c8e592 window: Fix memory leak
https://gitlab.gnome.org/GNOME/gtk/issues/1268
2018-08-13 17:21:42 +09:00
Matthias Clasen
ff6c4ed07e Merge branch 'gtk-4-improve-error-message' into 'master'
gtkplacessidebar: Improve error message when unlocking volume fails

See merge request GNOME/gtk!267
2018-08-07 10:01:09 +00:00
segfault
61f50f2410 gtkplacessidebar: Improve error message when unlocking volume fails 2018-08-05 18:59:40 +02:00
Timm Bäder
ab30850aad widget: Rename width and height member to {width,height}_request
Because that's much closer to the meaning of those values.
2018-08-05 10:22:11 +02:00
Timm Bäder
f5e04b59e9 main: Pass toplevel_widget directly to GtkWidget API
We already have the toplevel as GtkWidget: toplevel_widget.
2018-08-05 10:22:10 +02:00
Timm Bäder
c67bcf09b9 sizerequestcache: Inline out-var assignments
The additional assignment to the old result variable just adds an
indirection even though we know the point where we assign it in all
cases. Just pass the values out and return in those cases instead.
2018-08-05 10:22:10 +02:00
Timm Bäder
5eba0bc932 widgetprivate: Remove useless prototype
We implement that function lower down in that header file.
2018-08-05 10:22:10 +02:00
Timm Bäder
ff2ba52bc6 pathbar: Remove priv pointer 2018-08-05 10:22:10 +02:00
Timm Bäder
a822d6fce9 menuitem: Don't redraw unnecessarily
The gtk_widget_(un)set_state_flags calls before will do this if
necessary.
2018-08-05 10:22:10 +02:00
Timm Bäder
b749fe4270 menu: Use correct content height 2018-08-05 10:22:10 +02:00
Timm Bäder
933cb857cf menu: Allocate children according to scroll_offset
This was done by simply moving the bin_window before but now we have to
do it ourselves.
2018-08-05 10:22:10 +02:00
Timm Bäder
dde535bbdf levelbar: Don't return a double value from a gboolean function 2018-08-05 10:22:10 +02:00
Timm Bäder
71b36db88d acitonbar: Remove snapshot implementation 2018-08-05 10:22:10 +02:00
Timm Bäder
b5576397f7 modelbutton: Remove snapshot implementation
Previously, GtkBin was only snapshot'ing its one and only child, but
nowadays it doesn't implement snapshot at all and the default
implementation in GtkWidget just snapshots all child widgets, which is
exactly what the implementation in gtkmodelbutton.c was doing.
2018-08-05 10:22:10 +02:00
Matthias Clasen
4e86858405 Make color picker circular
The need for center alignment was pointed out by Timm Baeder.
2018-08-04 21:42:28 -04:00
Sebastian Keller
14b21d78db 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:24:33 +02:00
Ernestas Kulik
94162197a1 sidebarrow: Hide busy_spinner by default
Since the original implementation was likely based on GTK+ 3, the change
in default visibility might have not been considered, which results in
all rows suddenly sporting a visible spinner when opening a fresh file
chooser.
2018-08-03 13:29:07 +03:00
Matthias Clasen
8669d31c30 color picker: Also try kwin
use a kwin color picker when we run under kwin.
2018-08-02 20:55:07 -04:00
Matthias Clasen
e76d17a786 Only use the portal color picker when appropriate
This is just moving this check around.
2018-08-02 20:54:21 -04:00
Matthias Clasen
5ab90f1a80 Add a kwin color picker
This uses the org.kde.kwin.ColorPicker interface.
2018-08-02 20:53:37 -04:00
Georges Basile Stavracas Neto
5596feae9b listbox: Store child iter in a variable when removing
Unparenting a GtkListBoxRow can drop its last reference, which
will free its memory. Right after unparenting, though, we were
accessing the row's iter - which assumes that the row is still
alive. This causes a crash when, for example, binding two or
more models to the listbox.

Fix that by storing the iter in a variable, and not trying to
access it after unparenting. After unparenting, the variables
that are potentially garbage were explicitly assigned NULL for
clarity.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1258
2018-08-02 10:24:12 -03:00
Benjamin Otte
50d5666db0 container: Remove focus chains
They're prectically unused.

Widgets who want to influcence the focus chain behavior should implement
GtkWidgetClass::focus and deal with focus there.
2018-07-31 22:34:27 +02:00
Benjamin Otte
e06044530f widgetfocus: Fix copy/paste error
This lead to erratic focus behavior with <Tab> in hboxes, where the
smallest child got focus first instead of the leftmost child.
2018-07-31 22:34:27 +02:00
Benjamin Otte
7ce7e5503f colorpicker: Fix gcc warning 2018-07-31 22:34:27 +02:00
Benjamin Otte
1129febd7d bindings: Remove GTK_TYPE_IDENTIFIER
bindings now treat identifiers and strings the same way.

The only difference was that one allowed lookup of enum/flags by name
while the other didn't and g_warning()ed. Now both work.
2018-07-31 06:46:36 +02:00
Matthias Clasen
47928b9e14 color picker: Better debug spew
This will help in debugging issues.
2018-07-30 18:12:14 -04:00
Benjamin Otte
03a6420c37 treeview: Fix compiler warning 2018-07-30 19:58:38 +02:00
Benjamin Otte
813957a92f gdk: Remove gdk_event_get_string()
You want to use an IM module to get strings out of keypresses, not some
crude hack that only works on X11 and Wayland anyway.
2018-07-30 19:32:38 +02:00
Mohammed Sadiq
76ed6cf9d8 colorpickerportal: Fix memory leak 2018-07-30 18:10:31 +05:30
Carlos Garnacho
a8c6f222ed inspector: Remove unnecessary cast
Pointed out by Timm.
2018-07-30 14:21:22 +02:00
Matthias Clasen
c5afea0c6b Merge branch 'gtk-4-add-spinner-to-sidebar-row' into 'master'
gtkplacessidebar: Show busy spinner in sidebar row during mount ops

See merge request GNOME/gtk!261
2018-07-30 12:04:05 +00:00
Carlos Garnacho
71762d3b28 gtkscrolledwindow: Use controller for motion capturing
Perform scrollbar visibility checks through a motion controller,
always based on GtkScrolledView-relative coordinates. The captured
event handler remains though, for a tiny bit of GDK_SCROLL event
handling.
2018-07-30 13:14:12 +02:00
Carlos Garnacho
f15224926a gtkwindow: Replace captured event handler with motion controller 2018-07-30 13:14:12 +02:00
Carlos Garnacho
6d3eb18578 gtktreeview: Use key controller on search entry handling
Use a distinct key controller so we correctly handle navigation
across matches and search cancellation. As the events are forwarded
to the search_window, those need to be pushed down the entry manually.
2018-07-30 13:14:12 +02:00
Carlos Garnacho
d301695ba1 gtktreeview: Replace event vmethod with key controller 2018-07-30 13:14:12 +02:00
Carlos Garnacho
ca8008e2c9 gtkcombobox: Use keycontroller on GtkCellEditable implementation 2018-07-30 13:14:12 +02:00
Carlos Garnacho
0d7b4ecb14 gtkentry: Use keycontroller on GtkCellEditable implementation 2018-07-30 13:14:12 +02:00
Carlos Garnacho
9a541d9b91 inspector: Use gestures/controllers for inspect button 2018-07-30 13:14:12 +02:00
Carlos Garnacho
cdfde6673d gtkcombobox: Use controller to handle combobox keybindings in menus
Instead of an ::event callback.
2018-07-30 13:14:12 +02:00
Matthias Clasen
7ef95734af Merge branch 'fix-gs-issue-404' into 'master'
window: Fallback to CSD titlebar in focus-chain

Closes gnome-software#404

See merge request GNOME/gtk!271
2018-07-30 10:53:22 +00:00
Jakub Steiner
f8a971a7df Adwaita: devel style
- nightly/development versions of apps should get a styled
  headerbar.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/142
2018-07-30 12:09:41 +02:00
Andrea Azzarone
e1a7629a85 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-30 09:30:26 +02:00
Matthias Clasen
7d3b8b0d09 treeview: Get rid of child surfaces
Drop the drag-highlight and drag surfaces. The highlighting
is broken anyway, so just drop it for now. And for dragging
the header button, we can just position it properly, that
works just as well as this reparenting approach.
2018-07-29 15:23:41 -04:00
Matthias Clasen
8f95a5980e Remove an outdated comment
We no longer have semi-private headers.
2018-07-29 08:45:34 -04:00
Christian Hergert
002e48c469 imwayland: fix potential leak of attr list
This fixes a potential leak of a PangoAttrList that is set when chaining
up to the parent get_preedit_string(). We check to see if the attr list
was created and reuse it instead of leaking the previous value.
2018-07-28 10:54:14 -07:00
Matthias Clasen
f3f32b47cc Merge branch 'wip/gtk-menu-popup-no-more' into 'master'
Remove legacy GtkMenu popup APIs

See merge request GNOME/gtk!270
2018-07-27 18:57:24 +00:00
Matthias Clasen
16171a232a Add a color picker implementation for gnome-shell
This adds a GtkColorPicker implementation that talks
to gnome-shell to get a color.
2018-07-27 14:23:20 -04:00
Matthias Clasen
031b5cad46 Add a color picker implementation for portals
This adds a GtkColorPicker implementation that talks
to the screnshot portal to get a color.
2018-07-27 14:23:20 -04:00
Matthias Clasen
984274497d color editor: Add a color picker button
The button is shown if we have a GtkColorPicker implemenation.
Currently, there are none, so the button is never shown.
2018-07-27 14:23:20 -04:00
Matthias Clasen
0cc0714312 Add a color picker interface
This will be used in the color chooser, in subsequent commits.
2018-07-27 14:23:19 -04:00
Matthias Clasen
c8be597b7f Bring back gtk-orientation icons
These are used in the page setup dialog, so we can't
just drop them.
2018-07-27 13:35:29 -04:00
Jonas Ådahl
4497ac7d75 menu: Remove legacy popup APIs
Remove gtk_menu_popup_for_device() and gtk_menu_popup(), as they cannot
be implemented in a portable manner by all backends. They have been
deprecated for proper alternative APIs for some time, so lets remove
them now before its too late.

While at it, fix the example documentation for mapping a menu.
2018-07-27 17:16:44 +02:00
segfault
791da76ae1 gtkplacessidebar: Show busy spinner in sidebar row during mount ops 2018-07-27 16:44:50 +02:00
Matthias Clasen
d398c00d20 Fix up the resource generation for icons
The script was looking in the wrong subdirectories.
2018-07-27 09:08:27 -04:00
Matthias Clasen
cb247276f5 Add emoji category icons
This is a temporary measure to make the check-icon-names
test not fail in ci. We still have to figure out the best
way to include a core icontheme with GTK+.
2018-07-27 08:05:55 -04:00
Matthias Clasen
c6141dffd2 Keep picking up icons as resources
We may need to revisit this at some point. For now,
keep the mechanism in place.

This is a partial revert of 806c659efe.
2018-07-27 08:05:55 -04:00
Alcaro
a1a6e6a36a doc: Fix there/their typo 2018-07-27 02:28:45 +00:00
Ernestas Kulik
6adaf7c33d Remove GDestroyNotify casts in g_clear_pointer() uses
GLib master propagates argument types in g_clear_pointer(), which causes
the usual function pointer casts to GDestroyNotify to trip compiler
warnings. Additionally, this commit changes some cleanup functions where
appropriate (wl_data_source_destroy ->
gtk_primary_selection_source_destroy for struct
gtk_primary_selection_source).
2018-07-25 10:05:39 +03:00
Benjamin Otte
95a4eff6ba render: Make gtk_render_icon() use the snapshot API
This removes a lot of duplicated code.
2018-07-24 20:55:45 +02:00
Benjamin Otte
9675c99043 render: Make gtk_render_frame() and gtk_render_focus() use the snapshot API
This removes a lot of duplicated code.
2018-07-24 20:55:45 +02:00
Benjamin Otte
76d0e1e398 API: Remove gtk_render_frame_gap()
That function does not make sense at all in a CSS world. So better don't
support it anymore.
2018-07-24 20:55:45 +02:00
Benjamin Otte
14408b7485 render: Make gtk_render_background() use the snapshot API
This removes a lot of duplicated code.
2018-07-24 20:55:45 +02:00
Benjamin Otte
2a11baf6ea render: Make gtk_render_check/arrow/handle() use the snapshot API
This removes a lot of duplicated code.
2018-07-24 20:55:45 +02:00
Benjamin Otte
51d40ca023 render: Make gtk_render_layout() use the snapshot API
This removes a lot of duplicated code.
2018-07-24 20:55:45 +02:00
Benjamin Otte
5f7e093168 gtk: Move GtkGesture declaration to gtktypes.h
That way, headers can use the gesture type without having to include
gtkgesture.h
2018-07-24 20:55:45 +02:00
Ernestas Kulik
d88268c142 gtkpopovermenu: Conditionally chain up in gtk_popover_menu_add()
Otherwise the stack gets parented to the wrong widget and the contents
are never drawn.
2018-07-23 13:01:01 +03:00
Ernestas Kulik
49ae68c2c7 gtkpopovermenu: Drop call to gtk_widget_show()
The stack is already visible.
2018-07-23 13:00:11 +03:00
Benjamin Otte
447b166ed3 Merge branch 'wip/muktupavels/remove-gtk-css-provider-get-default' into 'master'
gtkcssprovider: remove gtk_css_provider_get_default

See merge request GNOME/gtk!256
2018-07-20 14:03:51 +00:00
Matthias Clasen
806c659efe Drop unused old icons
We don't need to ship the deprecated old stock-id named
icons and the drag cursors - we don't use them from resources
anyway.
2018-07-20 08:06:07 -04:00
Matthias Clasen
827219e214 Emoji chooser: Also check for hex boxes
We don't want to see those either.
2018-07-19 17:57:19 -04:00
Matthias Clasen
5c9b25c66e moji chooser: Try harder to avoid fallback
We don't want to see any fallback rendering.
The current check was still letting some fallback
combinations through.

Based on work by Julian Sparber.
2018-07-19 17:50:54 -04:00
Matthias Clasen
37e4ae2fbd Quiet a compiler warning
We don't need to handle GDK_CONFIGURE here, so make the
compiler not warn about it.
2018-07-19 17:48:06 -04:00
Matthias Clasen
849ffebc21 Emoji chooser: Use icons for sections
This is more reliable than using text-style Emoji
which may not be present.

Based on work by Julian Sparber.
2018-07-19 17:47:50 -04:00
Alberts Muktupāvels
7a8f5ca970 gtkcssprovider: remove gtk_css_provider_get_default
This function is unused since cdc6e82720 commit and does not
contain fallback style.

https://gitlab.gnome.org/GNOME/gtk/issues/1226
2018-07-19 19:25:17 +03:00
Ernestas Kulik
4b2d63167e placessidebar: Take a GdkDrag in _set_drop_targets_visible()
Since the function is usually called from GtkWidget::drag-{begin,end} handlers,
taking a GdkDrop does not work, especially given that
::drag-action-requested is emitted without checking the type.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1220
2018-07-17 19:19:14 +03:00
Timm Bäder
6fe0a8c6b3 gesturestylus: Clarify a documentation comment
Use the proper gtkdoc syntax for signals.
2018-07-17 17:33:47 +02:00
Timm Bäder
04eb7eef29 Remove icon extents API 2018-07-17 17:33:47 +02:00
Timm Bäder
480a2c2770 widget: Remove another ->priv usage 2018-07-17 17:33:47 +02:00
Timm Bäder
f699fff6e0 sizerequest: Pull locals into closest scope 2018-07-17 17:33:47 +02:00
Timm Bäder
4bc145549d Correctly mark an enum value in a doc comment 2018-07-17 17:33:47 +02:00
Timm Bäder
cf7fa931d3 sizerequest: Only check reported baselines if requested
If the passed-in store locations for the baselines are NULL anyway, we
don't need to check the reported baselines for correctness.
2018-07-17 17:33:47 +02:00
Timm Bäder
3f126c7fc8 Remove GTK_CSS_AFFECTS_CLIP
Clips don't exist anymore and this flag is unused outside of the style
property definitions in gtkcssstylepropertyimpl.c
2018-07-17 17:33:47 +02:00
Timm Bäder
960717b273 window: Don't queue an allocate if the css clip changes
clips don't exist anymore.
2018-07-17 17:33:47 +02:00
Matthias Clasen
bf5f27c6d5 Handle configure events in gdk
The previous attempt at removing configure events entirely
was causing some dialogs not to show up under Wayland.
Presumably due to ordering issues with emitting ::size-change
out of the backend.

Instead, keep configure events in the event queue, but handle
them on the gdk side. This keeps the ordering intact, while
still removing configure events from the api. The dialogs
show up now.
2018-07-15 20:23:45 -04:00
Matthias Clasen
7a1073c3ae Revert "gdk: Drop configure events"
This reverts commit a8926c9d87.
2018-07-15 20:23:45 -04:00
Matthias Clasen
d148f26658 Drop gdk_surface_withdraw
'withdrawn' is an X11-centric concept, and the function
can just as well be replaced by gdk_surface_hide.
2018-07-15 15:29:58 -04:00
Matthias Clasen
7ca6440f4d gdk: Drop map events
We are really inconsistent about generating these,
and they are not actually used in GTK+. Instead,
add a boolean GdkSurface::mapped property.
2018-07-15 15:10:56 -04:00
Matthias Clasen
da3aaf39b9 gdk: Drop expose events
Replace expose events with a GdkSurface::expose signal.
This is part of the move to use events only for input.
2018-07-15 13:13:07 -04:00
Matthias Clasen
a8926c9d87 gdk: Drop configure events
Replace configure events with a GdkSurface::size-changed signal.
This is part of the move to use events only for input.
2018-07-15 11:51:09 -04:00
Matthias Clasen
443f8ddf6b popover: Drop some dead code
This will be done differently, using xdg-popup instead
of subsurfaces, so no point in keeping this.
2018-07-15 08:18:08 -04:00
Matthias Clasen
6a7de806dd text display: correct a comment 2018-07-14 13:50:14 -04:00
Benjamin Otte
cbb1e74bb5 textview: Only create cairo context in gtktextdisplay.c
Everything else is done using GtkSnapshot now, including renaming the
draw_layer vfunc to snapshot_layer.
2018-07-14 05:27:54 +02:00
Benjamin Otte
4456b06853 window: Update opaque region if background-color changes
The opaque region is only set when the background color is opaque. So
we need to do something about it when the background color changes.

However, in the case where a size allocation is going to happen, we
already do this update in size_allocate(), so in that case avoid doing
it twice.
2018-07-13 14:56:04 +02:00
Benjamin Otte
88af7b44aa textview: Use snapshot on the sidebars 2018-07-13 14:56:04 +02:00
Benjamin Otte
a7cd1918a8 widgetpaintable: Add a hack to make recursion not infloop
Makes the GUADEC talk not crash that I'm supposed to give in 20 minutes.
2018-07-13 14:56:04 +02:00
Benjamin Otte
bcfd1bbd24 widgetpaintable: Redo implementation
Instead of instantly invalidating, we now cache the old render node and
do the update in an idle handler.
While that gives us a 1 frame delay, it avoids all the tricky things
like queueing resizes while resizing or queueing draws while drawing.

The only remaining issue (and a *big* one at that) is that a nested
widget paintable will now cause the widget to snapshot its previous
render node when creating a new one. And that one will snapshot its
previous render node, and that one will...
And nothing so far breaks this recursion.
2018-07-13 14:56:04 +02:00
Matthias Clasen
b94c3166bf dnd: Rename gtk_drag_begin_with_coordinates
Now that the coordiate-less variant is gone,
rename this back to the shorter gtk_drag_begin.
2018-07-12 13:02:42 +02:00
Daniel Boles
7030e08f9c Merge branch 'master' into 'master'
HighContrast: Restore expander size

Closes #1046

See merge request GNOME/gtk!167
2018-07-09 17:28:49 +00:00
Timm Bäder
d41603d82a aboutdialog: Remove priv pointer 2018-07-08 21:50:59 +02:00
Timm Bäder
f7aff03c72 layout: Remove priv pointer 2018-07-08 21:50:59 +02:00
Timm Bäder
9959ea98cd Revert "snapshot: merge container nodes"
This reverts commit 622a150bb4.
2018-07-08 21:50:59 +02:00
Timm Bäder
a6920855ea Implement GtkInspectorLayoutOverlay
To properly replace the old "show layout borders" option.
2018-07-08 11:26:12 +02:00
Timm Bäder
c85e2401fa treeview: Fix column visibility check
This is still fallout from the bin_window removal. We aren't moving the
GdkWindow/GdkSurface anymore so we have to account for the scrolling
ourselves.
2018-07-08 10:32:12 +02:00
Timm Bäder
6fdcafc94a treeview: Move column header widgets when scrolling
Since those are widgets and widgets need to be size-allocate'd properly,
we need to queue an allocate, as well as actually add the hadjustment's
value to the column x position.

Fixes #1202
2018-07-08 10:04:27 +02:00
Timm Bäder
9bab218314 aspectframe: Remove priv pointer 2018-07-08 10:02:43 +02:00
Timm Bäder
2854635850 scalebutton: Remove priv pointer 2018-07-08 09:41:15 +02:00
Timm Bäder
a976aa9740 searchbar: Ignore key presses when unmapped
The purpose of a searchbar is to start a search on visible widgets when
a key is pressed. Starting a search on e.g. a stack page that is not
visible at all is not very useful.
2018-07-08 09:41:15 +02:00
Timm Bäder
074eb2a19d accellabel: Add newline between consecutive if statements 2018-07-08 09:41:15 +02:00
Timm Bäder
93c688cd93 range: Remove has_origin flag
It's equivalent to the highlight_widget being !NULL.
2018-07-08 09:41:15 +02:00
Timm Bäder
53afc4a9d9 dialog: Remove priv pointer 2018-07-08 09:41:15 +02:00
Timm Bäder
c96077590b dialog: Remove some GtkVBox references 2018-07-08 09:41:15 +02:00
Timm Bäder
6e47d0bf4a GtkSeparatorToolItem: Remove draw flag
We can as well query the current value of the flag using
gtk_style_context_has_class.
2018-07-08 09:41:15 +02:00
Timm Bäder
50b79ae0ab GtkSeparatorToolItem: Remove priv pointer 2018-07-08 09:41:15 +02:00
Timm Bäder
6b4709ea3c GtkApplication: Remove priv pointer 2018-07-08 09:41:15 +02:00
Timm Bäder
f3a83abb54 colorswatch: Remove priv pointer 2018-07-08 09:41:15 +02:00
Timm Bäder
33166b7357 render: Remove gtk_render_slider
The only thing it was doing is render background and frame, which you
get from using a widget for your slider anyway.
2018-07-08 09:41:15 +02:00
Timm Bäder
bb31ce1168 renderborder: Remove some unused API 2018-07-08 09:41:15 +02:00
Timm Bäder
dbf32933bf main: Don't look at first GTK_DISPLAY_DEBUG_CHECK parameter...
... if none of the debug displays have any debug flags set. This way, we
can ignore the first parameter to e.g. GTK_DISPLAY_NOTE, which is
usually a call to gtk_widget_get_display.

Before this patch, gtk_widget_get_display was the slowest part of
gtk_widget_query_size_for_orientation.
2018-07-08 09:41:15 +02:00
Timm Bäder
af8fe182c8 Fix a few documentation warnings 2018-07-08 09:41:15 +02:00
Timm Bäder
da8050979e fixed: Remove child list
Use the child widget list from GtkWidget and attach x/y positions via a
qdata.
2018-07-05 19:08:19 +02:00
Timm Bäder
4dd1ff6dd2 GtkLayout: Remove freeze_count member
Unused.
2018-07-05 19:08:19 +02:00
Timm Bäder
8c403c43f0 spinbutton: Keep GParamSpecs around
notify_by_pspec is more efficient and this way the source file is more
in line with the others.
2018-07-05 19:08:19 +02:00
Kjell Ahlstedt
6c8988e445 gtkprinter: Make gtk_printer_get_hard_margins_for_paper_size() public
The declaration in gtkprinter.h shall be preceded by GDK_AVAILABLE_IN_ALL,
or else the function can't be used in application programs.

Closes #1140
2018-07-04 18:40:33 +02:00
Benjamin Otte
93c5455796 iconhelper: Plug memleak 2018-07-04 15:04:04 +02:00
Benjamin Otte
3ca59b8701 css: Don't do indirections
We don't need to look up the property by name to query its ID when we
know the ID already because it's inside an enum.
2018-07-04 06:15:33 +02:00
Benjamin Otte
fba0b359d4 css: Report sizes as absolute
All PangoFontDescriptions that GTK creates now use
pango_font_description_set_absolute_size().
2018-07-04 06:15:33 +02:00
Benjamin Otte
e1b6496af7 image: size request is always CONSTANT_SIZE
It's always -gtk-icon-size in both directions, even for paintables.
There's no width-for-height happening.
2018-07-04 06:15:33 +02:00
Daniel Boles
14620423e8 themes: Restore default progressbar min sizes
The min size on the oriented axis used to come from style props with
default values in the source file, used if the theme did not provide a
min size in CSS. When the style props were removed, so was any notion of
a minimal size for proressbars' main axis, meaning that now progressbars
without expand or any other source of min size were just tiny specks.

The right place to do that was always the theme, so in our themes now,
fix that by copying the old default values for the style properties; see:

https://gitlab.gnome.org/GNOME/gtk/issues/1191#note_259393
https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/gtkprogressbar.c#L92

The result should be the same in that (A) the min size is now what it is
in GTK+ 3 & (B) an app/user can override the theme exactly the same way.

Close https://gitlab.gnome.org/GNOME/gtk/issues/1192
2018-07-03 18:55:31 +01:00
Daniel Boles
55a1f8ccfd HC: merge dupe selectors; linebreaks for legibility 2018-07-03 18:55:17 +01:00
Matthias Clasen
12464731f1 Merge branch 'dnd-cleanups' into 'master'
Dnd cleanups

See merge request GNOME/gtk!226
2018-07-02 21:19:45 +00:00
Daniel Boles
269a9d8528 Adwaita: Drop some unneeded overrides
The pseudoclasses work fine on the subnodes without having to also apply
`parent:class subnode`.
2018-07-02 22:04:35 +01:00
Daniel Boles
c892d2767a Adwaita: Regenerate CSS for text handle overhaul
Commit b3e91b7111 forgot this.
2018-07-02 22:04:35 +01:00
Daniel Boles
51981d562b ScrolledWindow: a couple of spelling/grammar fixes
(A) Put a space in "scrolled window" like the other doc comments
(B) Say "i.e." rather than "ie."
(C) Fix grammar from "makes [...] exactly reaches" to "exactly reach"
2018-07-02 20:14:41 +01:00
Daniel Boles
51b77a425a ScrolledWindow: Fix/improve doc of key bindings
Saying 'key + modifiers' is really weird, so reverse that, and explain
why there are 2 cited and what the difference between them is.
2018-07-02 20:14:41 +01:00
Daniel Boles
ae3163b5e0 ScrolledWindow: Add missing apostrophes 2018-07-02 20:14:41 +01:00
Matthias Clasen
7733f646d6 gdk: Rename GdkDragContext to GdkDrag
This is to go along with the newly introduced GdkDrop.

This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 14:59:26 +02:00
Ernestas Kulik
fd69f1cd79 eventcontrollerkey: Document key-pressed and key-released
None of the GtkEventControllerKey signals are documented; this commit
adds documentation for a couple of them.
2018-07-02 12:18:26 +03:00
Matthias Clasen
d9dcfffce3 Merge branch 'wip/aplazas/modelbutton-markup-master' into 'master'
ModelButton: Add 'use-markup' property

See merge request GNOME/gtk!222
2018-06-29 14:21:24 +00:00
Benjamin Otte
f3c670ab0c widget: Move opactiy == 0 check
If we check it too early, we will not unset priv->draw_neeeded, which
will then cause queue_draw() calls to not have an effect later. And that
causes changes in opacity to not register.

Closes #1180
2018-06-27 21:50:07 +02:00
Adrien Plazas
0abd01e288 ModelButton: Add 'use-markup' property
Binds this property to the button's label, allowing a model button to
have text with markup.

This will be convenient for buttons like 'Online Accounts <sup>↗</sup>'.
2018-06-27 17:43:47 +02:00
Emmanuele Bassi
73d736d800 Do not modify a const GdkEvent in place
When deciding whether or not to emulate a press event, we're translating
the last event coordinates and mutating the given event structure
unconditionally.

We should modify the newly created GdkEvent copy, since it's what we're
going to use when emitting the press event.

This avoids mutating a constant GdkEvent and global state, and also
avoids a compiler warning.
2018-06-26 18:06:23 +01:00
Matthias Clasen
88b4076fe5 Docs: Remove more since markers
The idea is that GTK+ 4 will be an epoch, API-wise.
Everything that was around for 4.0 has been there
since the beginning of the epoch and doesn't need
markers.
2018-06-26 12:31:41 -04:00
Matthias Clasen
36396093e6 docs: Document GtkEventControllerKey
The long description was missing.
2018-06-26 12:20:47 -04:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Michael Catanzaro
7869ffbb49 imwayland: Fix a small leak
If the parent get_preedit_string implementation returns a nonnull
zero-length string, then we ignore it, which is almost fine. We have to
free it, though.

Fixes #1174
2018-06-25 22:20:09 +01:00