Matthias Clasen
3252d4cab2
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!2607
2020-09-21 18:11:41 +00:00
Matthias Clasen
2c527ec87e
inspector: Make switches go back to normal size
2020-09-21 11:53:48 -04:00
Matthias Clasen
256f845d89
colorbutton: Fix handling of transient parents
...
When we create the dialog before the button has
been rooted, we need to update its transient
parent when that happens.
2020-09-21 11:53:48 -04:00
Timm Bäder
b3c21bc89a
Merge branch 'fix-hover-tracking' into 'master'
...
main: Update pointer focus state for button releases
Closes #3172
See merge request GNOME/gtk!2601
2020-09-21 12:20:00 +00:00
Matthias Clasen
1d34f955a2
filechooser: Fix gtk_file_chooser_set_choice
...
This broke when it was ported to GtkDropDown.
2020-09-20 12:04:49 -04:00
Matthias Clasen
ee75bae8f8
fontchooser: Make sure the tweak button is updated
...
This was showing up as tweak buttons being visible
when they should not. The code probably relied on
widgets being hidden by default (as they were in
GTK3).
2020-09-20 10:59:37 -04:00
Matthias Clasen
3c62cd90d4
fontchooser: Handle families without faces
...
This might seem useless, but I've met fonts
where pango_font_family_get_face (family, NULL)
return NULL. Handle it without criticals.
2020-09-20 10:59:37 -04:00
Matthias Clasen
81793b62d8
docs: Improve gtk_widget_set_font_map docs
2020-09-20 10:59:37 -04:00
Matthias Clasen
18a5ca257a
Merge branch 'kill-widget-new' into 'master'
...
Drop gtk_widget_new
See merge request GNOME/gtk!2603
2020-09-19 21:25:32 +00:00
Matthias Clasen
874b9ef8b0
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!2602
2020-09-19 21:22:30 +00:00
Matthias Clasen
d89f7fd046
Drop gtk_widget_new
...
An abstract type should not have a constructor.
If you want to be generic, just use g_object_new.
2020-09-19 16:58:42 -04:00
Matthias Clasen
cdc5e83ef2
Merge branch 'matthiasc/for-master' into 'master'
...
textbuffer: Redo insert markup a little bit
See merge request GNOME/gtk!2600
2020-09-19 20:48:49 +00:00
Matthias Clasen
661da6baec
main: Update pointer focus state for button releases
...
Failure to do so makes the old pointer focus target
'sticky', because we end up ignoring the result of
picking the pointer focus until a motion event comes
in.
Fixes : #3172
2020-09-19 16:48:15 -04:00
Matthias Clasen
e927866ed4
shortcutswindow: Drop the Private struct
2020-09-19 16:22:04 -04:00
Matthias Clasen
4b9e7ac355
revealer: Drop the Private struct
2020-09-19 14:41:41 -04:00
Matthias Clasen
bebe0b5c1b
magnifier: Drop the Private struct
2020-09-19 14:36:44 -04:00
Matthias Clasen
2ad9864cdc
Cosmetic
2020-09-19 14:31:02 -04:00
Matthias Clasen
ec46900f06
colorscale: Drop the Private struct
2020-09-19 14:29:35 -04:00
Matthias Clasen
93cfa3855c
Merge branch 'wayland-backend-api-cleanup' into 'master'
...
wayland: Change backend api to use GdkToplevel
See merge request GNOME/gtk!2598
2020-09-19 18:19:18 +00:00
Matthias Clasen
6b708e9b60
textbuffer: Redo insert markup a little bit
...
Redo the tag insertion function to avoid quadratic
behavior, and at the same time, fix handling of
alpha for color attributes.
Update the copy of this function in gtk4-demo
as well.
2020-09-19 14:17:28 -04:00
Matthias Clasen
dd0da0f3cc
passwordentry: Add an ::activate signal
...
GtkSearchEntry has one, no reason why GtkPasswordEntry
should not as well.
Fixes : #3174
2020-09-19 13:25:03 -04:00
Matthias Clasen
48594a2d7a
passwordentry: Drop the Private struct
2020-09-19 13:23:40 -04:00
Matthias Clasen
3023a61e1d
wayland: Change backend api to use GdkToplevel
...
Most of the surface api we have in the Wayland backend
only makes sense for toplevels, so reshuffle things to
take a GdkToplevel instead of a GdkSurface.
Update all callers and the docs.
2020-09-19 13:07:11 -04:00
Matthias Clasen
57253b0039
Merge branch 'wip/baedert/radial-gradient' into 'master'
...
Radial gradients
Closes #2262 , #3170 , and #3173
See merge request GNOME/gtk!2597
2020-09-19 15:49:14 +00:00
Matthias Clasen
84d82dcda9
Merge branch 'wip/fontchooser-language-filtering' into 'master'
...
fontchooser: add language filtering
See merge request GNOME/gtk!2551
2020-09-19 15:06:56 +00:00
Matthias Clasen
4e35d56263
fontchooser: Remove signal handlers in dispose
...
Avoid ordering issues in dispose by disconnecting
the rows_changed_cb handler first thing.
2020-09-19 10:44:50 -04:00
Matthias Clasen
a9bf129286
fontchooser: Don't show "No fonts" prematurely
...
Don't switch to the empty page while we are still busy
filtering. Fonts might yet appear.
2020-09-19 10:25:45 -04:00
Matthias Clasen
76b7f0ca1c
fontchooser: Use filter language for sample text
...
When you are asking to only see fonts that support
a given language, you probably want to see the
sample text for that language too.
2020-09-19 10:13:36 -04:00
Matthias Clasen
09604eb3eb
fontchooser: Add user filtering
...
Add a popover that has filtering options. As a start,
allow filtering by monospace and by language coverage.
2020-09-19 10:13:36 -04:00
Matthias Clasen
0485a6c008
Improve language names
...
Shorten a few of the names we pick up by removing
parentheses that make them excessively long.
2020-09-19 09:47:15 -04:00
Matthias Clasen
169c208b7a
Merge branch 'matthiasc/for-master' into 'master'
...
win32: Fix compiler warnings
See merge request GNOME/gtk!2596
2020-09-19 13:26:34 +00:00
Matthias Clasen
e0b1c3e8b0
win32: Fix compiler warnings
...
The compiler informs me that GetLastError() return a DWORD,
so use %lx to print it.
2020-09-19 08:29:29 -04:00
Timm Bäder
79dc25e0b1
cssimageradial: Avoid creating color stops with an offset > 1
2020-09-19 08:55:18 +02:00
Timm Bäder
1d371db8d8
scrolledwindow: Ignore captured motion events if no child is set
...
Fixes #3173
2020-09-19 08:44:58 +02:00
Matthias Clasen
69d5dc7c9a
fontchooser: Determine sample text intelligently
...
Look at the languages supported by a font, and pick
a suitable sample text from the pango list of sample
texts. We can only implement this on platforms using
fontconfig, since it relies on pangofc apis.
This bumps the pango dependency to 1.47.1.
2020-09-18 23:04:39 -04:00
Timm Bäder
07b6431afe
Inspector: Show radial gradient node info
2020-09-18 15:39:07 +02:00
Matthias Clasen
2886e19772
css: switch to h/vradius
2020-09-18 15:39:07 +02:00
Matthias Clasen
c08df82d54
snapshot: switch to h/vradius
2020-09-18 15:39:07 +02:00
Matthias Clasen
2881d347d3
css: Use snapshot api for radial gradients
2020-09-18 15:39:04 +02:00
Matthias Clasen
66d16049c3
snapshot: Add api for radial gradients
...
These are the equivalents of the linear gradient apis.
2020-09-18 15:39:04 +02:00
Matthias Clasen
0c6226c20b
gsk: Add a radial gradient node
...
Only a fallback implementation for now.
Fixes #2262
2020-09-18 15:38:55 +02:00
Peter Bloomfield
50f373fbc2
language-names: Do not g_free() a GError
...
It's NULL anyway, so freeing GError with g_free() when it's allocated with
GSlice never actually happens, but it just looks bad.
2020-09-17 23:34:03 +00:00
Matthias Clasen
7082624fd7
textview: Properly delete anchored children
...
When we remove anchors with widgets from the text
buffer, we used to call gtk_widget_destroy(), which
indirectly called gtk_container_remove() which cleared
the child properly. When gtk_widget_destroy() was
removed, we replaced the calls with gtk_widget_unparent(),
but that is not enough. Explicitly call
gtk_text_view_remove() instead - we know the parent
is a text view.
2020-09-16 23:01:49 -04:00
Matthias Clasen
25d30011a0
textview: Make clickable tags work again
...
We were claiming the clicks too eagerly, preventing
clickable links, e.g. in GtkAboutDialog, from working.
2020-09-16 22:30:58 -04:00
Matthias Clasen
cd60ed4391
Plug a memory leak in an error case
...
gtk_show_uri() not freeing the error after showing
it to the user.
Pointed out by Peter Bloomfield in #3166
2020-09-16 19:13:18 -04:00
Matthias Clasen
cc9fe4b354
stack: Add gtk_stack_add_child
...
The name of children is not essential, so add
a way to add children without providing one.
Fixes : #3165
2020-09-15 18:39:09 -04:00
Matthias Clasen
6f56d8df28
Merge branch 'wip/jimmac/dnd-green' into 'master'
...
Adwaita: update tango color for DND
Closes #3158
See merge request GNOME/gtk!2581
2020-09-15 11:04:59 +00:00
Matthias Clasen
9eb4eef48b
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!2582
2020-09-15 11:04:54 +00:00
Jakub Steiner
d1a68ac7ba
Adwaita: update tango color for DND
...
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3158
2020-09-15 12:18:55 +02:00
Timm Bäder
a545fa15e4
inspector: Remove unsued function
2020-09-15 05:28:31 +02:00
Timm Bäder
e669433cde
listbox: Activate single-click rows if n_press >= 1
...
Quickly clicking rows should always activate the row if
single-click-activation is enabled. Before, only the first click
(n_press == 1) would activate the row.
2020-09-15 05:21:54 +02:00
Timm Bäder
a6f86d9c26
popover: Only destroy arrow render node if position changed
2020-09-15 05:21:54 +02:00
Timm Bäder
c8f4c8c4f0
filechooserwidget: Plug a memory leak
...
g_list_store_append refs the file
2020-09-15 05:21:54 +02:00
Timm Bäder
87f589f738
emojichooser: Fix typo in css class
2020-09-15 05:21:54 +02:00
Timm Bäder
27f3600419
listbox: Add preconditions to remove()
2020-09-15 05:21:53 +02:00
Timm Bäder
a0422bfe25
inspector: Fix huge listbox rows
...
This is handled by .rich-list
2020-09-15 05:21:53 +02:00
Matthias Clasen
67c1600ac2
Document some API as widget-implementation only
...
Using gtk_widget_insert_before on a complex container
is a *bad* idea; it will mess up the containers bookkeeping
of its children and can easily lead to failure and crashes.
2020-09-14 20:28:44 -04:00
Emmanuele Bassi
595cc929e6
Annotate the expression array as "nullable"
...
While it's a bit dubious whether array+length annotations should be
marked as "nullable", we do this elsewhere in the API, so might as well
be consistent.
In practice, the array argument is only ever allowed to be NULL iff the
length argument is 0; annotations are static, so if somebody decides to
pass a NULL argument with a non-zero value, they will get a run time
critical error, instead of a compile time one, which is somewhat counter
to the point of annotating the API in the first place.
Fixes : #2923
2020-09-14 17:00:23 +01:00
Matthias Clasen
a201bfd9a5
Merge branch 'wip/jimmac/navlist-expander-whitespace' into 'master'
...
Adwaita: navigation list expander whitespace
See merge request GNOME/gtk!2575
2020-09-14 12:59:05 +00:00
Matthias Clasen
53dddf163d
gestures: Make claiming button release work
...
When claiming a sequence in a gesture signal handler,
the expected result is that GtkGesture::handle-event
returns TRUE, causing the event to not be propagated
further.
This doesn't work for button release events, since
gtk_gesture_handle_event does the following:
add point
emit ::update
remove point
check claimed status
The ::update signal is where the application code
claims the sequence. But removing the point purges
the sequence from the gestures memory, so checking
the claimed status returns FALSE.
This patch fixes things to behave as expected, by
checking the claimed status before removing the point.
2020-09-14 08:35:44 -04:00
Jakub Steiner
e7c75f04dd
Adwaita: navigation list expander whitespace
...
- Address https://gitlab.gnome.org/GNOME/gtk/-/issues/3138#note_910476
2020-09-14 14:31:23 +02:00
Jakub Steiner
8eab10dabf
Adwaita: whitespace for the grid
...
- separate labels
- 12px margins around cells
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3164
2020-09-14 14:18:52 +02:00
Matthias Clasen
6a676d527c
Merge branch 'wip/jimmac/natigation-sidebar-whitespace' into 'master'
...
Wip/jimmac/natigation sidebar whitespace
Closes #3138
See merge request GNOME/gtk!2572
2020-09-14 11:13:52 +00:00
Jakub Steiner
bcb2861447
assets: adjust gesture graphic
...
- quick, somebody on the internet is offended!
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3074
2020-09-14 12:14:40 +02:00
Jakub Steiner
962f76ddc9
Adwaita: navigation-sidebar spacing
...
- split from placessidebar as it's more generic
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3138
2020-09-14 11:51:54 +02:00
Matthias Clasen
c462f35a5e
inspector: Use gdk_frame_clock_get_fps
2020-09-13 23:35:01 -04:00
Matthias Clasen
4b589b6afb
main: Reshuffle debug code
...
Mode all the debug flags related code together,
to make gtkmain.c a bit less messy.
2020-09-13 22:48:29 -04:00
Matthias Clasen
fedeb51f31
Drop support for GTK_TEST_TOUCHSCREEN
...
This environment variable is undocumented, and you can
just use GTK_DEBUG=touchscreen insead.
2020-09-13 22:44:32 -04:00
Matthias Clasen
d2faa38eed
Move version-related functions to gtkversion.c
...
This is just an internal cleanup, to make gtkmain.c
a bit less messy.
2020-09-13 22:23:06 -04:00
Matthias Clasen
ff9ca2b68d
Clean up debug flags code a bit
...
Use the GtkDebugFlags enum, since we have it.
2020-09-13 22:10:25 -04:00
Matthias Clasen
aa5207b349
iconview: Small doc additions
2020-09-13 21:51:42 -04:00
Matthias Clasen
2b5b6e0885
Drop gtk_render_slider from headers
...
The function does not exist.
2020-09-13 21:51:42 -04:00
Matthias Clasen
93d9a2ceda
colorchooser: Bring back gtk_color_chooser_widget_new
...
This was removed by accident in commit f392fbfb6d6f1116728b.
2020-09-13 21:51:42 -04:00
nana-4
f6e4486338
colorchooserwidget: Update default palette
...
This makes it completely in line with the new GNOME HIG color palette.
See https://gitlab.gnome.org/GNOME/gtk/-/issues/3146
2020-09-14 07:05:04 +09:00
Matthias Clasen
30c3a533f4
video: Make autoplay work
...
We were setting things up in the wrong order, so
autoplay had no effect when you using gtk_video_set_file().
2020-09-13 01:56:56 -04:00
Matthias Clasen
22257b124a
placessidebar: Remove a pointless restriction
...
The sidebar was refusing to show shortcuts for
things that don't have a local path, for no
good reason.
2020-09-13 01:14:00 -04:00
Matthias Clasen
4629182246
filechooser: Fix setting unlisted filters
...
This is documented to work, but it was broken
when we ported things to list models.
2020-09-13 01:12:51 -04:00
Matthias Clasen
c8a9e7fa82
Fix a compiler warning
2020-09-13 01:12:39 -04:00
Matthias Clasen
b534752d5c
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
Closes #3110 and #2994
See merge request GNOME/gtk!2565
2020-09-12 16:25:17 +00:00
Matthias Clasen
929a56e53c
Clean up lots of GTK+ -> GTK
...
Replace most remaining uses of GTK+ in the docs and
user-visible strings by GTK. Also remove some leftover
"Was added in 3.x" sentences from the docs.
2020-09-12 12:01:04 -04:00
Matthias Clasen
0011a1032d
text: Claim the sequence when we start selecting
...
Without this, drag-select will only work sporadically
in entries in headerbars.
Fixes : #2994
2020-09-12 11:18:36 -04:00
Matthias Clasen
38b71ba292
Cosmetics
...
Add a missing comma.
2020-09-12 11:11:28 -04:00
Matthias Clasen
756c52ef08
filechooser: Prevent a crash
...
With csd, we are handling external widgets when
there is an entry in the headerbar. Use a weak ref
to prevent that pointer from going stale. This fixes
a crash when cancelling a save dialog.
Fixes : #3110
2020-09-12 10:40:13 -04:00
Emmanuele Bassi
25bcec5cbb
Properly annotate GtkLayoutManagerClass.create_layout_child()
...
We're missing the ownership transfer rule for the created GtkLayoutChild
instance; this makes the virtual function not introspectable.
Fixes : #3156
2020-09-12 14:33:24 +01:00
Matthias Clasen
e55bdf87b5
Merge branch 'text-layout-speedup' into 'master'
...
textlayout: Avoid some iter comparisons
See merge request GNOME/gtk!2561
2020-09-11 21:20:38 +00:00
Matthias Clasen
c09575d9cb
textlayout: Avoid some iter comparisons
...
We were doing more iter comparisons than necessary in the
inner loop of gtk_text_layout_snapshot(), in the presence
of a selection. Rewrite the code to compare line numbers
instead, which is faster than full iter comparisons.
2020-09-11 16:41:42 -04:00
Matthias Clasen
ff392fbfb6
colorchooser: Don't parse color names needlessly
...
We have a fancy macro to initialize GdkRGBAs without
any runtime work, lets use them.
2020-09-11 09:31:17 -04:00
Matthias Clasen
498cbae95c
colorchooser: Drop color names
...
These were not used anymore, after a11y stopped using them.
2020-09-11 09:12:34 -04:00
Matthias Clasen
fa9608fd02
color chooser: Don't show too many custom colors
...
The code was hardcoding a fixed number of custom
colors, but we really want to match the number
of columns in the palette(s). Make it so.
2020-09-11 08:42:03 -04:00
Jakub Steiner
8700e136da
colorChooser: updte color palette
...
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3146
2020-09-11 10:47:24 +02:00
Matthias Clasen
93078e52c0
gdk: Rename GdkSurfaceState to GdkToplevelState
...
That is what it is.
Fixes : #2790
2020-09-10 00:39:03 -04:00
Matthias Clasen
d47d036663
search entry: Don't propagate handled events
...
When the text says it has handled the event,
trust it. We don't want to emit ::search-started
if the content hasn't changed, but we still
should not propagate e.g. an Insert key press
if it has already toggled overwrite mode in
the text.
Fixes : #2874
2020-09-09 22:26:27 -04:00
Benjamin Otte
cb5b375f43
revealer: Remove arbitrary 100x scale limit
...
This is no longer necessary because the bug it was rying to solve is now
solved via the preference for min and nat size.
2020-09-09 17:38:37 +02:00
Benjamin Otte
dfccaa8831
revealer: Prefer min and nat size
...
Assume that the fully expanded revealer will likely get an allocation
that matches the child's minimum or natural allocation, so we
special-case these two values.
So when - due to the precision loss - multiple sizes would match the
current allocation, we don't pick one at random, we prefer the min and
nat size.
The preference of nat size over min sie was decided after an IRC vote,
we don't actually have an idea what's more likely to happen in the real
world.
Should we ever get better data, we might want to switch.
2020-09-09 17:38:37 +02:00
Benjamin Otte
cc58956dbb
revealer: Use floor(), not ceil()
...
We use ceil() in measure(), so using it again will increase the
child's size whenever there is even a tiny rounding error.
This should also not make the size too small, because:
min = ceil(child_min * scale)
min / scale >= child_min
floor (min / scale) >= floor (child_min) = child_min
The last equality is because child_min is an integer.
Fixes #3137
2020-09-09 17:38:37 +02:00
Benjamin Otte
0ad10ccf39
revealer: Refactor code
...
Assign the values in the same place.
2020-09-09 17:38:37 +02:00
Benjamin Otte
8cb03a8cc0
widget: Add a critical when allocation is too small.
2020-09-09 17:38:37 +02:00
Emmanuele Bassi
f4b410daa7
Make sure we don't call back into GtkEntryBuffer
...
After commit 7e77afe94c
moved the deletion
of text into the signal handler, in order to make undo work, we need to
override the GtkEntryBuffer::deleted-text class closure when subclassing
GtkEntryBuffer, as well as overriding GtkEntryBufferClass.delete_text,
otherwise the default class closure will be invoked, and will try to
delete an empty buffer.
Fixes : #3140
2020-09-09 11:29:16 +01:00
Chun-wei Fan
3095bccd2e
gtksecurememory.c: Port secure memory allocation to Windows
...
Use the Windows API CryptProtectMemory() to encrypt the data that we want to
secure, and use CryptUnprotectMemory() to de-crypt the secured data that we
want to access, since mmap() and mlock() are not available on Windows.
2020-09-09 13:50:15 +08:00
Chun-wei Fan
c72b2f6167
gtksecurememory.c: Don't include unistd.h unconditionally
...
It is not universally available on non-POSIX systems.
2020-09-09 13:48:33 +08:00