Commit Graph

30806 Commits

Author SHA1 Message Date
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
Jakub Steiner
c5fa657631 aboutbox: use a more fitting 'design by" role
- in most cases, authors listed under "artwork by" are actually responsible for
  the design of the app as a whole

Fixes issue #1153
2018-06-14 16:36:38 +02:00
Mohammed Sadiq
bdf3b6f64d Revert "imcontext: Make size arguments be gsize and not int"
This was committed accidently.

This reverts commit eefd2d6f10.
2018-06-14 11:15:14 +05:30
Benjamin Otte
eefd2d6f10 imcontext: Make size arguments be gsize and not int
Otherwise gcc complains when we use these as arguments to g_new() on
32bit architectures with:

../gtk/gtkcomposetable.c: In function ‘gtk_compose_table_list_add_array’:
/usr/include/glib-2.0/glib/gmem.h:217:10: warning: argument 1 range [2147483648, 4294967295] exceeds maximum object size 2147483647 [-Walloc-size-larger-than=]
      __p = g_##func##_n (__n, __s);   \
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmem.h:279:42: note: in expansion of macro ‘_G_NEW’
 #define g_new0(struct_type, n_structs)   _G_NEW (struct_type, n_structs, malloc0)
                                          ^~~~~~
../gtk/gtkcomposetable.c:851:22: note: in expansion of macro ‘g_new0’
   gtk_compose_seqs = g_new0 (guint16, length);
                      ^~~~~~
/usr/include/glib-2.0/glib/gmem.h:96:10: note: in a call to allocation function ‘g_malloc0_n’ declared here
 gpointer g_malloc0_n      (gsize  n_blocks,
          ^~~~~~~~~~~
2018-06-14 06:37:00 +05:30
Mohammed Sadiq
d4693b2dc8 snapshot: Trivial typo fix in comment 2018-06-13 19:58:01 +05:30
Rico Tzschichholz
b1f934d3b0 picture: Fix g-i annotation warning 2018-06-13 13:08:28 +02:00
Mario Sanchez Prada
07d6c53346 application: Complete startup notification sequence for remote invocations
When a remote instance of a GTK application implementing the Startup
Notification protocol gets spawned it will pass the startup sequence
ID as "platform data" to the main instance. Thus, we need to make sure
that the startup sequence gets completed in that case, since the remote
instance won't do it by itself, since it won't map any top level window.

Checking for this "platform data" in the implementation of the after_emit()
virtual method in the primary instance should be a good place to do so, since
the existence of such data proves that a remote instance has been spawned.

https://gitlab.gnome.org/GNOME/gtk/issues/1084
2018-06-11 16:28:24 +01:00
Mario Sanchez Prada
479c341545 application: Use the new API to get the startup notification ID
The DESKTOP_STARTUP_ID gets cleared early after the process is spawned,
meaning that it's too late at add_platform_data() to pick it up and send
it over to the primary instance, as it will be always unset at that point.

To solve this, we use the new gdk_display_get_startup_notification_id()
method to pull the startup notification ID for the application, if present,
out of the display and pass it over to that primary instance.

https://gitlab.gnome.org/GNOME/gtk/issues/1084
2018-06-11 16:28:24 +01:00
Mohammed Sadiq
0c57e3131f overlay: Use the right property variable name 2018-06-11 17:43:16 +05:30
Mohammed Sadiq
0d46081645 overlay: Add support for clipping overlay widgets
Sometimes users may want to restrict the growth of child
widgets in a GtkOverlay to grow atmost the size of the overlay.

Let's add a support for that.
2018-06-11 16:24:29 +05:30
Matthias Clasen
4f632296a5 Merge branch 'lrn/gtk4warnings' into 'master'
Fix a lot of warnings in GTK4

See merge request GNOME/gtk!188
2018-06-10 23:14:42 +00:00
Matthias Clasen
c047e97cfa Merge branch 'master' into 'master'
gtk: Add gtk_is_initialized() and gtk_get_main_thread()

See merge request GNOME/gtk!186
2018-06-10 23:05:50 +00:00
Matthias Clasen
bc13a58f3c Merge branch 'lrn/aligned-alloc' into 'master'
Aligned allocators for GTK4

Closes #856

See merge request GNOME/gtk!187
2018-06-10 22:05:12 +00:00
Руслан Ижбулатов
43f37894b0 Use correct stat struct for ftw()
check_dir_mtime() is called by ftw() and is given
the real stat struct, not its glib version (which may
or may not be the same as "struct stat").

This is irrelevant for MSVC (it has no ftw()) and
works correctly for MinGW-w64 (which declares stat
structures correctly). If mingw.org complains, add
a special ifdef for it later.
2018-06-10 21:21:27 +00:00