Michael Natterer
caf50bcb93
gtk: fix weed_out_neg_zero() in spinbutton and scale
...
It was not copying the terminating \0 in the string, breaking output
in spinbutton (didn't try scale). Fixes #3452 .
(cherry picked from commit ae2ef1472c
)
2019-06-03 00:34:44 +00:00
Christian Hergert
41e373f10c
gtk: fix all uses of g_cclosure_marshal_generic
...
This adds specific marshallers for all of the locations where a generic
marshaller is being used. It also provides va_marshallers to reduce the
chances that we get stack traces from perf going through ffi_call_unix64.
This is forward ported from gtk-3-24.
# Conflicts:
# gtk/gtkeventcontrollerkey.c
# gtk/gtkeventcontrollermotion.c
# gtk/gtkgesture.c
# gtk/gtkgesturemultipress.c
2019-06-02 14:24:51 -07:00
Matthias Clasen
aa267c1c84
Add gtkmenubarprivate.h
...
Move private api into a private header.
2019-06-01 21:56:49 +00:00
Matthias Clasen
3dea73bd4a
Cosmetics
...
Remove comments that are old enough to still
talk about option menus and item factories.
2019-06-01 21:56:49 +00:00
Matthias Clasen
03964b5edb
Remove an unused enum
...
No use of GtkArrowPlacement anywhere.
2019-06-01 04:11:22 +00:00
Matthias Clasen
0c7e567c32
Merge branch 'global-coords' into 'master'
...
Drop global coordinates
See merge request GNOME/gtk!899
2019-06-01 03:53:13 +00:00
Matthias Clasen
fcdea03796
Fix menu item accessible
...
The menu shell is not a direct parent anymore.
2019-06-01 03:39:12 +00:00
Matthias Clasen
feef0ef93a
menu: Fix destruction
...
Now that menubar and menu are containers
with internal structure, we need to be
careful about doing the right thing in
forall and dispose.
2019-06-01 03:32:10 +00:00
Matthias Clasen
6c201e7927
menu: Fix keynav between submenus
...
Left/Right arrow now work again to enter
or leave a submenu.
2019-05-31 23:36:35 +00:00
Matthias Clasen
ace30d42ea
menu: Bring back the scroll keybindings
...
Home, End, Page Up/Down, work again.
2019-05-31 23:36:35 +00:00
Matthias Clasen
e599336ad4
menu: Keep selected item in view
...
This gets us most of the way to working scrolling.
2019-05-31 23:36:35 +00:00
Matthias Clasen
8ba3c75682
More menu work
2019-05-31 23:36:35 +00:00
Matthias Clasen
3f6272f56e
More menu restructuring
...
Make GtkMenuBar use a box as well,
and let GtkMenuShell get the items
from GtkMenuBar and GtkMenu via
a vfunc. Use that to fix the keynav
implementation in GtkMenuShell.
2019-05-31 23:36:35 +00:00
Matthias Clasen
13e010deb6
menu: Use a scrolled window
...
This brings back some support for scrolling.
We still need to reinstate some of the
scroll-to-selected and keynav functionality.
2019-05-31 23:36:35 +00:00
Matthias Clasen
ae1ba79f63
menu: Use a box
...
This makes some of the GtkMenuShell api
no longer work, since we don't let the
menu shell code maintain the list of
children anymore.
2019-05-31 23:36:35 +00:00
Matthias Clasen
17cd6d7f44
widget: Stop setting root coords in events
...
Nothing should use them anymore.
2019-05-31 23:36:35 +00:00
Matthias Clasen
f645c4e923
menu: Remove global coordinates
...
This commit removes support for scrolling and
for the keep-up triangle from GtkMenu, and gets
rid of all use of global coordinates.
2019-05-31 23:36:34 +00:00
Benjamin Otte
4e464b4960
menu: Only set position in one place
2019-05-31 23:36:34 +00:00
Benjamin Otte
d971c4e69d
menu: Simplify function
...
No need to do complicated math when we can just look at the allocation.
2019-05-31 23:36:34 +00:00
Benjamin Otte
e702a33432
menuitem: Introduce gtk_menu_item_get_menu_shell()
...
Returns the parent menu shell or NULL.
Replace all calls to gtk_widget_get_parent() with this function.
2019-05-31 23:36:34 +00:00
Lubomir Rintel
8799e5798b
builder-tool: Rewrite GtkDialog
...
Changes
<object class="GtkDialog">
<child internal-child="vbox">
<...>
<child internal-child="action_area">...</child>
...
</...>
<packing />
</child>
<object>
to
<object class="GtkDialog">
<child internal-child="content_area">
<...>
...
</...>
</child>
<child internal-child="action_area">...</child>
<object>
2019-05-31 17:03:12 +00:00
Matthias Clasen
97e15b8718
scrolled window: respect overlay-scrolling setting
...
If the gtk-overlay-scrolling setting is FALSE,
don't use overlay scrollbars.
2019-05-31 15:04:23 +00:00
Matthias Clasen
2ae6f1a741
Add a gtk-overlay-scrolling setting
...
This is in preparation for letting user opt out of
overlay scrolling in the control-center.
2019-05-31 14:07:15 +00:00
Matthias Clasen
8145872e27
Merge branch 'wip/chergert/remove-cclosure' into 'master'
...
gtk: rely on default marshallers
See merge request GNOME/gtk!893
2019-05-31 10:57:27 +00:00
Benjamin Otte
4df049e81c
Merge branch 'for-master' into 'master'
...
For master
See merge request GNOME/gtk!892
2019-05-31 04:07:11 +00:00
Christian Hergert
bd26cce812
gtk: rely on default marshallers
...
Similar to previous removals of g_cclosure_marshal_VOID__VOID we can remove
other marshallers for which are a simple G_TYPE_NONE with single parameter.
In those cases, GLib will setup both a c_marshaller and va_marshaller for
us. Before this commit, we would not get a va_marshaller because the
c_marshaller is set.
Related to GNOME/Initiatives#10
2019-05-30 20:56:50 -07:00
Benjamin Otte
6b2518a190
widget: fix CSS transforms with margins
...
The CSS transform should operate on the border-box, not the margin box.
So we need to shrink the bounds by the margin before we apply the CSS
transform.
2019-05-31 05:36:50 +02:00
Niels De Graef
df9aed6c61
Fix some GObject introspection annotations
...
Fixes several warnings by the GIR compiler.
2019-05-30 20:34:43 +02:00
Benjamin Otte
1e0c0c0ba7
rendernodeparser: Parse cairo script
...
Use cairo-script-interpreter to parse the scripts that generate cairo
nodes.
This requires libcairoscriptinterpreter.so to work properly, but if
it isn't found we disable this (unimportant for normal functioning)
code and just emits a parser warning.
The testsuite requires it however or it will fail.
A new test is included that tests all of this.
2019-05-30 15:32:36 +02:00
Matthias Clasen
2f37207487
Remove leftover debug spew
2019-05-30 08:19:08 -04:00
Matthias Clasen
d71bf4d35c
Add gtknative.h to public headers
2019-05-30 08:18:29 -04:00
Matthias Clasen
93a34eb62d
Merge branch 'lr/builder-tool-templates' into 'master'
...
builder-tool: Rewrite GtkBuilder templates too
See merge request GNOME/gtk!888
2019-05-30 11:56:05 +00:00
Lubomir Rintel
1e7225aa1c
builder-tool: Set the parent of newly created GtkAssistantPage
...
...and its property. Otherwise simplify_element() blows up when looking
up the hierarchy to determine a property type.
$ gtk4-builder-tool simplify --3to4 /dev/stdin <<EOF
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- Generated with glade 3.20.2 -->
> <interface domain="nm-applet">
> <object class="GtkAssistant">
> <child>
> <object class="GtkBox" id="confirm_page">
> </object>
> <packing>
> <property name="page_type">confirm</property>
> <property name="complete">True</property>
> </packing>
> </child>
> </object>
> </interface>
> EOF
/dev/stdin: Packing property GtkAssistant::page_type not found
/dev/stdin: Packing property GtkAssistant::complete not found
Segmentation fault (core dumped)
2019-05-30 11:39:09 +02:00
Lubomir Rintel
2d55fce23d
builder-tool: Rewrite GtkBuilder templates too
2019-05-30 10:34:24 +02:00
Matthias Clasen
e0cc72e94f
Fix shortcuts window sizing
...
We were deferring the reflow until map, but this
leads to the section initially having an enormous
height and the window picks up that size before
we have a chance to reflow, This could be seen
in the "Builder" demo in gtk4-demo.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/11
2019-05-29 17:06:27 -04:00
Christian Hergert
82afe850e8
marshallers: add missing g_cclosure_marshal_VOID__VOID fixes
2019-05-29 13:48:33 -07:00
Christian Hergert
f507a79056
marshallers: ensure g_cclosure_marshal_VOID__VOIDv is used
...
If we set c_marshaller manually, then g_signal_newv() will not setup a
va_marshaller for us. However, if we provide c_marshaller as NULL, it will
setup both the c_marshaller (to g_cclosure_marshal_VOID__VOID) and
va_marshaller (to g_cclosure_marshal_VOID__VOIDv) for us.
2019-05-29 13:22:31 -07:00
Matthias Clasen
90f330e27a
Merge branch 'gesture-click' into 'master'
...
Rename GtkGestureMultiPress to GtkGestureClick
See merge request GNOME/gtk!878
2019-05-29 18:39:09 +00:00
Matthias Clasen
2be733497b
Merge branch 'global-coords' into 'master'
...
Drop global coordinates
See merge request GNOME/gtk!879
2019-05-29 18:29:57 +00:00
Matthias Clasen
b867cbe0d8
Cosmetics
...
Remove an unused variable.
2019-05-29 18:04:08 +00:00
Matthias Clasen
956e94a8d4
Remove a misleading comment
...
We don't have windowed widgets anymore, and
gdk_surface_move_resize is about to go away.
2019-05-29 18:04:08 +00:00
Matthias Clasen
2081bf346e
window: Remove move unused fields
...
position_constraints_changed is never used.
2019-05-29 18:04:08 +00:00
Matthias Clasen
74db7cbe00
window: Never call gdk_surface_move
...
With gtk_window_set_position gone, we should never
come up with a new position to set in this code.
Leave a warning in place and remove the gdk_surface_move
calls.
2019-05-29 18:04:08 +00:00
Matthias Clasen
d6d5d60703
Drop an empty function
...
gtk_window_constrain_position is not doing anything
anymore, so no need to call it.
2019-05-29 18:04:08 +00:00
Matthias Clasen
ece7fff339
window: Drop more unused fields
...
need_default_position is never used.
2019-05-29 18:04:08 +00:00
Matthias Clasen
147adc0bc5
window: Drop some unused fields
...
initial_x/y and initial_pos_set are never used.
2019-05-29 18:04:08 +00:00
Matthias Clasen
b636e32d85
widget: Stop using gdk_device_get_position
...
Root coordinates are going away. Stop
setting them in crossing events, so we
can drop this api.
2019-05-29 18:04:08 +00:00
Matthias Clasen
a8899cc6a3
window: Drop gtk_window_set_position
...
This is heavily using global coordinates, and
can't be guaranteed to work across wms / platforms.
2019-05-29 18:04:08 +00:00
Matthias Clasen
f0ef5332be
a11y: Stop using gdk_surface_get_frame_extnts
...
This api is going away.
2019-05-29 18:04:08 +00:00
Matthias Clasen
83827d3199
a11y: Stop using gdk_surface_get_origin
...
Global coordinates are going away.
Stop supporting ATK_XY_SCREEN.
2019-05-29 18:04:08 +00:00