Commit Graph

842 Commits

Author SHA1 Message Date
Phillip Wood
beaba95f39 Window: Focus custom titlebar with F10
As discussed on desktop-devel-list [1], "There should be an intuitive,
consistent, immediate way to jump to the widgets that live in the
header bar." F10 has been suggested for this as it is already used to
active menubars.

F10 will focus the custom titlebar widget if the window has one and it
isn't already focused. If the titlebar widget doesn't exist or is
already focused then F10 focuses the menubar if there is one.

[1] https://mail.gnome.org/archives/desktop-devel-list/2014-February/msg00176.html

https://bugzilla.gnome.org/show_bug.cgi?id=725141
2014-03-09 20:26:54 -04:00
Carlos Garnacho
59a928f7c8 window: Turn popovers into internal children
It turns out popovers are already smart enough to cope with this
situation, so let popovers be internal children so things that rely
on gtk_container_forall(), like DnD, work without modifications.

https://bugzilla.gnome.org/show_bug.cgi?id=725727
2014-03-06 23:21:43 -05:00
Matthias Clasen
db9a6f8caf Some more doc rewording 2014-03-03 18:13:24 -05:00
Phillip Wood
857e774a34 Fix typo in gtk_window_set_default() documentation
The documentation should link to gtk_widget_grab_default() rather than
gtk_widget_grab_focus().

https://bugzilla.gnome.org/show_bug.cgi?id=725559
2014-03-03 18:12:25 -05:00
Matthias Clasen
d64ae72c29 Take shadow size into account when positioning popovers
Without this, popovers have a tendency to protrude into the
invisible border of windows, which looks less than optimal.
2014-02-22 14:07:48 -05:00
Matthias Clasen
b01229db4b Fix popover life-cycle handling
c287845240 was trying to fix
the memory leak caused by popovers begin destroyed in
gtk_window_destroy before chaining up to gtk_widget_destroy,
which unrealizes the window, and would clean up the popover
windows if the popovers were still around.

Fix this in a better way by moving the popover destruction
after the chaining up, so we unrealize first, and then
destroy the popovers.

Also, make _gtk_window_remove_popover unrealize the popover,
for symmetry with _gtk_window_add_popover.

This should fix
https://bugzilla.gnome.org/show_bug.cgi?id=724921
2014-02-21 22:08:00 -05:00
William Jon McCann
c287845240 Unregister the popover before destroying it
Fixes a leak of the registered_windows list in GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=554618
2014-02-21 14:51:25 -05:00
William Jon McCann
0997303378 Don't leak list items of popovers 2014-02-20 16:41:15 -05:00
Jasper St. Pierre
ad0c4c3e83 window: Fix configure request debug code in move_resize
Make it compile in GTK+3 and switch pos_changed / size_changed
to be the right way around.
2014-02-20 13:55:23 -05:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
8bd94a9515 Fix a problem with window dragging
Dragging windows was not working on widgets in the titlebar
region unless they had the window-dragging style property
set. Fix this by looking at the region for motion notify
events as well as for buton press events.
2014-02-15 20:41:58 -05:00
Matthias Clasen
c779b42476 Docs: use // for comments in examples
Without sgml mode, we can't escape /* as /* anymore,
so just switch to // for comments in examples.
2014-02-14 23:34:22 -05:00
William Jon McCann
37a8ee6e95 docs: fully break lines in examples
Try to do a better job of keeping example content
from being too wide. It is often rendered as <pre>
text so the only time we can wrap it is in the source.

It is best to full break lines at all punctuation and
to try to keep the width under 70 chars or so.
2014-02-12 18:42:50 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
326da2da58 docs: don't use <anchor> 2014-02-07 15:40:52 -05:00
William Jon McCann
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
William Jon McCann
cb6483d382 docs: use apostrophe in *'d 2014-02-07 13:39:53 -05:00
William Jon McCann
a4b5929e81 docs: use apostrophe in *'re 2014-02-07 13:37:09 -05:00
William Jon McCann
285d216d3e docs: use apostrophe in *'ll 2014-02-07 13:35:54 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
Claudio Saavedra
b91859a19a gtkwindow: remove delete-event idle function on finalize
Heavy duty can prevent this idle function from being called before
the window is destroyed, so make sure that the source is removed
when the window is finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=723771
2014-02-06 18:18:23 +02:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
3b3d8ca456 docs: Use "#" for refsect2 instead of ## 2014-02-04 21:00:58 -05:00
William Jon McCann
5dd751f006 docs: don't use ulink. use markdown instead 2014-02-04 18:53:51 -05:00
William Jon McCann
a22358c0c0 docs: use ` instead of <literal> 2014-02-04 18:24:29 -05:00
William Jon McCann
6ba5e6bb1a docs: don't use <tag> docbook elements 2014-02-04 17:38:09 -05:00
Matthias Clasen
8ca2376495 Ignore hide-titlebar-when-maximized for custom titlebars
Try this again, this time being a bit more careful about size
allocation of titlebars.
2014-02-04 08:07:26 -05:00
Matthias Clasen
9177b3c0d2 Revert "Ignore hide-titlebar-when-maximized for CSD"
This reverts commit 54ec157599.
2014-02-04 08:07:26 -05:00
Matthias Clasen
0c483e1423 Make gtk_window_set_titlebar work on realized windows
Since realize does a lot of the heavy lifting of setting up
csd, we have to re-realize the window if we go from no-custom
titlebar to a custom titlebar or vice versa.

https://bugzilla.gnome.org/show_bug.cgi?id=722919
2014-02-03 22:38:06 -05:00
Matthias Clasen
365902cd58 Re-realize the window if needed
When gtk_window_set_titlebar is called, we need to set up
client-side decorations properly, and the easiest way to do
so is to realize the window again. Really, you should call
set_titlebar before the window is realized.

https://bugzilla.gnome.org/show_bug.cgi?id=722919
2014-02-03 22:22:27 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
Matthias Clasen
54ec157599 Ignore hide-titlebar-when-maximized for CSD
This setting really only makes sense for wm titlebars,
client-side titlebars are under application control
anyway.
2014-01-31 08:45:23 -05:00
William Jon McCann
e31ebda1d7 docs: don't escape entities in example code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
2d003553e8 docs: don't use <emphasis>
It is a little heavy handed. The text can speak for itself.
2014-01-28 02:02:05 -05:00
David Schleef
26b4fc65b9 window: add note about window references
https://bugzilla.gnome.org/show_bug.cgi?id=665928
2014-01-24 23:53:13 -05:00
Matthias Clasen
e1d9974537 Drop internal uses of gtk_widget_get_root_window
This function is just a one-line convenience function that
is about to be deprecated.
2014-01-24 20:16:33 -05:00
Matthias Clasen
6e96111d9f GtkHeaderBar: try harder to find the best window icon
GtkWindow has 4 (!) APIs for setting window icons, and we
have to try them all in the right order to find the right
icon. This commit makes it so, and keeps the icon list
manipulation inside gtkwindow.c by adding a private API
for getting a single icon at the right size.

https://bugzilla.gnome.org/show_bug.cgi?id=722515
2014-01-24 15:40:37 -05:00
Carlos Garnacho
090a4f0af3 window: add missing return
A branch in the if/else if/else was missing a return, that was
unintended.
2014-01-22 20:50:33 +01:00
Carlos Garnacho
168227165d window: Make popover window private 2014-01-22 17:10:07 +01:00
Carlos Garnacho
889a280979 window: Use GList to store popover structs
When all popovers are removed on destroy(), if a popover is nested into
(eg. with relative_to within) another popover, the removal of one can
lead to the other being removed while the hashtable is being iterated,
which would lead to undefined behavior in further iterations.

Then, use a GList to store popovers, iterating can be made more resilient
on these situations, and unless on pathological cases there's not going
to be as many of those popovers as to cause performance decreases at the
times those are iterated.
2014-01-22 17:10:06 +01:00
Carlos Garnacho
69182c03fb popover: Flip popovers positioning on left/right on RTL.
If widgets have GTK_TEXT_DIRECTION_RTL, popovers being positioned
on GTK_POS_LEFT/RIGHT will default to appearing on the other side
too.
2014-01-22 17:10:06 +01:00
Carlos Garnacho
a3b3b4621c window: Remove popovers on dispose() before unsetting focus.
The popovers may return keyboard grabs to previous widgets, so if
called after unsetting the focus, the window may be left with a
dangling GtkWidget that would cause crash at later dispose() calls.
2014-01-22 17:10:06 +01:00
Carlos Garnacho
31042fe95f popover: Fix memory management of popovers
Popovers are strange in the sense that they aren't attached to a
parent directly, they rely on the relative_to widget so the toplevel
is shared, and when they have a parent, it is the toplevel itself,
not relative_to. This also means that there are conditions where the
popover loses it's parent, so they must survive unparenting.

The previous code would be floating the last reference as soon as the
parent is gone, but it was non-obvious who'd own that reference. So
fix this situation by granting the ownership of popovers to their
relative_to widget, an extra reference may be held by the toplevel
when the popover has a parent, but the popover object will be
guaranteed to be alive as long as the parent lives.

This way, memory management of popovers is as hidden from the user
as regular widgets within containers are, users are free to call
gtk_widget_destroy() on a popover, but it'd eventually become
destructed when relative_to is.
2014-01-22 17:10:06 +01:00
Carlos Garnacho
36abb4b829 gtkmain: Let windows handle WM-related events before delivering to the grab_widget
This makes it possible to move/resize client-side decorated windows that are
otherwise obscured by a GTK+ grab somewhere else, either a popover within the
window itself or a modal dialog above the window.
2014-01-22 17:10:05 +01:00
Carlos Garnacho
db9e1d36d0 window: Keep track of popover children mapped status
In order to maintain visibility of the GdkWindow that's the parent window
of the popover widget.
2014-01-22 17:10:05 +01:00
Carlos Garnacho
ace25368b1 window: Add gtk_window_get_popover_position()
A getter to complement the setter
2014-01-22 17:10:05 +01:00