Commit Graph

588 Commits

Author SHA1 Message Date
Matthias Clasen
d7c54920ee menu: Listen only for notify::root
We no longer emit the display-changed signal,
so stop listening.
2019-05-01 23:05:09 +00:00
Matthias Clasen
78d254370c Merge branch 'inspector-menu-fix' into 'master'
Inspector menu fix

See merge request GNOME/gtk!804
2019-05-01 23:01:50 +00:00
Matthias Clasen
377ec33069 menus: Fix menus on non-default displays
Currently, we sometimes emit display-changed
when the display changed, and sometimes we don't
since the display is changed via gtk_widget_root.

Listen for notify::root as well and update our
display. This is a temporary fix - all display
changes should go through gtk_widget_root,
eventually.
2019-05-01 22:50:29 +00:00
Matthias Clasen
62b7ea7611 Remove gtk_menu_set_display
Menus should always be attached to a toplevel,
in which case they get their display that way.
2019-05-01 21:54:57 +00:00
Benjamin Otte
8ad38e5ae5 menu: Remove unused function parameter
The parameter was only ever set to TRUE.

And to make matters even more fun, the function didn't ever look
at the parameter.
2019-04-15 14:38:23 +02:00
Benjamin Otte
5473d13470 menu: remove bottom attach
bottom attach is top attach + 1, so use that everywhere
2019-04-15 14:38:23 +02:00
Benjamin Otte
31ccb7ca70 menu: get rid of 2 variables
They are always 0 and 1 respectively, so treat the code like that.
2019-04-15 14:38:23 +02:00
Benjamin Otte
dba1926a42 menu: Yeah cool, you're the last child
Nobody cares.
2019-04-15 14:38:23 +02:00
Benjamin Otte
b1b12a239f menu: Remove attach properties
They're never changed from being -1. So just replace them with -1
everywhere.
2019-04-15 14:38:23 +02:00
Matthias Clasen
21580309d3 Rename gdk_surface_get_device_position_double
Drop the _double suffix, now that the int version is gone.
2019-03-26 18:12:54 -04:00
Matthias Clasen
2d10a7b9c4 gtk: Stop using gdk_surface_get_device_position
Use the double version directly.
2019-03-26 18:08:32 -04:00
Matthias Clasen
8650980797 Adapt to motion controller api change
The signature of the enter/leave signals changed.
Adapt all users.
2019-03-18 09:24:42 -04:00
Benjamin Otte
01f7f255b5 gtk: Check return value of compute_bounds()
Half of these calls will completely break if anybody ever uses CSS
transforms with them, but hey...
2019-02-20 05:26:31 +01:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Timm Bäder
20429f4764 Remove :active state handling on widgets 2019-01-29 07:19:54 +01:00
Matthias Clasen
9dee863217 menu: Drop the child properties
These were only there in support of tabular menus.
2019-01-23 23:36:04 -05:00
Matthias Clasen
e31a96123e Drop gtk_menu_attach
We no longer support tabular menus.
2019-01-23 23:30:18 -05:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Ernestas Kulik
edc4b2f7d0 eventcontrollerscroll: Conditionally propagate ::scroll
Currently, gtk_event_controller_scroll_handle_event() always returns
TRUE if it is handled, which stops the propagation of the event. If
there’s a single GtkEventControllerScroll in the widget hierarchy, that
means that no others will run, depending on the propagation phase. In
Nautilus, this can be observed when adding a scroll controller to the
GtkScrolledWindow (ctrl-scrolling controls the zoom level) - either the
scrolling or the zooming breaks.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/45
2018-11-12 10:35:37 +01:00
Timm Bäder
e89bd7dfa2 menu: Remove useless if statement 2018-09-23 17:34:03 +02:00
Timm Bäder
2f6e998a27 menu: Show scroll arrows if necessary 2018-09-23 17:34:03 +02:00
Timm Bäder
7b7296410e menu: Remove arrow visibility flags 2018-09-23 17:34:03 +02:00
Timm Bäder
dcb6c9b4cf menu: Remove seen_item_enter flag
Unused.
2018-08-18 20:54:29 +02:00
Timm Bäder
afdeffd820 menu: Remove have_position flag
It's always FALSE.
2018-08-18 20:54:29 +02:00
Timm Bäder
10439aaefe menu: Remove an unnecessary gtk_widget_destroy() call
The unref will already properly free the menu item's resources.
2018-08-18 20:54:29 +02:00
Timm Bäder
b749fe4270 menu: Use correct content height 2018-08-05 10:22:10 +02:00
Timm Bäder
933cb857cf menu: Allocate children according to scroll_offset
This was done by simply moving the bin_window before but now we have to
do it ourselves.
2018-08-05 10:22:10 +02: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
Timm Bäder
5ff4ef14e6 widget: Directly notify gestures of grab
Since each widget has a list of event controllers now, we don't need to
connect to ::grab-notify of the widget for every controller.
2018-05-19 10:18:50 +02:00
Carlos Garnacho
15e00759c7 eventcontrollerkey: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
4f3058f195 eventcontrollermotion: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
74dbb057ed eventcontrollerscroll: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
4ddc94b293 multipressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Carlos Garnacho
77f4204bf4 menu: Set up callback with a return function
The function hooked up to the ::key-pressed signal should have
a return value. Pointed out by Peter Bloomfield.
2018-04-25 19:11:21 +02:00
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Daniel Boles
d13e78831b Menu|Item: Fix FIXME re non-const interned strings
These are members of the private struct, so it hurts no one to fix this.
2018-04-17 20:53:48 +01:00
Daniel Boles
4fae962a03 Menu: Remove redundant typecheck in private func
Everything that calls this already ensured we are a valid GtkMenu.
2018-04-17 20:40:21 +01:00
Daniel Boles
8fd0ee96a6 Menu: Update @accel_path annotation/description 2018-04-17 20:40:21 +01:00
Daniel Boles
48472a4b04 Menu: Typecheck AccelGroup passed via public API 2018-04-17 20:40:21 +01:00
Daniel Boles
24953ab1be Menu: Typecheck before dereferencing to get ->priv 2018-04-17 20:40:21 +01:00
Timm Bäder
3ce6355bf4 widget: Remove _get_own_allocation
Replace all usages of it with _compute_bounds
2018-04-10 09:43:47 +02:00
Carlos Garnacho
d724506abe gtkmenu: Stop using ::key-press-event
Use GtkEventControllerKey for the task
2018-04-05 19:26:55 +02:00
Matthias Clasen
2cc85df62b docs: Modernize an example
The signals that are showcased here are going away.
2018-04-05 19:26:53 +02:00
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Daniel Boles
f8ecd488cd Menu: Don't leak priv->motion_controller 2018-03-24 22:01:02 +00:00
Alexander Larsson
39851fbdbf Continue renaming window to surface
This renames a lot of arguments, local variables and functions.
2018-03-21 11:49:14 +01:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Alexander Larsson
3dce0dcca7 GdkSurface: Rename lots of stuff from window->surface
Mostly these are internal things, but the major public change is
that event.window is now event.surface.
2018-03-20 15:14:10 +01:00
Alexander Larsson
391727bd0d GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Carlos Soriano
f06f0a0dee gtkmenu: Remove unused constant
It was used in gtk3 but not in master anymore.
2018-03-14 16:05:08 +01:00