Commit Graph

617 Commits

Author SHA1 Message Date
Rob Bradford
f061990bd5 window: Update _gtk_window_set_is_active API comment
The comment referenced GTK_TOPLEVEL which has been replaced by
GTK_WINDOW_TOPLEVEL.
2012-07-28 15:19:28 +01:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Matthias Clasen
644d62e2ce Trivial: remove a bit of obfuscation 2012-05-30 13:46:39 -04:00
Rui Matos
4d7c7ec32f window: Remove needless call to ensure_state_flag_backdrop() on map
This call was forcing needless work since gtk_window_map() already
does a gdk_window_show() which initially sets GDK_WINDOW_STATE_FOCUSED
that we then handle regularly on the widget's window state event
handler.

https://bugzilla.gnome.org/show_bug.cgi?id=673237
2012-05-03 17:24:05 -07:00
Benjamin Otte
d22a632b54 window: Validate style context before first allocation
When we don't do that, we completely botch sizing popups. Not good.

Fixes remaining failing reftests
2012-05-02 02:00:11 +02:00
Benjamin Otte
090f30c559 container: Remove duplicated flag
GtkContainer::need_resize and GtkWidget::alloc_needed are the same
thing.
2012-04-17 08:59:22 +02:00
Benjamin Otte
e7a984b337 window: Set parent context instead of just resetting style
Otherwise the inherit properties won't inherit properly.
2012-04-17 08:59:10 +02:00
Matthias Clasen
050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Rob Bradford
a2792b983c window: Fix typo in documentation for gtk_window_get_position 2012-02-23 11:45:49 +00:00
Michael Natterer
914053a2a3 gtk_window_set_attached_to: ref(), not ref_sink() the attach_widget
The attached popup doesn't take ownership of its "parent" widget, so
ref_sink() was wrong, and caused widgets to be leaked.
2012-02-21 01:06:43 +01:00
Benjamin Otte
f01cef05c8 window: Avoid unnecessary attach-widget resets 2012-01-31 03:43:43 +01:00
Matthias Clasen
691a94214a Fix doc syntax 2012-01-20 08:17:39 -05:00
Matthias Clasen
681871dd9e GtkApplicationWindow: Fix resize grip positioning
Based on a patch by Carlos Garcia Campos, bug 668248
2012-01-20 01:01:08 -05:00
Ryan Lortie
ba9546ff32 Don't call set_application() in gtk_window_realize
This call has no effect and with the newly-added restrictions it's
violating the set-application-after-realized rule.

https://bugzilla.gnome.org/show_bug.cgi?id=668203
2012-01-18 14:53:08 -05:00
Ryan Lortie
85fcd50b3f Revert "set the G_PARAM_CONSTRUCT flag on the GtkWindow:application property"
This reverts commit d4fe912879.

This patch caused some unanticipated compatibility issues.
2012-01-17 10:56:30 -05:00
Matthias Clasen
46ee761c0d Expand the docs for GtkWindow::attached-to 2012-01-12 20:39:48 -05:00
Cosimo Cecchi
c4a13b5287 window: improve docs for gtk_window_set_attached_to() 2012-01-12 14:03:00 -05:00
Andrea Cimitan
4a18fe7ef2 Introduce gtk_window_get/set_attached_to()
gtk_window_get/set_attached_to() is a new API that allows for windows to
be attached to a GtkWidget.
The attachment is a logical binding between the toplevel window and the
widget that generated it; this kind of information is currently used to
propagate style information from the widget to the window, but is also
useful e.g. for accessibility.

https://bugzilla.gnome.org/show_bug.cgi?id=666103
2012-01-12 14:03:00 -05:00
Guillaume Desmottes
d4fe912879 set the G_PARAM_CONSTRUCT flag on the GtkWindow:application property
This allows subclass to get the value of this property in their constructed
method.

https://bugzilla.gnome.org/show_bug.cgi?id=667628
2012-01-10 16:03:57 +01:00
Rui Matos
e9adaabc5e Rename 'window-unfocused' to 'backdrop'
'window-unfocused' is too long and mentions "focus" which is historically
loaded with the meaning "input focus".

'backdrop' isn't generally used in GUI speak and still conveys the state the
widgets in an unfocused or background toplevel window are in.
2012-01-09 18:38:00 +01:00
Rui Matos
09979513b2 window: Stop setting state flags on the style context for drawing
This also removes setting the FOCUSED state flag when
gtk_window_has_toplevel_focus() since this effect can now be done with the new
WINDOW_UNFOCUSED flag instead which actually works better regarding X grabs
and modal windows.
2012-01-09 16:45:44 +00:00
Matthias Clasen
69a529572d Revert "GtkWindow: new API to store state in GSettings"
This reverts commit 730765de91.

This needs more thought, committing it on the same day as filing
the bug was premature.
2012-01-09 00:53:53 -05:00
Ryan Lortie
730765de91 GtkWindow: new API to store state in GSettings
https://bugzilla.gnome.org/show_bug.cgi?id=667438
2012-01-06 16:18:48 -05:00
Javier Jardón
d005b01319 gtk/*: Use g_list_free_full() convenience function 2012-01-05 04:22:43 +01:00
Chun-wei Fan
d273b817e8 Bug 667018-gtk/gtkwindow.c: Include deprecated/gtkstyle.h
This is needed for the prototype of gtk_widget_reset_rc_styles, to avoid
C4013/implicit declaration of ... warnings of that function
2011-12-30 17:25:48 +08:00
Ryan Lortie
90fcf994d5 GtkApplication: export windows on the bus
And advertise their location on the bus using X11 properties.
2011-12-19 12:51:11 -05:00
Colin Walters
9c52a73c21 window: Set a _DBUS_APPLICATION_ID X11 window property
This will allow gnome-shell to reference it.
2011-12-19 12:51:07 -05:00
Matthias Clasen
020c1846b7 Use the workarea when placing popups
This uses the new workarea API to avoid placing popups underneath
panels, docks, etc.
2011-12-18 14:29:16 -05:00
Florian Müllner
4f8f8fe828 window: Add hide-titlebar-when-maximized property
For maximized windows, titlebars cannot be used to reposition or
scale the window, so if an application does not use it to convey
useful information (other than the application name), the screen
space occupied by titlebars could be put to better use.
Add a new window property which requests from the window manager
to hide titlebars when windows are maximized to account for this.

https://bugzilla.gnome.org/show_bug.cgi?id=665616
2011-12-15 16:31:56 +01:00
Alexander Larsson
93c086ec80 Make window handle transparent
Instead of painting the window background on the grip_window we now
only paint it on the GtkWindow->window, and we make the grip_window
have a transparent background.

We can't really make transparent window handle background optional
via css atm, because the handle color is actually based on the
background color, so if that is set to transparent we won't draw
anything.
2011-12-05 12:51:55 +01:00
Michel Dänzer
ab34c79896 Fix gdk_cairo_region_create_from_surface on big endian
gdk_cairo_region_create_from_surface doesn't work correctly on PPC.
This is most prominently seen with the GTK window resize grip, the
shape of which is mirrored every eight pixels horizontally.

At the same time, use an A1 surface for the resize grip shape to
eliminates an A8->A1 surface conversion.
2011-11-19 12:23:27 -05:00
Benjamin Otte
1c22053baf window: Fix cast warnings 2011-11-08 21:14:05 +01:00
Rui Matos
70f87b8bd5 gtk: Add a GTK_STATE_FLAG_WINDOW_UNFOCUSED widget state flag
This allows themes to style widgets differently according to whether the
toplevel window they are in is presented as focused.

https://bugzilla.gnome.org/show_bug.cgi?id=661428
2011-11-08 19:33:22 +00:00
Matthias Clasen
7644ef1e3a GtkWindow: Use new begin_resize_drag api
We have an event, so the correct thing to do is to pass
the device into the function that we are calling. GDK
just grew a variant that takes a device, for this purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=663444
2011-11-05 01:14:30 -04:00
Rui Matos
2720574ab9 gtkwindow: Clean up gtk_window_map()
Remove unneeded variable and delete trailing whitespace.
2011-10-01 01:28:30 +01:00
Matthias Clasen
5ff8fe6971 Documentation fixes
Mostly making sure that return values and varargs don't loose
their docs.
2011-09-25 21:04:49 -04:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Matthias Clasen
ed08baccd9 Convert GailWindow to GtkWindowAccessible
While doing this, drop the get_mdi_zorder implementation
that really should come from the window manager side. Dropping
this saves some 500 lines.
2011-07-05 16:08:57 -04:00
Matthias Clasen
f1a9c3efff Remove unused includes
Nothing is using gtkrc.h functionality any more.
2011-06-16 23:33:43 -04:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Javier Jardón
7b0d77def5 gtkcontainer: Move private functions to private header
https://bugzilla.gnome.org/show_bug.cgi?id=651707
2011-06-06 12:10:29 +01:00
Benjamin Otte
97a8ff80cc window: Only draw resize grip if its window exists
Don't rely on priv->resize_grip_visible as the code comment in the
variable declaration indicates.
This fixes warnings with GtkPlug, which can cause resize_grip_visible to
be TRUE but grid_window to be NULL - running tests/teststatusicon
reproduces this.

This broke with 7ef113ce56
2011-05-23 15:56:09 +02:00
Matthias Clasen
73bf1740e9 Some additional auto-mnemonic fixes
Previously, we would also show mnemonics if the user hits
Ctrl+Alt, even though Ctrl+Alt+<x> does not actually trigger.
2011-05-06 14:10:23 -04:00
Rui Matos
6889d5b008 GtkWindow: set mnemonics visible on focus in if modifier is pressed
With gtk-auto-mnemonics on, we hide mnemonics on focus out. We should also
check if the modifier is pressed on focus in and if so, show mnemonics again.

https://bugzilla.gnome.org/show_bug.cgi?id=618815
2011-05-06 14:10:23 -04:00
Benjamin Otte
4f23dc34be window: Make non-resizable windows use default size for geometry hints
Previously, we were trying to size them by the default size, but then
setting the minimum size as the geometry hints' minimum and maximum
size.
2011-05-01 08:47:58 +02:00
Benjamin Otte
406b2e9e58 window: Remove overeagerness with new size guessing
Don't use the guessed size when we are interested in the minimum size.
So now we can really shrink menubars.

This reverts parts of 08b2ac1d90
2011-05-01 08:02:15 +02:00
Benjamin Otte
7962a4b716 window: Invert check that was wrong 2011-04-29 03:27:02 +02:00
Benjamin Otte
1763b3a0b5 window: Make comparison be the right direction
Messed something up there...
2011-04-27 15:27:52 +02:00
Benjamin Otte
85aebe74cf window: Be smarter about computing the default size
See the code comments for the reasoning behind this. After we don't
force a "guessed" minimum size for labels anymore, a lot of issues
started to surface that this patch attempts to fix. In particular:

1) Tooltips where wrapped as much as possible.
2) The recentchooser submenu displayed only ellipsize dots.
2011-04-27 00:27:29 +02:00