Commit Graph

36693 Commits

Author SHA1 Message Date
Matthias Clasen
c4d350c260 build: Start using meson feature options
Use feature options for things that are optional features,
update the docs.

Visible changes here is that the 'print-backends' option
got renamed to 'print' to go better with 'media', and the
'tracker3' option got renamed to 'tracker'.

For options that have been changed into features, the
syntax now is -Dfeature=enabled or -Dfeature=disabled
or -Dfeature=auto.
2020-08-23 16:45:15 -04:00
Matthias Clasen
54e4bf8b75 Fix a leak in the font chooser widget
Contrary to what you may expect, pango_attr_font_desc_new()
is not transfer full, it makes a copy of the font description.
2020-08-23 16:45:15 -04:00
Jakub Steiner
a498aca3ab Adwaita: error labels insensitive & backdrop states
- address colored labels for the two states

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063#note_891618
2020-08-22 10:14:11 -04:00
Matthias Clasen
4eacfdba60 Merge branch 'remove-unnecessary-frames' into 'master'
Remove unnecessary frames from some widgets

See merge request GNOME/gtk!2462
2020-08-22 14:09:35 +00:00
nana-4
6a7a0f0b8a viewport: Remove unused frame
We've always removed this with Adwaita.
2020-08-22 09:30:28 +09:00
nana-4
1948f8a07f placessidebar: Remove unused frame
We've always removed this with Adwaita.
2020-08-22 09:23:52 +09:00
nana-4
8eb807d7f4 entrycompletion: Remove unnecessary frame
The popover already has a border as a frame. Don't create double
borders.
2020-08-22 09:18:31 +09:00
Matthias Clasen
125ed52ccb Merge branch 'new-sysprof' into 'master'
Port profiling to sysprof-collector api

See merge request GNOME/gtk!2457
2020-08-21 23:58:09 +00:00
Matthias Clasen
7a9501b1fb Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2461
2020-08-21 22:36:45 +00:00
Matthias Clasen
f00e2e2146 inhibit: Pass valid arguments when Inhibiting
When we pass "" as reason, gnome-session responds
with a "Reason not specified" error. So, send
"Reason not specified" instead. Its true.
2020-08-21 17:40:36 -04:00
Matthias Clasen
ab5e62ddab Merge branch 'matthiasc/for-master' into 'master'
layoutmanager: Fix the child-widget property

Closes #3080

See merge request GNOME/gtk!2460
2020-08-21 20:45:53 +00:00
Matthias Clasen
865b29500c layoutmanager: Fix the child-widget property
We were setting the child-widget property to the parent.
Oops.
2020-08-21 14:29:14 -04:00
Matthias Clasen
ed67d9c103 Merge branch 'codespell-changes' into 'master'
*: Fix spelling mistakes found by codespell

See merge request GNOME/gtk!2459
2020-08-21 17:32:12 +00:00
Matthias Clasen
d4e069a629 Port tracing to the sysprof collector api
Use the new sysprof collector api to do tracing.
2020-08-21 10:55:01 -04:00
Matthias Clasen
a416650f6b application: Drop support for profiler activation
Drop support for the org.gnome.Sysprof3.Profiler
D-Bus interface. It is not really used, and if
we don't expose it, we can simplify our profiler
infrastructure.
2020-08-21 10:55:01 -04:00
Matthias Clasen
e5d088208a Merge branch 'fontconfig-speedup' into 'master'
Trigger fontconfig initialization early

See merge request GNOME/gtk!2454
2020-08-21 14:49:31 +00:00
Björn Daase
6315cd977c *: Fix spelling mistakes found by codespell 2020-08-21 15:29:34 +02:00
Jason Francis
2437622b5f
builder-tool: Rewrite GtkBox
Rewrite expand/fill properties on GtkBox to
hexpand/halign/vexpand/valign on the child widget.

Rewrite GtkVBox and GtkHBox to GtkBox, setting the orientation
property.

Added a test for boxes.
2020-08-20 23:41:29 -04:00
Jakub Steiner
dd2e1e4867 Merge branch 'wip/jimmac/rich-list-styling' into 'master'
Adwaita: rich-list styling

See merge request GNOME/gtk!2456
2020-08-20 20:58:31 +00:00
Jakub Steiner
5f630481db Adwaita: rich-list styling
FIXME: why is the second list in Demo>List Box>Controls taller?

https://gitlab.gnome.org/GNOME/gtk/-/issues/3073
2020-08-20 19:39:18 +02:00
nana-4
e07827e976 frame: Set GTK_OVERFLOW_HIDDEN
It doesn't really make sense for the frame to allow drawing children
outside of it.
2020-08-20 22:24:36 +09:00
Matthias Clasen
a674832658 Trigger fontconfig initialization early
Add a pango call to create the fontmap already in gtk_init.
This will let us hide the cost of FcInit() (which on font-heavy
systems can be ~100ms) in a thread, on the pango side.
2020-08-19 22:12:00 -04:00
Matthias Clasen
2031bcd388 Merge branch 'replace-hardcoded-margins' into 'master'
tooltip & placessidebar: Replace hard-coded margins with theme

See merge request GNOME/gtk!2444
2020-08-20 00:30:37 +00:00
Timm Bäder
ec81ccd5f9 label: Try to avoid a pango_layout_get_extents call
Measuring text is quite expensive, so only do this if really necessary.
2020-08-19 16:14:59 -04:00
Jakub Steiner
aabb713594 Adwaita: error labels insensitive & backdrop states
- address colored labels for the two states

See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063#note_891618
2020-08-17 10:00:29 +02:00
nana-4
19c2cc1296 placessidebar: Replace hard-coded margins with theme
So we can easily adjust the widget sizing in the theme.
2020-08-15 22:46:31 +09:00
nana-4
9b42edbef4 tooltip: Replace hard-coded margins with theme
So we can easily adjust the widget sizing in the theme.
2020-08-15 22:46:31 +09:00
Matthias Clasen
303e023c36 Merge branch 'gtkassistant_docstring' into 'master'
gtkassistant: Minor docstring wording changes

See merge request GNOME/gtk!2442
2020-08-15 12:49:29 +00:00
nana-4
667b3b117d pathbar: Set .slider-button style class to slider buttons again
This was set in the .ui file that no longer exists, so we need to set it
again here.
2020-08-15 18:31:32 +09:00
Holger Knust
cb7c903594 gtkassistant: Minor docstring wording changes
Changed the wording to improve the clarity of the documentation. Fixed grammar issue ("spllited")
2020-08-15 05:20:03 -04:00
Matthias Clasen
fa0a88ae22 Merge branch 'api-touchups' into 'master'
Api touchups

See merge request GNOME/gtk!2439
2020-08-14 12:47:50 +00:00
Jakub Steiner
131e2f6e43 Adwaita: error labels and entries
See https://gitlab.gnome.org/GNOME/gtk/-/issues/3063
2020-08-14 14:13:37 +02:00
Matthias Clasen
ae7cefd97d Drop style class defines
We document the supported style classes by name,
not by macro name, and these macros don't really
add any value. Drop them for GTK 4.
2020-08-14 07:03:27 -04:00
Matthias Clasen
35708162cc Make GtkNativeInterface private
We are not sure yet if allowing out-of-tree
implementations of GtkNative are a good idea.
2020-08-14 07:03:27 -04:00
Matthias Clasen
e48a1d2df0 Merge branch 'list-styles' into 'master'
Implement and document list styles

See merge request GNOME/gtk!2421
2020-08-13 21:15:22 +00:00
Jakub Steiner
f4561d3fd5 Adwaita: rich-list rows
- add whitespace to match the existing look
2020-08-13 16:30:22 -04:00
Jakub Steiner
c5963b960a Adwaita: fix focus for .navigation-sidebar 2020-08-13 16:30:22 -04:00
Matthias Clasen
b49fd47276 Adwaita: Fix hover in navigation sidebars
The placessidebar gets this from somewhere else, but
it wasn't working in the gtk-demo sidebar, so add it
explicitly. placessidebar specific styles should be
dropped from Adwaita as much as possible, but not
doing that here.
2020-08-13 16:30:22 -04:00
Jakub Steiner
bdb1d87859 Adwaita: style rich-list and data-table
- style special list types
- add navigation-sidebar too

https://gitlab.gnome.org/GNOME/gtk/-/issues/2929
2020-08-13 16:30:22 -04:00
Matthias Clasen
0279e1c76b inspector: Use the new list style classes
Set .rich-list and .data-table on lists, as appropriate.
2020-08-13 16:30:21 -04:00
Matthias Clasen
cce3ff6f04 placessidebar: Use the .navigation-sidebar style class 2020-08-13 16:30:21 -04:00
Matthias Clasen
221786dda3 lists: Mention list style classes in docs
Document that GtkListView, GtkColumnView and GtkListBox
support .rich-list, .navigation-sidebar and .data-table
style classes.
2020-08-13 16:30:21 -04:00
Matthias Clasen
ea887959bd textbuffer: Some more insert_with_attributes speedup
There is no need for use to collect tags in an array;
we can just insert them into the text buffer right away.
2020-08-13 12:36:39 -04:00
Antoine Jacoutot
b4508be3c9 OpenBSD: don't include malloc.h
This header doesn't exist anymore on recent OpenBSD releases.
2020-08-13 17:48:34 +02:00
Matthias Clasen
88dcd2597a Speed up gtk_text_buffer_insert_markup
Instead of blindly creating new tags for every attribute,
reuse existing tags. For the syntax highlighting of the
ui file of the cursors demo, this gets us down from
20.000 tags to 6.
2020-08-12 22:51:59 -04:00
Matthias Clasen
e0b95c6234 Merge branch 'wip/smcv/roaring-license' into 'master'
Add attribution and licensing information for "roaring bitmaps" code

See merge request GNOME/gtk!2408
2020-08-11 16:02:25 +00:00
Alexandre Franke
e16d108b68 Fix a string 2020-08-11 14:05:58 +00:00
Matthias Clasen
823219d429 Merge branch 'button-claim-clicks' into 'master'
button: Claim click events

Closes #3054

See merge request GNOME/gtk!2425
2020-08-10 22:24:50 +00:00
Matthias Clasen
17710709f9 window: Fix an oversight
Commit 658719a205 moved the call to
gtk_window_compute_default_size() outside the
if (priv->needs_default_size)
but unfortunately, that function cleared that field,
so we never entered the branch.

Keep the setting of priv->needs_default_size in the
branch, where it belongs.
2020-08-10 12:53:41 -04:00
Matthias Clasen
6fafc8b811 button: Claim click events
This fixes issues with double activation on clicks.

Fixes: #3054
2020-08-09 22:58:22 -04:00
Matthias Clasen
2bf9ae005f Adwaita: Small improvement for dropdown
Put some space between the arrow and the text.
This was noticable in the new listbox2 demo.
2020-08-09 15:43:46 -04:00
Matthias Clasen
473ed75ed5 Adwaita: be careful with list separators
We only want the list .separators class to affect its
immediate children - otherwise, we end up with separators
in dropdowns that are places into button strips. As a side
benefit, restricting this to immediate children makes for
faster matching.
2020-08-09 12:01:08 -04:00
Matthias Clasen
75ad180c78 textutil: Do a little better on retro X servers
When running on a non-composited, non-rgba X server
(such as Xnest), force the drag icons for text selections
to have a background, so we don't end up with black
text on black background.

Fixes: #3048
2020-08-08 18:33:56 -04:00
Matthias Clasen
765fe201ce inspector: Avoid a crash
I've seen the inspector crash when running on an
X server without an xsettings manager around. Better
be safe.
2020-08-08 18:33:56 -04:00
Matthias Clasen
3469c639f6 bookmarksmanager: Load bookmarks initially
This was broken in 1e6171a4a7.
2020-08-08 18:33:56 -04:00
Matthias Clasen
c6a7b39ee1 Remove deprecation guards around gtk_window_present
It is not deprecated anymore.
2020-08-08 14:49:50 -04:00
Matthias Clasen
dbbc9b5c58 placessidebar: Fix dnd cancellation
When the drag is canceled by being dropped outside,
we get a ::cancel emission, that we want to handle
just like ::dnd-finished.

Fixes: #3037
2020-08-08 14:26:31 -04:00
Matthias Clasen
e18de295c6 placessidebar: Fix the bookmark drag icon
Just use the widget; a paintable only works if the
widget it is based on actually gets drawn, the
clone we create here wasn't.
2020-08-08 14:24:45 -04:00
Matthias Clasen
4eaf08e964 placessidebar: Fix bookmarks dnd
We were not handling drops of bookmarks correctly,
leading to criticals during DND.

Fixes: #3037
2020-08-08 14:11:29 -04:00
Matthias Clasen
2d5b44703c placessidebar: We're not a listbox anymore
The placessidebar used to derive from GtkListBox,
but it doesn't anymore. There was one case leftover,
leading to criticals during bookmark DND.
2020-08-08 14:11:29 -04:00
Matthias Clasen
19c6ef38fe bookmarksmanager: Load bookmarks initially
This was broken in 1e6171a4a7.
2020-08-08 14:11:29 -04:00
Simon McVittie
95cd8c1eb9 Move roaring bitmaps code to gtk/roaring/ and add a README
As suggested by Matthias Clasen on gtk!2408. This keeps the
Apache-licensed stuff together.

As per the discussion on gtk!2408 and gtk!2409, replacing this with
upstream CRoaring is specifically not supported by the GTK maintainers.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-08-08 18:30:41 +01:00
Simon McVittie
bef86d48af roaring.[ch]: Add attribution and licensing information
OS distributions that take copyright and licensing seriously will tend
to become concerned about source files that appear to come from a
third party and do not come with copyright/licensing information,
and stating that these files are modified is required by clause 4(b)
of the Apache license.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-08-08 18:27:37 +01:00
Matthias Clasen
d1d269ea6b Merge branch 'patch-1' into 'master'
Correct typos in gtktextbtree.c

See merge request GNOME/gtk!2413
2020-08-08 17:05:25 +00:00
Matthias Clasen
3d807f4b00 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3047, #3034, #3038, and #3036

See merge request GNOME/gtk!2416
2020-08-08 16:27:27 +00:00
Matthias Clasen
9654fff6e0 Merge branch 'scroll-to-cursor' into 'master'
Scroll to cursor after canceling a selection

Closes #2960

See merge request GNOME/gtk!2321
2020-08-08 16:18:19 +00:00
Matthias Clasen
8a67899e0f bookmarksmanager: Ignore delete events
Surpisingly, when a monitored file gets atomically replaced
with g_file_set_contents(), the file monitor reports a
DELETED event for the temp file, which is not the file
I'm monitoring.

Just ignore DELETED events.

Fixes: #3036
2020-08-08 11:48:32 -04:00
Matthias Clasen
3faa7feb7c label: Disable unavailable actions
Fixes: #3034
2020-08-08 11:48:32 -04:00
Matthias Clasen
c6fdfeae7e about dialog: remove unnecessary guards
We decided to undeprecate gtk_window_present,
so no deprecation guards needed.
2020-08-08 11:48:32 -04:00
Felix Yan
f8060b859d Correct typos in gtktextbtree.c 2020-08-08 09:29:08 +00:00
Matthias Clasen
0c0ced1374 Merge branch 'activatable-colorswatch-style' into 'master'
Adwaita: Limit color swatch's hover effect to .activatable

See merge request GNOME/gtk!2411
2020-08-08 03:09:30 +00:00
Christian Hergert
4d88e3af17 popover: allow setting popup layout offset
Currently there is no way to alter the offset of the popup when positioning
with GdkPopupLayout. This makes using the popup difficult for scenarios
like completion windows where you may need to offset the window by a given
amount for aligning text.

gtk_popover_set_offset() allows setting these values and are analagous to
the function of the same name for GdkPopupLayout.
2020-08-07 17:10:52 -07:00
nana-4
b694771728 colorbutton: Remove .activatable style class from the color swatch
The button itself is activatable, but its color swatch is not.
2020-08-08 08:37:33 +09:00
nana-4
51d6ec5131 Adwaita: Limit color swatch's hover effect to .activatable
Non-activatable color swatches shouldn't have the interactive effect.
2020-08-08 08:33:38 +09:00
Matthias Clasen
95e2a2b4b3 Merge branch 'leak-fixes' into 'master'
Leak fixes

See merge request GNOME/gtk!2406
2020-08-07 20:29:02 +00:00
Matthias Clasen
4e774eddb9 Merge branch 'wip/chergert/fix-textview-yrange-invalidation' into 'master'
linedisplaycache: improve invalidation with y_range

See merge request GNOME/gtk!2407
2020-08-07 20:17:22 +00:00
Christian Hergert
35325ea11a linedisplaycache: improve invalidation with y_range
When we invalidate a y_range using the common pattern of y==0 and
old_height==new_height, we are generally invalidating the entire buffer.

This short-circuits that case to just invalidate the buffer in a faster
and more complete form. The problem here appears to be that we can't
always calculate the ranges properly to invalidate because validation
has not run far enough.
2020-08-07 12:44:26 -07:00
Matthias Clasen
5673310364 textbuffer: Fix a leak
gtk_text_buffer_insert_markup was leaking all the tags
that it inserts.
2020-08-07 15:26:11 -04:00
Matthias Clasen
1ccab92813 Merge branch 'matthias/fix-min-size' into 'master'
Matthias/fix min size

See merge request GNOME/gtk!2404
2020-08-07 18:46:24 +00:00
Matthias Clasen
f6d9e15c16 window: Don't set min_size > size
This fixes the failing reftest.
2020-08-07 13:55:02 -04:00
Jakub Steiner
96500816bc Adwaita: add public color for text views
- define @text_view_bg to complement @theme_text_color for high
  contrast legible text views.

Fixes https://gitlab.gnome.org/GNOME/vte/-/issues/226
2020-08-07 18:58:32 +02:00
Jakub Steiner
9d60047616 Adwaita: force circular imagebuttons to be square
Addresses https://gitlab.gnome.org/GNOME/gnome-clocks/-/merge_requests/123#note_884741
2020-08-07 18:57:45 +02:00
Ondrej Holy
517a34bdc8 gtkmountoperation: Drop the new line character when splitting a message
When asking for a password, the message string is split on primary
and secondary if it contains a newline character. However, the newline
character is currently part of both strings, which creates weird
spacing between the GtkLabels. I suppose this is bug, which was not
visible as in most cases (if not all) the message string hasn't
contained the new line characters so far. But we are going to change
that now, see GNOME/gvfs!82. Let's drop the new line character similarly
as it is done when asking for a question, or showing processes in order
to fix the weird spacing.
2020-08-07 10:37:19 +02:00
Jonas Ådahl
658719a205 gtk/window: Fix min size calculation
It should always use "preferred" size, not any remembered or otherwise
computed one, otherwise we won't be able to shrink to the preferred size.
2020-08-07 10:18:32 +02:00
Matthias Clasen
85c713127e aboutdialog: Make margins more uniform
Use similar margins in the Credits and System tabs.
2020-08-06 22:18:14 -04:00
Benjamin Otte
052962a760 treeview: Use gtk_snapshot_append_border()
No need to construct the node manually.
2020-08-07 02:52:22 +02:00
Matthias Clasen
a712ffa2ab widgetpaintable: Clear an idle in dispose
We were not removing the pending_update idle
in dispose, which is at least suspicious, if
not deadly. Move the idle cleanup code into
unset_widget(), which we are already calling
in dispose().
2020-08-06 20:02:33 -04:00
Matthias Clasen
c13d70479b gridview: Work around unexpected focus changes
As things currently stand, we get events for focus changes
before the widget is allocated, and try to scroll in response.
Therefore, leaving n_columns at 0 until size-allocate leads
to plenty of division-by-zero. Just set it to 1 initially
to avoid that. This is a workaround for #3025.
2020-08-06 14:35:19 -04:00
Carlos Garnacho
bb3675b3c7 gtkspinbutton: Claim button gestures when starting to spin
The gesture should be acknowledged by the spin button, in order to
guarantee it will also receive the button release.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3016
2020-08-06 00:01:34 +02:00
Carlos Garnacho
36711b6691 gtkbutton: Don't claim gesture till emission
That means waiting till button release.
2020-08-06 00:01:18 +02:00
Carlos Garnacho
dc8adcda0e gtkgesture: ::cancel if a claimed sequence goes denied
The regular paths just emit ::end, which isn't the whole thing.
This gives an opportunity to gestures that are stolen the sequence
to clean themselves up.
2020-08-06 00:01:18 +02:00
Christian Hergert
5ff2b8535f textview: properly remove anchored widgets
Fixes #3021
2020-08-05 14:08:07 -07:00
Matthias Clasen
6dfd92b191 aspectframe: Fix use in ui files
GtkAspectFrame code assumes that its child will be in
self->child, but that is only the case if we arrange
for <child> in ui files to end up calling
gtk_aspect_frame_set_child(). Therefore, implement
GtkBuildable.

Fixes: #3020
2020-08-05 14:05:47 -04:00
Matthias Clasen
d7c4f93c76 Merge branch 'wip/compute-size' into 'master'
Compute size via signal

See merge request GNOME/gtk!2325
2020-08-05 16:19:19 +00:00
Matthias Clasen
df19049dde inspector: Stop showing settings bindings
We were playing fast-and-loose with private GIO data
when showing settings bindings in the property editor,
and this was causing crashes.

We can show this information again if GIO ever gets
api to introspect it.

Fixes: #3015
2020-08-05 11:11:58 -04:00
Jonas Ådahl
2ff74eb667 gdk/toplevel: Negotiate surface size via a compute-size signal
GTK will not up front know how to correctly calculate a size, since it
will not be able to reliably predict the constraints that may exist
where it will be mapped.

Thus, to handle this, calculate the size of the toplevel by having GDK
emitting a signal called 'compute-size' that will contain information
needed for computing a toplevel window size.

This signal may be emitted at any time, e.g. during
gdk_toplevel_present(), or spontaneously if constraints change.

This also drops the max size from the toplevel layout, while moving the
min size from the toplevel layout struct to the struct passed via the
signal,

This needs changes to a test case where we make sure we process
GDK_CONFIGURE etc, which means we also needs to show the window and
process all pending events in the test-focus-chain test case.
2020-08-05 15:49:00 +02:00
Matthias Clasen
d44d9ad40d Adwaita: Reduce the solid csd borders
Reduce the borders we draw ourselves for solid csd
to 1 pixel. It still doesn't look great, but at least
it doesn't look outright broken.

Fixes: #2997
2020-08-05 08:47:00 -04:00
Matthias Clasen
e60d6f70bf Merge branch 'drop-accel-label' into 'master'
Drop accel label

See merge request GNOME/gtk!2368
2020-08-05 03:44:43 +00:00
Matthias Clasen
8562c623d3 Drop GtkAccelLabel
We no longer use this widget anywhere.
2020-08-04 23:05:18 -04:00
Matthias Clasen
2b8aeed4d8 Drop GtkCallback
It is no longer used in any of our public APIs.
2020-08-04 22:24:33 -04:00
Matthias Clasen
ce89f1eda1 selectionfiltermodel: Drop a leftover symbol
We decided not to do new_for_type() for list model
wrappers, so this function does not exist.
2020-08-04 22:11:34 -04:00
Matthias Clasen
f561000124 docs: Clean up many dangling links
In many cases, these were references to no longer
existing api, so some rewording was necessary.
2020-08-04 22:11:34 -04:00
Matthias Clasen
0e1afbbdad Merge branch 'popoverflow' into 'master'
popover: Set overflow: hidden

Closes #3012

See merge request GNOME/gtk!2365
2020-08-04 15:47:50 +00:00
Matthias Clasen
d6e352e862 popover: Set overflow: hidden
This keeps overlay scrollbars from wrecking our
nice rounded corners.

Fixes: #3012
2020-08-04 11:10:49 -04:00
Matthias Clasen
f7eb5f8897 a11y: Don't do unnecessary work
Only serialize all the attributes if we are actually
going to print them.
2020-08-04 11:02:00 -04:00
Matthias Clasen
7398323b82 scrolledwindow: Fix a11y support code
This error was introduced by me in 971ee2d28a
and causes a crash in the scrolling benchmark in gtk-demo.

Fixes: #3014
2020-08-04 11:00:32 -04:00
Jonas Ådahl
cebe469898 gtk/window: Don't remember size from GdkSurface
If we're maximized, and try to remember the non-maximized size, we'd
still get the maximized size.
2020-08-04 15:04:24 +02:00
Matthias Clasen
e818e98187 Merge branch 'pagesetup-leftover' into 'master'
Pagesetup leftover

See merge request GNOME/gtk!2362
2020-08-04 03:47:13 +00:00
Matthias Clasen
942a90cd64 pagesetupdialog: Fix leftover tree model code
This was overlooked when the rest of the dialog
was ported to use list models.
2020-08-03 20:25:00 -04:00
Matthias Clasen
20c1fb0a0a docs: Tweak documentation for list widgets
Fix numerous cases of : vs :: for signal references,
add some more details here and there.
2020-08-03 18:43:25 -04:00
Matthias Clasen
7972dc8776 docs: Unify docs around incremental operations
Sync up the wording around incremental filtering
and sorting to be more similar.
2020-08-03 18:43:25 -04:00
Matthias Clasen
7cb0dd9039 docs: Fix signal references
It is :: for signals, : for properties, | for actions.
2020-08-03 18:43:25 -04:00
Alex
c8d51a7b98 show: remove obsolete comment
g_app_info_launch_default_for_uri supports x-scheme-handler directly since at least 2.27.1, released almost 10 years ago.

Link: https://bugzilla.gnome.org/show_bug.cgi?id=631410
Link: 9b262f1c5f
2020-08-03 15:36:36 +00:00
Matthias Clasen
83682d919f treeview: Don't react to clicks on cell editables
We need to let these pass through, otherwise we
interfere with the entries that are used for editing.

Fixes: #3008
2020-08-03 07:51:09 -04:00
Matthias Clasen
348a38a876 textview: Make insert-emoji replace the selection
This is the expected behavior, and matches what
GtkText does.

Fixes: #2996
2020-08-02 20:48:14 -04:00
Matthias Clasen
0d98bab82b Merge branch 'filechooser-completions' into 'master'
filechooser: Prevent over-eager completions

Closes #2995

See merge request GNOME/gtk!2347
2020-08-03 00:23:28 +00:00
Matthias Clasen
992c5fade7 Merge branch 'wip/chergert/gtk4-textview-fix-selections' into 'master'
textlinedisplaycache: short-circuit y_range invalidation

Closes #2975

See merge request GNOME/gtk!2348
2020-08-03 00:23:13 +00:00
Christian Hergert
94d17a6809 textlinedisplaycache: short-circuit y_range invalidation
If we have a y==-1 then we are generally invalidating the whole textview.
For this case, we can just discard the entire GtkTextLineDisplay cache.

Fixes #2975
2020-08-02 16:35:50 -07:00
Matthias Clasen
9605e49fbf filechooser: Prevent over-eager completions
We don't want the completions to pop up after we call
gtk_file_chooser_set_current_name(). This used to be
handled by gtk_entry_set_text() blocking the completion
signal handler. We don't have that anymore, so block
popup completion around the call to gtk_editable_set_text()
instead.

Fixes: #2995
2020-08-02 19:18:11 -04:00
Matthias Clasen
71be1751c6 builder-tool: Rewrite top/left-attach
Rewrite the GtkGrid:top/left-attach child properties
to the GtkGridLayoutChild:row/column layout properties.

Update expected test output to match.
2020-08-02 17:58:03 -04:00
Matthias Clasen
ed13e6a41e grid layout: Rename some properties
Rename GtkGridLayoutChild:left-attach/top-attach to
GtkGridLayoutChild:column/row. Update all users.

Fixes: #2967
2020-08-02 17:58:03 -04:00
Matthias Clasen
4340f75304 textbuffer: Fix a test failure
The previous change to gtktextbuffer.c was breaking
the textiter testcase.
2020-08-02 17:23:26 -04:00
Matthias Clasen
0add626822 textbuffer: Be careful with tags when copying
We can only insert tags in the buffer if they come
from the same GtkTextTagTable as the buffer uses.
If that is not the case, paste the text without tags.

Fixes: #2991
2020-08-02 13:54:06 -04:00
Matthias Clasen
793ea05f4a Merge branch 'text-drag-select' into 'master'
textview: Only claim the event when appropriate

Closes #2999

See merge request GNOME/gtk!2344
2020-08-02 17:45:30 +00:00
Matthias Clasen
c959f9c701 textview: Only claim the event when appropriate
Don't claim the event unconditionally for the click gesture,
since we may want to start a drag selection.

Fixes: #2999
2020-08-02 13:32:37 -04:00
Matthias Clasen
f8a303b0e5 popovermenu: Avoid a critical
While we guarantee that the widget that a controller
is attached to stays around while it is handling an event,
the same is not true for the root that the widget belongs
to. In corner cases (such as clicking "Close" in the
fallback window menu), it may already be gone.
Avoid a critical in that case.

Fixes: #2998
2020-08-02 13:09:00 -04:00
Matthias Clasen
ddda963f81 Merge branch 'selectable-label-draw' into 'master'
label: Redraw when focus changes

See merge request GNOME/gtk!2342
2020-08-02 16:40:12 +00:00
Matthias Clasen
9bf50e5650 Merge branch 'linked-button-fixes' into 'master'
Adwaita: Add linked styling for particular button widgets

Closes #2939 and #1903

See merge request GNOME/gtk!2339
2020-08-02 16:39:59 +00:00
Matthias Clasen
1c8471c38f label: Redraw when focus changes
When focus changes in a selectable label, we need to
redraw to make the text caret (dis)appear.
2020-08-02 12:11:38 -04:00
Matthias Clasen
17208ca7fa Go back to keeping a list of event controllers
This reverts 4b9e5304cc. It caused a number of regressions,
such as event controller ordering changes.
2020-08-02 12:01:06 -04:00
Matthias Clasen
1c16cb751f Revert "Add gtk_widget_prepend_controller"
This reverts commit 692cc42e10.
2020-08-02 12:01:06 -04:00
Matthias Clasen
127612d213 Revert "entry completion: Make keynav work again"
This reverts commit 53a30eaa12.
2020-08-02 12:01:06 -04:00
Matthias Clasen
888a65c1fb shortcutswindow: Clear search entry on unmap
Otherwise, the search term will linger around until
somebody clicks the search button again.

Fixes: #2981
2020-08-02 09:33:52 -04:00
nana-4
891027f0c3 Adwaita: Add linked styling for particular button widgets
Those button widgets need some special linked styling like what
combobox has.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1903
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2939
2020-08-02 19:14:26 +09:00
nana-4
5f00675de4 appchooserbutton: Set a CSS name
Otherwise it has a CSS name "widget".
2020-08-02 18:26:40 +09:00
Matthias Clasen
d17e51df06 Merge branch 'inspector-device-details' into 'master'
inspector: Introspect enum values

See merge request GNOME/gtk!2338
2020-08-02 03:25:33 +00:00
Matthias Clasen
0d608c492d inspector: Introspect enum values
Stop hardcoding arrays with names for enum values.
This has bitten us repeatedly as these enums were
changed around; time to stop doing it.
2020-08-01 23:05:24 -04:00
Matthias Clasen
e0c7d7daeb menusectionbox: Avoid a critical warning
The popover may already be gone when the item
is activated. Don't trigger a critical in that
case.

Related: #2986
2020-08-01 22:03:41 -04:00
Matthias Clasen
64ed69c56f label: Be more selective when selecting on focus-in
We don't want to select on focus-in when the focus
comes from a child. The case where this does harm
is when you activate copy or paste actions from the
context menu. We close the menu before triggering the
action, and if that causes the text in the label to
be selected, unexpected things happen, since the action
applies to the current selection.

This is the equivalent of cd9f5733b3 for GtkLabel.
2020-08-01 22:01:52 -04:00
Matthias Clasen
74662776d4 togglebutton: Don't crash on click
The code used to do
if (parent_class->clicked)
  parent_class->clicked (...)
That is pointless because the parent_class never changes,
so there' no need for that if and commit 415946eb0f
took it out. Unfortunately, p arent_class->clicked is NULL
though, so the whole call needs to go.
2020-08-01 20:09:05 -04:00
Timm Bäder
41b458fba7 Fix and improve various code samples 2020-08-01 20:01:04 +02:00
Timm Bäder
f716daa483 aboutdialog: Fix a code sample
gdk_texture_new_from_file takes a GFile these days.
2020-08-01 19:30:31 +02:00
Timm Bäder
415946eb0f togglebutton: Modernice source file
Make this a little less ancient looking.
2020-08-01 19:24:54 +02:00
Timm Bäder
65b79d2585 Avoid refering to old GtkContainer API in the docs 2020-08-01 15:34:59 +02:00
Timm Bäder
e976825342 button: Use g_object_notify_by_pspec() 2020-08-01 15:34:07 +02:00
Timm Bäder
b489a1f6b5 stack: Allow NULL names
Does this work?
2020-08-01 15:27:13 +02:00
Timm Bäder
2f65459fcc stack: Only compare page names if the new page has one 2020-08-01 15:26:53 +02:00
Timm Bäder
f5af18738b listbox: Add _append
To have easy replacement API for gtk_container_add.
2020-08-01 15:26:28 +02:00
Timm Bäder
b37b85333d adwaita: Reset popover background in backdrop
Otherwise it inherits the generic background color from .background

Fixes #2766
2020-08-01 10:34:04 +02:00
Timm Bäder
76f2396764 popover: Use gtk_widget_add_css_class 2020-08-01 10:31:38 +02:00
Timm Bäder
547842e7f0 window: Keep titlebar after main child
Fixes #2949
2020-08-01 09:30:48 +02:00
Timm Bäder
ebaea07286 inspector: Avoid some failing casts
We might be inspecting a non-widget here, so can't just cast that.
2020-08-01 08:59:46 +02:00
Timm Bäder
0822de1971 textview: Only show "insert emoji" menu item if editable
Fixes #2974
2020-08-01 08:59:46 +02:00
Timm Bäder
bf24da0d80 inspector: Add a type check
We only connect to this signal if sl->obejct is a GtkAccessible, so only
disconnect from it on the same condition.

Fixes #2980
2020-08-01 08:59:41 +02:00
Rico Tzschichholz
d1cab4fbdd gtk: Add annotations to improve GIR API 2020-07-31 20:56:36 +02:00
Matthias Clasen
fc31f3d629 placesview: Keep up with GLib deprecations
We were using deprecated GBookmarkFile api here too.
2020-07-31 12:54:57 -04:00
Matthias Clasen
72e14bd6dd recentmanager: Keep up with GLib deprecations
All the time_t based apis in GBookmarkFile have
been deprecated; use GDateTime instead. This
changes a few GtkRecentManager APIs.
2020-07-31 12:18:47 -04:00
Matthias Clasen
99bb8bb3f7 numericsorter: Ignore deprecations
We use g_value_get_char here; replacing it with
g_value_get_schar is not entirely trivial, so just
ignore deprecations for now.
2020-07-31 11:36:03 -04:00
Matthias Clasen
ff42c94174 gtkicontheme: Stop using GTimeVal
It has been deprecated and the deprecation warnings
break our -Werror build in ci.
2020-07-31 11:22:16 -04:00
Matthias Clasen
8c66e2ff66 widget: Drop unnecessary includes
We don't need to include gobjectnotifyqueue.c anymore,
since style properties are gone. This should fix the
build with -Werror.
2020-07-31 10:34:37 -04:00
Matthias Clasen
62803c19f5 Merge branch 'focus-active' into 'master'
Focus active

Closes #2390

See merge request GNOME/gtk!2324
2020-07-30 17:50:54 +00:00
Matthias Clasen
643d873f47 eventcontrollerkey: Update im focus when active window changes
Use the new GTK_CROSSING_ACTIVE crossing events to update
the im context focus when the window becomes active or
inactive. IBus requires this, since it has only a single,
global focus location.

Fixes: #2390
2020-07-30 13:23:45 -04:00
Matthias Clasen
b0d40403e1 window: Emit GTK_CROSSING_ACTIVE crossing events
Emit crossing events when the active window changes.
We don't want to emit GTK_CROSSING_FOCUS events, since
every window has its own focus location (focus does not
jump from window to window), so we use the new
GTK_CROSSING_ACTIVE type of crossing event for this.
2020-07-30 13:22:26 -04:00
Matthias Clasen
12170acf46 Define GTK_CROSSING_ACTIVE
Document the different crossing event kinds that we use,
and add GTK_CROSSING_ACTIVE. We are going to use it in
the future when the active window changes.
2020-07-30 13:21:28 -04:00
Carlos Garnacho
96452a2e46 gdk: Rename gdk_seat_get_physical_devices() to gdk_seat_get_devices()
We don't want to tell what they are, and the distinction is now less
clear. Remove the adjective from the function name.
2020-07-30 18:44:40 +02:00
Carlos Garnacho
2f792396d7 gtkimcontext: Avoid gdk_device_get_associated_device()
Query the seat for that.
2020-07-30 18:30:13 +02:00
Carlos Garnacho
6730b26b43 gtktextview: Avoid gdk_device_get_associated_device()
Query the seat for that.
2020-07-30 18:30:13 +02:00
Carlos Garnacho
6e83d1f54e gtkwindowhandle: Avoid gdk_device_get_associated_device()
Query the seat for that.
2020-07-30 18:19:44 +02:00
Carlos Garnacho
fb9db7fede gtkdragsource: Avoid gdk_device_get_associated_device()
Query the seat for that.
2020-07-30 18:19:44 +02:00
Benjamin Otte
4dc2ab61c9 Merge branch 'wip/otte/geometry' into 'master'
Some GdkGeometry cleanups

See merge request GNOME/gtk!2322
2020-07-30 15:31:27 +00:00
Benjamin Otte
13d3afa56e Remove unused GDK_HINT_POS 2020-07-30 17:06:15 +02:00
Benjamin Otte
3dd0e6d0b1 Remove gravity from GdkGeometry
It's always northwest
2020-07-30 17:06:15 +02:00
Benjamin Otte
11db6ad574 Remove aspect ratio from GdkGeometry
It's unused.
2020-07-30 17:06:15 +02:00
Benjamin Otte
b12b06e917 gdk: Remove base_size and increment from GdkGeometry
It's unused.
2020-07-30 16:55:45 +02:00
neyfag
a27c3039d0 Scroll to cursor after canceling a selection 2020-07-30 15:52:57 +02:00
Rico Tzschichholz
f02a17805e a11y: Fix typo in GtkATContext::state-changed docs 2020-07-30 09:06:49 +02:00
Matthias Clasen
e8026e29b6 Merge branch 'surface-cleanup' into 'master'
Surface cleanup

See merge request GNOME/gtk!2317
2020-07-30 03:43:30 +00:00
Matthias Clasen
abf8cbeaea a11y: Set an accessible role for GtkLevelBar
Use the 'meter' role for GtkLevelBar, and set the
appropriate properties.

Update the docs and add a test.
2020-07-29 22:46:00 -04:00
Matthias Clasen
c0de580d46 a11y: Set an accessible role for GtkExpander
Use the button accessible role for GtkExpander
and set attributes as appropriate.

Update the documentation and add a test.
2020-07-29 22:46:00 -04:00
Matthias Clasen
144114bf40 a11y: Set accessible role for GtkLinkButton
Set the accessible role for GtkLinkButton to button.
We don't use the 'link' role since ARIA says "if it
behaves like a button, use 'button'".

Update docs and add a test.

This changes should not be neccessary, since
GtkLinkButton derives from GtkButton, see #2965.
2020-07-29 22:46:00 -04:00
Matthias Clasen
c68fe1053a a11y: Set an accessible role for GtkTextView
Use the text-box accessible role for GtkTextView
and set properties as appropriate.

Update the documentation and add a test.
2020-07-29 22:46:00 -04:00
Matthias Clasen
4d012a6d95 Rename gdk_surface_queue_expose
We don't have expose events anymore; instead, there
is a ::render signal. So rename queue_expose to
queue_render to match.

Update all callers.
2020-07-29 22:40:01 -04:00
Jonas Ådahl
c7c71137b2 gdk/monitor: Remove gdk_monitor_work_area and GdkMonitor::work-area
It's not a portable API, so remove it. The corresponding backend
specific functions are still available, if they were implemented, e.g.
gdk_macos_monitor_get_workarea() and gdk_x11_monitor_get_workarea().
2020-07-29 17:57:30 +02:00
Matthias Clasen
d40b1d31b5 Merge branch 'doc-fixes' into 'master'
Doc fixes

See merge request GNOME/gtk!2314
2020-07-29 11:24:48 +00:00
Matthias Clasen
5fd03f3297 Merge branch 'a11y-work' into 'master'
A11y work

See merge request GNOME/gtk!2312
2020-07-29 11:19:22 +00:00
Matthias Clasen
d0abe5a919 filter: Typo fix 2020-07-28 22:40:10 -04:00
Matthias Clasen
26200c0f7e filechooser: Document the response.activate action 2020-07-28 22:40:10 -04:00
Matthias Clasen
07bf9045fb a11y: Document GtkATContext::state-changed 2020-07-28 22:40:10 -04:00
Matthias Clasen
e07b9605bc a11y: Fix a few glitches in the role enum
When the enumeration was synced with the latest draft
of the ARIA spec, the math and note roles missed the boat.
2020-07-28 22:20:40 -04:00
Matthias Clasen
b5f256937f Merge branch 'wip/carlosg/device-api-cleanup' into 'master'
Cleanups to device/event API

See merge request GNOME/gtk!2313
2020-07-28 23:49:35 +00:00
Carlos Garnacho
cab1dcb696 gdk: Conflate GDK devices
Make GdkEvents hold a single GdkDevice. This device is closer to
the logical device conceptually, although it must be sufficient for
device checks (i.e. GdkInputSource), which makes it similar to the
physical devices.

Make the logical devices have a more accurate GdkInputSource where
needed, and conflate the event devices altogether.
2020-07-29 01:27:51 +02:00
Carlos Garnacho
2736633a60 inspector: Show tool axes, instead of device axes
We are moving away from the latter as they are inconsistent with
Wayland. Make the inspector introspect known tools and their info,
instead.
2020-07-29 01:27:51 +02:00
Matthias Clasen
1755e07af7 a11y: Set an accessible role for GtkPasswordEntry
Use the text-box accessible role for GtkPasswordEntry.
And set properties as appropriate.

Update the documentation and add a test.
2020-07-28 18:23:57 -04:00
Matthias Clasen
a610bb89a0 a11y: Set an accessible role for GtkSearchEntry
Use the searchbox accessible role for GtkSearchEntry.
And set properties as appropriate.

Update the documentation and add a test.
2020-07-28 18:16:37 -04:00
Matthias Clasen
2040b7ecdf a11y: Set an accessible role for GtkLabel
Use the label accessible role for GtkLabel. ARIA has some
ominous wording about it going way, but while we have it,
GtkLabel is the obvious candidate for carrying it.

Update the documentation and add a test.
2020-07-28 18:16:37 -04:00
Matthias Clasen
9a82aadca7 a11y: Set an accessible role for GtkEntry
Use the text-box accessible role for GtkEntry and
set the placeholder and read-only accessible properties.

Update the documentation and add tests.
2020-07-28 18:16:37 -04:00
Matthias Clasen
971ee2d28a a11y: Set up controls relations for scrollbars
GtkScrolledWindow knows what its scrollbars control,
so set up the accessible relations for this.
2020-07-28 18:16:37 -04:00
Matthias Clasen
efd4169fa2 a11y: Set accessible roles for GtkImage and GtkPicture
Use the img accessible role for these.
Also update the documentation and add tests.
2020-07-28 18:16:37 -04:00
Emmanuele Bassi
3294557717 a11y: Update the valuetext attribute of GtkProgressBar
Since progress bars can have a label, we should propagate that information
to ATs whenever it's set.
2020-07-28 16:59:08 +01:00
Emmanuele Bassi
470349c902 a11y: Add an explicit "reset to default" method
In some cases we explicitly want to unset an accessible attribute; for
instance, an accessible property is gated on a widget property, and if
the widget property gets unset, the accessible property should be reset.
2020-07-28 16:49:13 +01:00