Commit Graph

1473 Commits

Author SHA1 Message Date
Timm Bäder
8f734b01b2 window: Plug a GList leak
We need to free the GList manually when using g_list_remove_link().
2019-07-21 12:45:10 +02:00
Timm Bäder
8beea4d958 window: Merge some functions into their only callers
So it's clear we only add or remove the pointerfocus-es in
_update_pointer_focus.
2019-07-21 11:06:24 +02:00
Timm Bäder
264d4bada6 widget: Remove queue_resize_no_redraw
We always invalidate the widget in size_allocate() anyway.
2019-07-07 07:43:08 +02:00
Emmanuele Bassi
e07098da03 window: Create a GtkConstraintSolver
Implement the GtkRoot getter for GtkConstraintSolver.
2019-06-30 23:42:44 +01:00
Matthias Clasen
996f011ed8 window: Fix the default value of mnemonics-visible
They aren't visible, so why should the property
be TRUE?
2019-06-23 10:59:17 -04:00
Matthias Clasen
7e73da5f73 widget: Add parameter type back to install_action
Adapt all callers.
2019-06-22 16:48:16 -04:00
Matthias Clasen
9b0d87c5a7 window: Cosmetics 2019-06-21 02:55:27 +00:00
Matthias Clasen
dee9e40ad3 Build fix 2019-06-20 22:47:35 -04:00
Matthias Clasen
a933a9bc79 Fix initial mnemonic visibility
We were showing mnemonics initially, which is not desired.
2019-06-21 02:38:05 +00:00
Matthias Clasen
6a4a082660 main: Move visible mnemonics handling
No need to special-case this anymore; we can use
a regular event controller in GtkWindow for this.
2019-06-21 02:37:51 +00:00
Matthias Clasen
a7cdcdf92c main: Move visible focus handling
No need to special-case this anymore; we can use
a regular event controller in GtkWindow for this.
2019-06-21 02:37:12 +00:00
Daniel Boles
ab7b9d882e Window: Hyperlink to GtkBuildable from its section 2019-06-18 21:45:08 +01:00
Matthias Clasen
dafb7054a1 window: Use the new action machinery
Change the default.activate action to use the
new action machinery.
2019-06-18 14:47:33 -04:00
Matthias Clasen
31066a697b window: Fix focus wraparound
If tab focus falls off the end, and we have an empty headerbar,
we end up with window->focus == NULL. Don't let that happen
2019-06-11 10:14:14 -04:00
Matthias Clasen
aa267c1c84 Add gtkmenubarprivate.h
Move private api into a private header.
2019-06-01 21:56:49 +00: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
b867cbe0d8 Cosmetics
Remove an unused variable.
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
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
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Benjamin Otte
56db17e5e8 Revert "window: Chain up in show/hide"
This reverts commit 863f4d13ff.
2019-05-29 16:52:13 +02:00
Benjamin Otte
863f4d13ff window: Chain up in show/hide 2019-05-29 16:34:56 +02:00
Руслан Ижбулатов
90058ed951 Don't assume that gdk_surface[_move]_resize() is asynchronous
On Windows that call resizes the native window immediately,
and the corresponding GDK event is emitted and processed
before the control is returned to gtk_window_move_resize().
Therefore, update freeze and configure_request_count increment
must happen before the call, not after it.
2019-05-28 20:25:17 +00:00
Matthias Clasen
5ccb081fdb Avoid compiler warnings
Avoid priv being flagged as unused on win32.
2019-05-28 20:25:17 +00:00
Matthias Clasen
948347afa9 Stop using gtk_widget_is_toplevel 2019-05-28 20:25:16 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
0b3a971056 window: Make unrealize work again
GtkWidgets unrealize accesses the frame clock
of the surface, so we need to keep the surface
in place until after we've chained up.
2019-05-28 20:25:15 +00:00
Matthias Clasen
b99962e7a2 Drop gtk_widget_set_surface
Not used anymore. Only GtkNative's have surfaces.
2019-05-28 20:25:15 +00:00
Matthias Clasen
0047492bf9 Work toward dropping widget->surface
Drop special-casing of GtkNative in
most widget vfuncs. GtkNative implementations
need to override these anyway.
2019-05-28 20:25:15 +00:00
Matthias Clasen
18788c2a86 Remove gtk_widget_get/set_has_surface
These serve no purpose anymore - widgets don't
have surfaces, unless they're a GtkNative.
2019-05-28 20:25:15 +00:00
Matthias Clasen
1f2d3c0900 window: Don't inherit cursors across surfaces
I can't think of a case where this is the desired
behavior. So, instead of setting an explicit cursor
on all popups, just stop walking the parents at
surface boundaries.
2019-05-28 20:25:15 +00:00
Matthias Clasen
d2951d3aac 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-05-28 20:25:14 +00:00
Matthias Clasen
81a673c908 window: Stop using gtk_widget_register_surface
The GtkRoot implementations are expected to handle
the necessary surface setup themselves, going forward.
2019-05-28 20:25:14 +00:00
Matthias Clasen
6ab8ab87c8 Reimplement GtkPopover 2019-05-28 20:25:13 +00:00
Matthias Clasen
9059eee2f0 Review and replace uses of get_toplevel
Now that roots can have parent widgets, we need to
carefully examine all calls of gtk_widget_get_toplevel,
and replace them with gtk_widget_get_root if we want
the nearest root, and not the ultimate end of the parent
chain.
2019-05-28 20:24:39 +00:00
Matthias Clasen
c1d5e82d95 Use GtkNative APIs instead of GtkRoot 2019-05-28 20:24:39 +00:00
Matthias Clasen
5bf2b633bb window: Implement GtkNative
Adapt GtkWindow to implement both GtkRoot and GtkNative.
2019-05-28 20:24:39 +00:00
Benjamin Otte
9521af0f6a window: Remove unneeded variable
The variable would show up as a gcc warning in builds without X11
support.
2019-05-21 07:23:30 +02:00
Matthias Clasen
04754d753b Reinstate the activate-focus keybinding
Commit 3b62d9c027 was a bit overzealous in
removing not just the public API for activating the focus
widget, but also the plumbing needed to make the keybinding
work.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1879
2019-05-12 18:07:33 +00:00
Matthias Clasen
32fd55a66d window: Stop duplicating focus change events
We had code in gtkwindow.c that generated duplicate,
and defective, focus-change events, in the following
way:
- gtkmain.c generates a chain of focus-change events
  for moving focus from one window to another
- gtkwindow.c catches a focus-in event in the middle
  of this chain and sets itself as 'active'
- and then it proceeds to generate focus-change
  events towards its own focus widget without a
  related target
This is not necessary since we gtkmain.c already
generates a complete sequence of focus-change events.
So stop doing it.
2019-05-04 18:22:33 +00:00
Matthias Clasen
9af01bea5e window: Make _gtk_window_set_is_active static
It is not used outside gtkwindow.c.
2019-05-04 18:22:28 +00:00
Matthias Clasen
33a8108f19 window: Implement display change via root/unroot
Export gtk_widget_root/unroot privately,
make them work on roots, and use them in
gtk_window_set_display. This gets us to a
single way to listen for display changes,
the root property.
2019-05-01 23:05:09 +00:00
Matthias Clasen
26b17473aa window: Prevent resize cursors from sticking
When a modal dialog is smaller than its parent,
we were keeping the resize cursor from the dialogs
edge all over the parent window, which looks
really irritating, since the resize cursors are
closely associated with the window edge. Fix
this by falling back to the default cursor
outside the grab widgets surface.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/23
2019-04-30 20:19:35 -04:00
Matthias Clasen
89d1f8c3ca window: Set cursor on the right surface
Set the cursor on the surface of the target
widget, not the surface of some of its parents.

This does not make a difference currently.
But it will in the future, when we have
parented widgets with surfaces.
2019-04-29 14:51:55 -04:00
Matthias Clasen
92e21c3f1c Drop the can-default property
It was added at a time when default buttons
had a very large external border that would disrupt
aligment. Not a problem nowadays.
2019-04-28 23:28:39 +00:00
Matthias Clasen
89f7b974f2 Stop using gtk_widget_grab_default
Replace gtk_widget_grab_default by gtk_window_set_default_widget.
2019-04-28 23:21:51 +00:00