Commit Graph

31019 Commits

Author SHA1 Message Date
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
Jehan
04367acf9b gtk: also recolor circle and ellipse in symbolic SVG icons. 2018-06-23 00:35:17 +02:00
Timm Bäder
1a2052a40e button: Remove unused variable 2018-06-21 20:57:18 +02:00
Timm Bäder
e079fad1d5 scrolledwindow: Avoid a queue_resize path in size-allocate 2018-06-21 20:54:47 +02:00
Samuel Thibault
bada3dbac6 HighContrast: Restore expander size
Expanders used to be 16px high. With the move from the gtk2 rendering
to gtk3 rendering they shrunk to 12px, making them hard to see, because
it's now the icon which is 16px high and the icon contains transparent
borders.

This makes the HighContrast theme use 24px icons instead, to restore
16px expanders. This may expander some containers a bit.

Closes #1046
2018-06-21 16:15:35 +02:00
Daniel Boles
9178423844 TreeView: Get expander size from CSS min-width|height
Rather than hard-coding this, get it from CSS. That way, themes will be
able to set larger expanders than a fixed 16 px, e.g. for accessibility.

See https://gitlab.gnome.org/GNOME/gtk/merge_requests/167
2018-06-21 15:49:00 +02:00
Carlos Garnacho
9df5171962 gtktreeviewcolumn: Implement column dragging through GtkGestureDrag
And remove ::event signal handler.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
b3e91b7111 gtktexthandle: Update to gtk4 rendering/input
GtkTextHandle was neglected by whoever removed the ::draw signal,
leaving it entirely broken. Update to using GtkGizmo so we can
implement snapshot of text handles.

Input has received a revamp too, handling is done through a
GtkGestureDrag and coordinate calculations simplified by storing
the delta to the hotspot on ::begin instead of ::update, as this
value is constant throughout the gesture. Widget state management
on crossing events happens implicitly, so no longer needs to be
done here.

Last but not least, CSS has also been updated so handles are
rendered at the correct size and proportion, and with the padding
that code expects of it.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
ffd89d29df gtkwindow: Queue popover resize on set_popover_position()
So the new position is eventually honored. Fixes magnifier and handles
staying in place after being shown.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
686116ba61 gtkfilechooserwidget: Forward events to filechooser through key controller
Instead of manually calling gtk_binding_set_activate_event() on an ::event
callback in the save entry.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
7fa3183d7f gtkfilechoooserentry: Handle tab completion through key controller 2018-06-21 12:54:03 +02:00
Carlos Garnacho
176fd2fab3 gtkemojicompletion: Use GtkEntry key controller to handle key presses 2018-06-21 12:54:03 +02:00
Carlos Garnacho
419ee6a451 gtkentrycompletion: Properly remove controller from entry
When disconnecting the GtkEntry from the GtkEntryCompletion, we
must remove the controller in order to avoid dangling callbacks.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
2c0d2d332f gtkentrycompletion: Move focus out handling to key controller
We can use the already present key controller to handle focus out.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
5f8fea08ff gtkentrycompletion: Perform event handling on popup through controllers
Instead of a ::event signal handler.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
f92ec7ce41 gtkplacessidebar: Replace ::event signal handlers with gestures
Set up a gesture on the sidebar rows to detect pointer clicks on
it. The row DnD management has been moved to the row widget itself,
it makes more sense even if the drag is began from the sidebar widget.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
ca08cf94d3 gtkwindow: Move map/delete/configure event management to gtkmain
Toplevels are about the only widgets interested in these events,
just handle those without going through the capture/bubble handling
code.
2018-06-21 12:54:03 +02:00
Carlos Garnacho
3d5dc16d63 gtkwindow: Simplify WM drag/resize handling
We still need a drag gesture both on front (capture) and back (bubble)
to handle dragging from both the GtkWindow widget and chrome in the
headerbar. But we can do it through 2 drag gestures, instead of special
event handling code.
2018-06-21 12:52:59 +02:00
Carlos Garnacho
7bfc3a5c74 gtkmenushell: Port to GtkGesture
We still need to poke the current event at places, but this is
better than the ::event vfunc.
2018-06-21 12:50:58 +02:00
Carlos Garnacho
a5414bc404 gtkpopover: Fix key navigation
This has been broken since we switched key event delivery to follow
the same semantics than pointer/touch. There, GTK+ grabs will influence
the topmost widget during event delivery, rendering the toplevel
unable to handle key navigation. The toplevel must handle those key
events in an explicit manner then.

We don't render the keyboard focus rectangle yet, but I assume that's
something else.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
1d97b5fd3c gtkpopover: Port to GtkEventController/GtkGesture
Use GtkEventControllerKey and GtkGestureMultiPress to replace key/button
event handling.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
aa09b0742e gtkwindow: Handle focus in/out through key controller
One less use of ::event in this widget, now mostly left to
map/delete/configure, those puny events.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
c5586f85fb gtkspinbutton: Use GtkEventControllerKey
And drop the ::event vfunc implementation with it.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
3eb1b22651 gtkfontchooser: Use GtkEventControllerKey
Use an event controller on GtkFontChooserDialog, a nice side effect
is that we can use gtk_event_controller_key_forward() and
gtk_search_entry_set_key_capture_widget() instead of passing events
around for dialog search.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
4186a85359 gtkfilechooserwidget: Drop usage of ::event vmethod
Use a key controller set up in the UI file instead.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
aaf1e4995c gtkfilechooserentry: Use GtkEntry key controller for focus-out handling
Expose the GtkEntry key controller in private API, so we don't have to
create yet another one just to handle focus-out.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
e08e15ba51 gtkentry: Use gestures for entry icons
Instead of doing all handling manually in the ::event vfunc,
set up drag/multipress gestures on icon images, and implement
emission of ::icon-press/release and DnD there.

As a side effect, the GdkEvent field in ::icon-press/release
signals has been dropped. Callers that might be interested on it
may still use gtk_get_current_event*().
2018-06-21 12:50:57 +02:00
Carlos Garnacho
7048362e6e gtkbutton: remove keyboard device GTK+ grab
This isn't really necessary, if keyboard focus forcibly goes somewhere
else we will get ::grab-notify, which is sufficient to deactivate the
button again.
2018-06-21 12:50:57 +02:00
Carlos Garnacho
5f0ed088e4 gtkbutton: Use key controller for button (de)activation through keybindings
And stop using GtkWidget::event for good.
2018-06-21 12:50:57 +02:00
Daniel Boles
c6fa3c446c EmojiCompletion: Avoid another un/signed warning
The cherry-pick missed this, I guess.
2018-06-20 20:51:50 +01:00
Daniel Boles
f7ebff6aea EmojiCompletion: Avoid un/signed compare warnings
(A) Use gsize to match the result of g_variant_n_children
(B) Use guint for n_matches, like the struct (and all other n_matches)
2018-06-20 20:38:27 +01:00
Daniel Boles
8aeced2c91 themes: Remove leftover bit of .linked workaround
Now that .linked acts like the .path-bar already did, there is no point
in applying the same styles again (with higher specificity).
2018-06-20 20:11:26 +01:00
Timm Bäder
e8fefd92c5 container: Remove SPECIAL_CONTAINER hack
As discussed in !129

Closes !129
2018-06-20 20:47:18 +02:00
Timm Bäder
22390adf11 stackswitcher: Remove icon-size property
This ought to be controlled via css these days.
2018-06-20 20:47:18 +02:00
Timm Bäder
cf9121977f infobar: Remove priv pointer 2018-06-20 20:47:18 +02:00
Timm Bäder
99099a1053 Remove some unnecessary snapshot implementations 2018-06-20 20:47:18 +02:00
Timm Bäder
daba1a7eff fixed: Remove priv pointer 2018-06-20 20:47:17 +02:00
Timm Bäder
f26359db13 listbox: Use widget insert API instead of fiddling with CSS nodes 2018-06-20 20:47:17 +02:00
Timm Bäder
945b844b7c button: Remove ICON_SIZE_BUTTON mention in docs
The icon will have the size given by css, not whatever
GTK_ICON_SIZE_BUTTON was.
2018-06-20 20:47:17 +02:00
Timm Bäder
f33655fa4e adjustment: Only emit ::changed from dispatch_properties_changed 2018-06-20 20:47:17 +02:00
Timm Bäder
ee8ee313c8 adjustment: Remove adjustment_changed_stamp 2018-06-20 20:47:17 +02:00
Timm Bäder
a12d26155f adjustment: Use public setters in set_property 2018-06-20 20:47:17 +02:00
Daniel Boles
cae382c829 themes: Regenerate CSS for recent commits
e.g. the box.linked one, which didn't update the compiled CSS.
2018-06-20 19:26:46 +01:00
Daniel Boles
0a5086d94f HC: Avoid excessive selectors from prev commit
The new rule does not need to affect all those other pseudoclasses. I
just put it in the wrong scope.
2018-06-20 19:26:41 +01:00
Daniel Boles
b103650cb0 HC: Avoid same BG/FG colors in flat treeview entry
Selected rows in tree views in HighContrast have a background colour the
same or nearly as the normal text colour, so we cannot let entries in
such rows have transparent backgrounds, or the text inside the entry
becomes nearly or totally impossible to see.

Dodge this by giving entry.flat inside treeview and with :focus the
$base_color, which is different from the text & so lets that be seen.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/125
2018-06-20 19:13:26 +01:00
Daniel Boles
337e602143 searchenginetracker: Don't leak the hits' GFiles
https://gitlab.gnome.org/GNOME/gtk/merge_requests/206
2018-06-20 17:20:31 +01:00
Matthias Clasen
cd99f82e0c Merge branch 'master' into 'issue1084'
# Conflicts:
#   gdk/gdk.c
2018-06-20 14:21:24 +00:00
Timm Bäder
29fee2e808 window: Remove priv pointer 2018-06-20 07:49:04 +02:00
Timm Bäder
417b1d8335 pathbar: Remove unused define 2018-06-20 07:48:54 +02:00
Daniel Boles
ec096b417c Merge branch '1160-crash-clearing-gtkentry-icon-tooltip-master' into 'master'
Resolve "Crash clearing GtkEntry icon tooltip"

Closes #1160

See merge request GNOME/gtk!205
2018-06-19 20:22:38 +00:00
Benjamin Otte
0b1f0984f5 Revert "Use aligned allocators for GtkSnapshot"
This reverts commit c02bc22cc5.

This code is not necessary.
The bug causing this problem ws prsent in the graphene library.
2018-06-19 19:52:52 +02:00
Benjamin Otte
6918fb2e4e rendernodepaintable: Fix rendering position
When the given size had an offset, we were moving that offset in the
wrong direction.
2018-06-19 19:44:17 +02:00
Benjamin Otte
3caf8c86c9 dnd: Use a GtkPicture in gtk_dnd_set_icon_paintable()
We don't want to get the paintable scaled down to icon size.

Also set can-shrink = FALSE to replicate GTK3 behavior with size
requests.
2018-06-19 19:44:17 +02:00
Benjamin Otte
8c8dc3aeab snapshot: Compute correct size in gtk_snapshot_to_paintable()
Also, do actually respect the passed in size argument if it isn't NULL.

Fixes text being cut off inside DND icons.
2018-06-19 19:44:17 +02:00
Daniel Boles
4f979469f1 a11y/entry: Fix copy-pasteo re 2ndary icon tooltip
The else case was wrongly resetting the accessible description on the
primary icon, which might not exist and can therefore cause a crash.

https://gitlab.gnome.org/GNOME/gtk/issues/1160
2018-06-19 18:37:25 +01:00
Matthias Clasen
87532f0ac3 Merge branch 'wip/carlosg/issue-1159' into 'master'
Fix issue 1159

Closes #1159

See merge request GNOME/gtk!202
2018-06-19 16:40:39 +00:00
Carlos Garnacho
8e3bf65b3b gtkgesture: Check claimed status after event delivery
The claimed status check should happen after ::end is emitted,
as the gesture may deny the sequence that much late. In this
case the event should keep propagating.

https://gitlab.gnome.org/GNOME/gtk/issues/1159

Closes: #1159
2018-06-19 13:47:38 +02:00
Carlos Garnacho
de30a74cdf gtkwidget: Avoid doubly coordinate conversion when emulating press
We are poking again into the event propagation machinery, which
expects events in toplevel coordinates. Since we can't fetch the
original event back at this point, translate the coordinates
back to the toplevel so the emulated press ends up in the right
place.

https://gitlab.gnome.org/GNOME/gtk/issues/1159

Closes: #1159
2018-06-19 13:47:26 +02:00
Benjamin Otte
9a91d3739d widget: Remove time argument from drag_data_get() vfunc 2018-06-18 23:49:53 +02:00
Benjamin Otte
a2839d157f dnd: Remove unused time arguments 2018-06-18 23:49:53 +02:00
Benjamin Otte
a1cee7fa65 surface: Kill event masks
In particular, this patch removes:
  gdk_surface_get_events()
  gdk_surface_set_events()
  gdk_surface_get_device_events()
  gdk_surface_set_device_events()

Event masks so far still exist for grabs.
2018-06-18 23:49:52 +02:00
Benjamin Otte
8a08a325be dnd: Implement gtk_drag_get_source_widget() differently
Instead of keeping a list of source contexts, just use the current
drag's info.
2018-06-18 23:49:52 +02:00
Benjamin Otte
d02b185a87 dnd: Add gdk_event_get_drop()
And remove gdk_event_get_drag_context().

All GTK code now only uses GdkDrop for dropping.
2018-06-18 23:49:52 +02:00
Benjamin Otte
b00609c21c dnd: Make drag-motion and drag-drop signals use GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
6d7cb2b781 dnd: Make drag-data-received use a GdkDrop 2018-06-18 23:49:52 +02:00
Benjamin Otte
314eaf7d10 widget: Make GtkWidgetClass::drag_leave() take a GdkDrop
Drag Contexts are on their way out!
2018-06-18 23:49:20 +02:00
Benjamin Otte
5b0a6a52c1 dnd: Get rid of gtk_drag_finish()
It's just a wrapper around gdk_drag_finish(), so use that one instead.
2018-06-18 23:49:20 +02:00
Benjamin Otte
13ae11ee01 dnd: Rename gdk_drop_finish() => gdk_drag_finish()
This is a simple rename, so that we can reintroduce gdk_drop_finish()
with the GdkDrop object.
2018-06-18 23:49:19 +02:00
Benjamin Otte
6919d8c532 drop: Move gdk_drop_read_async() to GdkDrop class 2018-06-18 23:49:19 +02:00
Matthias Clasen
841a29837e Merge branch 'lrn/misc-gtk4-fixes' into 'master'
Misc GTK4 fixes

See merge request GNOME/gtk!195
2018-06-18 21:37:42 +00:00
Matthias Clasen
7554384b2d Merge branch 'win32-filechooser-fix-file-list-order' into 'master'
win32 file chooser: add missing g_slist_reverse

See merge request GNOME/gtk!199
2018-06-18 20:09:47 +00:00
Timm Bäder
64313f4a4b themes: Don't handle box.linked special
We don't reverse the css nodes anymore in RTL layouts.
2018-06-18 19:39:32 +02:00
Timm Bäder
34f556fc3e filechooserbutton: Remove priv pointer 2018-06-18 17:35:03 +02:00
Timm Bäder
218b39fe01 GtkStyleContext: Remove the frame clock
It's unused within GtkStyleContext.
2018-06-18 17:35:03 +02:00
Timm Bäder
70c8cfa480 dnd: Fix up a comment
The below function does not take a GtkIconHelper anymore.
2018-06-18 17:35:03 +02:00
Timm Bäder
501efeb6b9 colorscale: Remove priv pointer 2018-06-18 17:35:03 +02:00
Timm Bäder
a7d8127d59 fontbutton: Remove priv pointer 2018-06-18 17:35:03 +02:00
Timm Bäder
beb4cb0e37 radiobutton: remove priv pointer 2018-06-18 17:35:03 +02:00
Timm Bäder
346ec706f7 picture: Fix up some docs
Use nullable instead of allow-none consistently, remove trailing
whitespace and fix some c&p problems.
2018-06-18 17:35:03 +02:00
Timm Bäder
d8274856de drawingarea: Clarify some comments 2018-06-18 17:35:03 +02:00
Timm Bäder
3756234708 messagedialog: Remove priv pointer 2018-06-18 17:35:03 +02:00
Timm Bäder
2d6955285c paned: Allocation x/y are always 0
The allocation position we get passed to size_allocate is always 0/0
these days.
2018-06-18 17:35:03 +02:00
Timm Bäder
10a0d6252e paned: Remove handle_pos member
Query the handle bounds on demand instead.
2018-06-18 17:35:03 +02:00
Timm Bäder
f8ddc42638 paned: Chain up in snapshot
No need to snapshot all child widgets ourselves, the implementation in
GtkWidget can just do it for us.
2018-06-18 17:35:02 +02:00
Timm Bäder
e9a9bb069f paned: Remove unnecessary local variable
We can just pass the given allocation on.
2018-06-18 17:35:02 +02:00
Timm Bäder
df79f02310 paned: Don't unnecessarily redraw handle in size_allocate
We size_allocate it after all, which will redraw it.
2018-06-18 17:35:02 +02:00
Timm Bäder
bd99ca2f04 paned: Store GParamSpecs
So we can use the more efficient g_object_notify_by_pspec everywhere.
2018-06-18 17:35:02 +02:00
Timm Bäder
889fcf64b6 Remove gtk_css_node_reverse_children
Not needed anymore.
2018-06-18 17:35:02 +02:00
Timm Bäder
3fadb536d9 toolbar: Stop reordering css nodes based on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
fb0d8eacc3 headerbar: Stop reordering css nodes depending on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
fffb3161bc notebook: Stop reversing tabs based on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
3be2cb8f63 builder: Fix g-i annotations of _get_translation_domain
The return value can be null and is (transfer none).
2018-06-18 17:35:02 +02:00
Timm Bäder
8267605ba2 builder: Use TRUE/FALSE for error return values
Instead of guint and 0/1.
2018-06-18 17:35:02 +02:00
Timm Bäder
da4d8b7d94 builder: Remove priv pointer 2018-06-18 17:35:02 +02:00
Timm Bäder
01d4538223 box: Don't reorder children based on text direction
Make :first-child always be the first child, i.e. the leftest one in LTR
and the rightest one in RTL.
2018-06-18 17:35:02 +02:00
Timm Bäder
da27627696 paned: Don't reorder css nodes based on text direction 2018-06-18 17:35:02 +02:00
Timm Bäder
85e49a1051 center box: Don't reorder css nodes in RTL
So widget order matches css order. We will do the same thing with GtkBox
eventually.
2018-06-18 17:35:02 +02:00
Timm Bäder
798944cb26 scrolledwindow: Remove priv pointer 2018-06-18 17:35:02 +02:00
Nicolai Syvertsen
2d7cfdd7ed win32 file chooser: add missing g_slist_reverse
the list is prepended to so we need to reverse the list
before returning
2018-06-18 09:44:46 +00:00
Руслан Ижбулатов
6bf88d90f3 W32: don't put a string literal into gtk_libdir
In all other instances gtk_libdir is a dynamically-allocated string,
so dup the literal in this case as well.
2018-06-16 18:22:12 +00:00
Руслан Ижбулатов
fb4d76d380 Add forward declaration for DllMain() in gtkwin32.c 2018-06-16 18:21:42 +00:00
Руслан Ижбулатов
dedc1ee1e5 Use const for media type in devmode_to_settings() 2018-06-16 18:20:49 +00:00
Руслан Ижбулатов
fe76984e89 Add foward declarations to gtk_print_operation_run_without_dialog 2018-06-16 18:20:22 +00:00
Timm Bäder
0b12fd9c1b center box: Remove snapshot implementation 2018-06-16 10:09:12 +02:00
Timm Bäder
d3ffaa0236 button: Remove measure implementation
This is already done by GtkBin.
2018-06-16 10:09:12 +02:00
Timm Bäder
1b208eb457 combobox: Remove priv pointer 2018-06-16 10:09:12 +02:00