Commit Graph

57595 Commits

Author SHA1 Message Date
Matthias Clasen
e34b1421f7 root: Drop default handling
We no longer treat the default as generic thing.
Instead, GtkWindow and GtkPopover have their own
ways to set defaults.
2019-04-29 02:37:59 +00:00
Matthias Clasen
aefce0e5cb widget: Drop gtk_widget_grab_default
The default widget is mostly a dialog concept,
and does not really need this generic api. If
we need to mark a widget as default, use
gtk_window_set_default().
2019-04-29 02:37:59 +00:00
Matthias Clasen
44c51399e2 widget: Remove special handling for has-default in ui files
We can just set default-widget in ui files.
2019-04-29 02:37:59 +00:00
Matthias Clasen
4155b29efb widget-factory: Stop setting has-default in ui files
We can just set the default-widget property. The
special handling for has-default in ui files is
going away.
2019-04-29 02:37:58 +00:00
Matthias Clasen
c7f5551c43 Stop using gtk_widget_grab_default
Replace gtk_widget_grab_default by
gtk_window_set_default.
2019-04-29 02:37:58 +00:00
Matthias Clasen
ce9e43ad2a popover: Drop activation api
The default activation is now handled
via action, and activating the focus can
be handled by GtkWindow, since we only
have one per-window focus anyway.
2019-04-29 02:37:58 +00:00
Matthias Clasen
6120eb19d4 text, label: Handle default activation via action
We can now activate the default widget via
the gtk.activate-default action. This makes
it unnecessary to have a GtkRoot or GtkBud
api for this.
2019-04-29 02:37:58 +00:00
Matthias Clasen
3d486cac86 popover: Add the same activate-default action 2019-04-29 02:37:58 +00:00
Matthias Clasen
eff272df9d window: Add a gtk.activate-default action
This will replace other activate_default apis.
2019-04-29 02:37:58 +00:00
Matthias Clasen
1273360b36 popover: Remove unused fields 2019-04-29 02:37:58 +00:00
Matthias Clasen
3e04ed69c6 window: Ignore events for other surfaces
We don't want to set resize cursors on popovers.
The underlying issue here is that we don't translate
the coordinates between surfaces. For now, just
ignore these events.
2019-04-29 02:37:58 +00:00
Matthias Clasen
f42175b55f window: Set cursor on the right surface
This fixes cursors for entries in popovers.
2019-04-29 02:37:58 +00:00
Matthias Clasen
21e105e76f widget: Remove some unneeded popover special-casing 2019-04-29 02:37:58 +00:00
Matthias Clasen
b457b1e985 menubutton: Allocate the popover
This is temporary, until we've figured out
the proper way of hooking this up
2019-04-29 02:37:58 +00:00
Matthias Clasen
06aefb8237 Introduce event controller propagation limits
Limit event handlers by default to only handle
events targeting the same surface as their widget.
2019-04-29 02:37:58 +00:00
Matthias Clasen
a176816343 popover: Implement buds check-resize 2019-04-29 00:39:35 +00:00
Matthias Clasen
de4d89c949 window: Implement buds check-resize 2019-04-29 00:39:35 +00:00
Matthias Clasen
ac884842ce Introduce GtkBud
Split off the surface-handling bit from GtkRoot,
and make GtkPopover only implement this interface.
GtkWindow implements both GtkRoot and GtkBud.
2019-04-29 00:39:03 +00:00
Jonas Ådahl
39c8d4a324 wayland: Only check incorrect top-most for grabbing popups 2019-04-28 12:36:06 +00:00
Alexander Larsson
72fbe7e211 surface: Remove gdk_surface_set/merge_child_input_shapes()
These are useless now that we don't have child surfaces
2019-04-28 12:36:06 +00:00
Alexander Larsson
fd83f471fe surface: Remove old debug code 2019-04-28 12:36:06 +00:00
Matthias Clasen
a5e7bc2a37 main: Remove special-case hiding popopvers
This is now happening in GDK, so we don't have
to do this here anymore.
2019-04-28 12:36:06 +00:00
Matthias Clasen
bc60ee8454 popover: Use gdk_surface_show_with_auto_dismissal
The new api is made for this case.
2019-04-28 12:36:06 +00:00
Matthias Clasen
364621688b surface: Add gdk_surface_show_with_auto_dismissal
This api is meant to mimic xdg-popover.grab - we
show the surface, and dismiss it when we get events
on other surfaces. For foreign surfaces, the compositor
handles that for us; for our own, we check outselves
before delivering events to GTK.
2019-04-28 12:36:06 +00:00
Matthias Clasen
5fdb7d9f45 broadway: Track popups
This is more or less a 1:1 copy of the X11 code.
2019-04-28 12:36:06 +00:00
Matthias Clasen
6dbc091f1f popover: Track the parent position
Use the new surface-transform-changed-callback functionality
to move the popover whenever the parent changes its
position in the window. This currently works for X11,
but not for Wayland (due to restrictions in the
move-to-rect implementation.
2019-04-28 12:36:06 +00:00
Matthias Clasen
f7bedacecb x11: Make popups move with their parent
This is another step towards implementing
popup semantics for X11.

We do a sort-of ok job on stacking order
here - whenever the parent window gets a
ConfigureNotify, we just restack all popups
directly on top of their parent. This is good
enough to keep popups on top of their parent
while we drag it around, and it gets the popup
to disappear when raising another window on
top of the parent.
2019-04-28 12:36:06 +00:00
Matthias Clasen
efff718d4e x11: Make popup surfaces use o-r windows
This is a step towards a full implementation
of popup surfaces for X11.
2019-04-28 12:36:05 +00:00
Matthias Clasen
afb8bc6478 wayland: Use popup parents
Make the Wayland move-to-rect implementation
use popup parents.
2019-04-28 12:36:05 +00:00
Matthias Clasen
d9a8d78b38 surface: Stop setting transient-for for popups
This was just a hack to reuse the existing
infrastructure. Now that we store parents separately,
stop doing it.
2019-04-28 12:36:05 +00:00
Matthias Clasen
2a36ba48fa surface: Make move-to-rect work for popups
Now that we store popup parents separately,
the client-side move-to-rect implementation
must use them.
2019-04-28 12:36:05 +00:00
Matthias Clasen
194ee05f2f surface: Store popup parent
Store popup parents separately from transient-for parents,
since these are separate concepts with different behaviors.
2019-04-28 12:36:05 +00:00
Matthias Clasen
3da781e2fe x11: some leftover cleanups
Every surface is toplevel now. no need to check
2019-04-28 12:36:05 +00:00
Matthias Clasen
c0d853151a wip: popup surface type 2019-04-28 12:36:05 +00:00
Matthias Clasen
01c65a07d2 x11: Remove useless checks
All surfaces are toplevels now, no need
to check for this all over the place.
2019-04-28 12:36:05 +00:00
Matthias Clasen
9193d07206 Get rid of GdkSurfaceImpl
We don't need the complicated wrapper system anymore,
since client-side windows are gone. This commit moves
all the vfuncs to GtkSurfaceClass, and changes the
backends to just derive their surface implementation
from GdkSurface.
2019-04-28 12:36:05 +00:00
Matthias Clasen
af77b8f4a0 surface: Add a frame-clock property
This will let us shift things around later.
2019-04-28 12:36:05 +00:00
Matthias Clasen
e40ca67c4e gdk: Add a private header
This is in preparation for getting rid of GdkSurfaceImpl.
2019-04-28 12:36:05 +00:00
Matthias Clasen
2542bfcd76 Rename surface constructors
We want to use a gdk_surface_new_popup for popups,
and align the constructor names with the surface
types, so rename

gdk_surface_new_popup -> gdk_surface_new_temp
gdk_surface_new_popup_full -> gdk_surface_new_popup

The temp surface type will disappear eventually.
2019-04-28 12:36:05 +00:00
Matthias Clasen
3301c8dc74 gdk: Drop pass-through surfaces
With client-side windows gone, this property
is no longer used at all, and has been replaced
by a similar concept on the widget level.
Drop it.
2019-04-28 12:36:05 +00:00
Matthias Clasen
5709c6eb40 gdk: Drop GdkWindowAttr
All the information in it is already contained
in the surface object we pass along, and none
of the backend implementations were using the
attributes at all.
2019-04-28 12:36:05 +00:00
Matthias Clasen
6a8af95029 gdk: Drop input-only surfaces
We are not creating such surfaces anymore, and
they were only ever meaningfully implemented
on X11. Drop the concept, and the api for determining
if a surface is input-only.
2019-04-28 12:36:05 +00:00
Matthias Clasen
5c9aff53f0 gdk: Remove an unused field
Spring cleaning. We are not using this field
at all, since we have the input_only boolean.
2019-04-28 12:36:05 +00:00
Matthias Clasen
bbe9f4a03b entry completion: Various fixes
Make entry completion mostly work as a popover.

We need to disable treeview search, since it
creates a toplevel that will disrupt our grabbing
popup, causing it to be dismissed.

We don't need to grab ourselves, since the popover
code does it for us. We don't need to reposition our
window, since the popover takes care of that too.
2019-04-28 12:36:05 +00:00
Matthias Clasen
7a094d949e wip: Use a popover for entry completion
This lets us remove a use of GTK_WINDOW_POPUP,
which should eventually be going away.

This does not quite work yet - the popup is not
going away as it should.
2019-04-28 12:36:05 +00:00
Matthias Clasen
e3f4402aee surface: Cosmetics 2019-04-28 12:36:05 +00:00
Matthias Clasen
986f073a4f Drop gdk_surface_new_temp
This is no longer used, and the only difference
to gdk_surface_new_popup is input-only, which is
an X11-only concept.
2019-04-28 12:36:05 +00:00
Matthias Clasen
518ecd3406 menu: Stop using gdk_surface_new_temp
We can just as well use gdk_surface_new_popup.
2019-04-28 12:36:05 +00:00
Matthias Clasen
c9fb34f338 x11: Stop using gdk_surface_new_temp
We can just as well use gdk_surface_new_popup.
2019-04-28 12:36:05 +00:00
Matthias Clasen
80f71f3ebd broadway: Stop using gdk_surface_new_temp
This is in preparation for adding a proper
popup surface type.
2019-04-28 12:36:05 +00:00