Commit Graph

896 Commits

Author SHA1 Message Date
Matthias Clasen
49433673fc Don't export GtkModifierStyle symbols
This is not public API, so don't export it.
2011-02-08 23:21:39 -05:00
Matthias Clasen
3a50b460c6 Update the context direction when emitting ::direction-changed
This makes the flipping example in testgtk work as expected again.
https://bugzilla.gnome.org/show_bug.cgi?id=632775
2011-02-07 20:37:09 -05:00
Matthias Clasen
23f9bdd586 Fix problems with state propagation
Sensitivity changes were not properly propagated down the
hierarchy. There were two issues here:

a) correctly identifying when a state change request affects
   sensitivity
b) not filtering out sensitivity in gtk_widget_propagate_state(),
  since gtk_widget_set_sensitivity() uses that to do its work

https://bugzilla.gnome.org/show_bug.cgi?id=641431
2011-02-07 11:27:50 -05:00
Tristan Van Berkom
1c20c93423 Optimize queue_resize_on_widget()
Optimized GtkSizeGroup code that is invoked for every queued resize
and every request that is not previously cached by trading qdata on
widgets for 3 extra bitfields on the GtkWidgetPrivate structure.
2011-02-08 00:39:51 +09:00
Carlos Garnacho
217d3fd796 GtkStyleContext is meant to have a GdkScreen
It is used to get the default providers, without them
the style context can't do much. A check for NULL screen
is done before any sensitive call to
gtk_style_context_set_screen(), in the hope that any widget
will open the display before doing anything related to
styling. Fixes bug #641429, reported by Bastien Nocera.
2011-02-06 11:21:42 +01:00
Matthias Clasen
bfaf472e70 Avoid tons of warnings from stylecontext initialization without screen
This reverts part of commit 4dc9b29.
2011-02-05 11:21:21 -05:00
Matthias Clasen
4dc9b294d8 Don't assume a screen exists before realize()
Fix for https://bugzilla.gnome.org/show_bug.cgi?id=641429
2011-02-04 22:03:11 -05:00
Benjamin Otte
fac914d70c API: gtk: Remove client_event vfunc from GtkWidget
Also remove the (de-facto unused) implementation from GtkWindow that was
only used for sockets/plugs.
2011-02-01 06:33:01 +01:00
Kristian Rietveld
9dcdca2501 Don't use GTK_IS_PLUG for non-X11 backends 2011-02-01 00:26:04 +01:00
Stefan Kost
1f3a5a8d92 Clarify key-{press,release}-event docs.
Mention key-repeat in key-press and fix a copy'n'paste in key-release docs.
2011-01-31 23:10:10 +02:00
Matthias Clasen
0208539c4b Remove RC file references from docs where appropriate 2011-01-31 09:34:46 -05:00
Matthias Clasen
5caa76c5df Fix compiler warnings about unused variables 2011-01-30 01:50:58 -05:00
Matthias Clasen
10b6afa1f5 Improve some deprecation notes 2011-01-29 23:09:51 -05:00
Matthias Clasen
f783a75d61 Add a gtkx.h header for X11-specific GTK+ api
This keeps us from pulling gdkx.h into gtk.h

https://bugzilla.gnome.org/show_bug.cgi?id=640902
2011-01-29 14:16:47 -05:00
Carlos Garnacho
8a056d4774 Move "widget/window under device" accounting to be per-widget
This management is better done per-widget rather than per-screen,
as windows being destroyed won't trigger a leave notify for the
devices on top of it, and this information is too transitive
to keep weak refs and such.

This fixes the critical warning seen in gtk/tests/testing.
2011-01-29 14:45:05 +01:00
Tristan Van Berkom
5a5854f6f6 Add default class implementation of gtk_widget_get_request_mode().
Instead of checking if klass->get_request_mode is != NULL from
the gtk_widget_get_request_mode() api, this allows classes to
trust that there is a default implementation and chain up (specifically
added this for gtkmm wrapper objects).
2011-01-28 15:58:07 +09:00
Matthias Clasen
96af68529b Document that gtk_widget_queue_draw_area is in widget coordinates 2011-01-26 18:20:51 -05:00
Carlos Garnacho
e521158973 Make gtk_widget_get_state() only handle GtkStateType values available in 2.x
GtkStateType was generally used as an index in GtkStyle color arrays, so
bigger values will cause invalid memory accesses in widgets that are still
doing that. this was seen in focused GtkIconViews for example
2011-01-25 13:36:13 +01:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Matthias Clasen
a12dad75a2 Split out private style context api into a private header 2011-01-23 18:29:28 -05:00
Carlos Garnacho
b3ba85a01c Simplify GTK_STATE_FLAG_FOCUSED handling in state propagation.
Just unsetting it before propagating to the children suffices.
2011-01-23 19:34:50 +01:00
Carlos Garnacho
0c7772f0cf Do not unset sensitivity mistakenly in gtk_widget_set_state_flags()
together with commit 8903615a34, this finally fixes bug #640282.
Insensitivity is handled separatedly in _gtk_widget_update_state_flags(),
but the insensitive flag is mistakenly unset afterwards if clear is TRUE
in gtk_widget_set_state_flags().
2011-01-23 19:34:44 +01:00
Carlos Garnacho
6e553324f9 Make gtk_widget_get_state_flags() avoid propagating the focused flag down the hierarchy
There is only one widget supposed to have the focused flag at a given time,
so avoid propagating the state down the hierarchy, the focused flag is now
also set in _gtk_widget_set_has_focus().
2011-01-21 15:25:29 +01:00
Pavel Holejsovsky
374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
3c8fc21e9b [GI] Fixes of existing incorrect annotations 2011-01-20 13:56:06 +01:00
Carlos Garnacho
5f43a51a83 Make gtk_widget_get_path() also add all persistent style classes the widget has. 2011-01-17 04:44:03 +01:00
Javier Jardón
46f0994417 docs: gtkwidget: Add some "Since: 3.0" 2011-01-15 16:43:49 +00:00
Matthias Clasen
abc8ac1a8b Move GtkSelection docs inline
At the same time, move private selection API to gtkselectionprivate.h
2011-01-14 19:20:56 -05:00
Carlos Garnacho
42ad651914 Mark gtk_widget_style_attach() as deprecated.
This isn't needed anymore.
2011-01-10 23:51:48 +01:00
Carlos Garnacho
e426f76e57 Fix compiler warning. 2011-01-10 23:51:14 +01:00
Carlos Garnacho
fa2bfd93f8 Add gtk_widget_set_device_enabled()
This function is a more convenient variant than
gtk_widget_set_device_events(), as it will

1) perform changes down a widget hierarchy, to
all windows.
1) use the same event mask than gdk_window_get_events()
2011-01-10 23:01:02 +01:00
Carlos Garnacho
5c3b49ab14 Ensure GtkStyleContext is generated on gtk_widget_render_icon_pixbuf()
This fixes some warnings seen when this is called early
on non yet styled widgets.
2011-01-10 03:50:02 +01:00
Carlos Garnacho
e6277d3b82 Add gtk_style_context_cancel_animations()
This function takes a region ID and cancels all animations
on or beneath that region (as in push/pop_animatable_region).

First user of this is GtkWidget itself, so unmapped widgets
have looping animations cancelled. Fixes bug #638119, reported
by Jesse van den Kieboom.
2011-01-10 03:50:01 +01:00
Javier Jardón
cc0a65cb56 docs: Fix typo in GtkWidget geometry-management documentation
Reported by Andrew Cowie in
https://bugzilla.gnome.org/show_bug.cgi?id=638963
2011-01-08 10:56:59 +01:00
Tristan Van Berkom
93c8058582 Fixed GtkWindow/GtkWidget to properly emit hierarchy changed for embedded toplevels
Now GtkWindow takes some measures when setting toplevelness:

  - When a window becomes toplevel after being embedded it saves
    the visibility state and reshow's itself so that the window
    re-realizes and presents itself again automatically

  - When emitting hierarchy-changed, synthetically mark the toplevel
    as not anchored, this allows the hierarchy changed propagation to
    recurse properly.

GtkWidget also takes care to unset the parent window *after* unparenting
the widget and after emitting the heirarhcy changed that leaves a NULL
toplevel.

That means there are now 2 cycles of "hierarchy-changed" when removing
an embedded toplevel from a parent, first one that makes the new toplevel
a NULL one (since the toplevel flag is not yet restored), the second cycle
makes the removed window toplevel again when setting the parent window
to NULL.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
aa787c9dd1 Fixed focus handling on embedded windows.
Now GtkWindow chains up in focus vfuncs when non-toplevel, this
fixes focus in testtoplevelembed.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
2dfa855bc4 Moved location of unsetting parent window inside gtk_widget_unparent().
Make sure to do this after the widget is unrealized.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
fdba9f281d Fixed issues with "hierarchy-changed" signal.
GtkFileChooserDefault watches the toplevel and montitors "set-focus"
signal on it... however the connection needs to be remade when the
GtkFileChooserDialog is in an embedded toplevel.

Measure's taken: GtkWindow propagates hierarchy changes when
_gtk_window_set_is_toplevel() is called, gtk_widget_unparent()
unsets the widget's parent window earlier in the function so that
the possible hierarchy change is still able to properly access the hierarchy.

GtkFileChooserDefault checks if the "new" toplevel is indeed
gtk_widget_is_toplevel() but not the old one, GtkRange has been
updated to use gtk_widget_is_toplevel() inside it's hierarhcy_changed
vfunc, other classes already do this properly.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
6299f61ee7 Added docs to gtk_widget_set_parent_window.
Also stop setting the resize mode of the window.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
8b4b62f00c Allow GtkWindow to be parented if gtk_widget_set_parent_window() is called on one
This patch makes gtk_widget_set_parent_window() undo the toplevelness
of a GtkWindow, GtkWindow then realizes itself as a normal child widget
and behaves like a normal GtkBin by checking gtk_widget_is_toplevel() in
several places (show/hide/map/unmap/draw/size_allocate/check_resize/configure_event).
2011-01-06 14:39:40 +09:00
Matthias Clasen
b123bc41fd Move docs for gtkmain inline
At the same time, introduce a gtkmainprivate.h header
and various other cleanups.

Based on a patch by Tadej Borovšak.
https://bugzilla.gnome.org/show_bug.cgi?id=617471
2011-01-04 17:32:12 -05:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Carlos Garnacho
dd8887c07d Compress all ::style-updated prior to ::realize
This is done to avoid early emission of this signal, that was
causing warnings during GtkDialog construction.
2011-01-04 03:06:09 +01:00
Matthias Clasen
1bcf8a0027 Remove sealed members from GtkSettings 2010-12-23 21:56:50 -05:00
Matthias Clasen
3a6800a898 Some small doc corrections 2010-12-23 11:18:50 -05:00
Matthias Clasen
9baf24f87e Add a default handler for drag_failed
And use it in notebook dnd.
2010-12-22 18:46:29 -05:00
Matthias Clasen
e6693ab840 Avoid invariant checking spew in gnome-shell
For normal toplevels, visible is tightly bound to mapped, but for
something like a toplevel that exists within a Clutter stage we
may want to make mapping dependenton external factors, so we shouldn't
actually checked that !mapped toplevels are !visible.

Pointed out by Owen Taylor,

https://bugzilla.gnome.org/show_bug.cgi?id=637834
2010-12-22 16:54:52 -05:00