]> Pileus Git - ~andy/gtk/log
~andy/gtk
11 years agoAvoid infinite recursion in the ime input module
Matthias Clasen [Mon, 19 Nov 2012 14:29:51 +0000 (09:29 -0500)]
Avoid infinite recursion in the ime input module

11 years agostylecontext: Split out a function
Benjamin Otte [Sat, 17 Nov 2012 12:23:44 +0000 (13:23 +0100)]
stylecontext: Split out a function

The function is used in multiple places, so split it out. In particular
because I'm about to change it.

11 years agoquartz: use the real current event time for generated motion events
Michael Natterer [Sun, 18 Nov 2012 19:14:32 +0000 (20:14 +0100)]
quartz: use the real current event time for generated motion events
(cherry picked from commit b4a30877a9315ade584858f7259729dbda614bab)

11 years agoquartz: move tooltips window to the topmost level
Michael Natterer [Sun, 18 Nov 2012 16:42:31 +0000 (17:42 +0100)]
quartz: move tooltips window to the topmost level

so they can appear on top of popup menus. Also, reorder the switch()
statement in window_type_hint_to_level() so it resembles the stacking
order, to avoid confision like this in the future. Fixes bug 688512.
(cherry picked from commit 1a2509a6ab7f35caae758c2b31f40ef90d4fa94a)

11 years agoUpdated Norwegian bokmål translation
Kjartan Maraas [Sat, 17 Nov 2012 15:42:44 +0000 (16:42 +0100)]
Updated Norwegian bokmål translation

11 years agoUpdated Norwegian bokmål translation
Kjartan Maraas [Sat, 17 Nov 2012 15:14:38 +0000 (16:14 +0100)]
Updated Norwegian bokmål translation

11 years agocssprovider: Handle non-existing section
Benjamin Otte [Thu, 15 Nov 2012 18:18:19 +0000 (19:18 +0100)]
cssprovider: Handle non-existing section

Otherwise we'll get warnings on errors when CSS debug is disabled.

11 years agoquartz: GdkQuartzWindow -> GdkQuartzNSWindow was forgotten in one place
Michael Natterer [Thu, 15 Nov 2012 12:17:31 +0000 (13:17 +0100)]
quartz: GdkQuartzWindow -> GdkQuartzNSWindow was forgotten in one place

11 years agoquartz: filter out button press events on the window frame
Michael Natterer [Thu, 15 Nov 2012 10:34:15 +0000 (11:34 +0100)]
quartz: filter out button press events on the window frame

Don't try to handle button press events on the window frame, they
have out-of-window coordinates. Also, break grabs on such events
so popup menus go away.
Patch from Kristian Rietveld, fixes bug 684419.
(cherry picked from commit 43e1354b71640d3fb7a47b997a436dc65bbd922f)

11 years agofilechooser: remember sidebar width
Jonny Lamb [Wed, 14 Nov 2012 12:10:59 +0000 (13:10 +0100)]
filechooser: remember sidebar width

https://bugzilla.gnome.org/show_bug.cgi?id=524295

Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
11 years agoRevert parts of "window: Remove useless functions"
Benjamin Otte [Wed, 14 Nov 2012 18:35:47 +0000 (19:35 +0100)]
Revert parts of "window: Remove useless functions"

This reverts the size_allocate removal from commit
8449e05865b42a8c78b96f809b280aa5a4f044d8. That code was using
_gtk_window_set_allocation() instead of gtk_widget_set_allocation(). And
that broke glade.

11 years agoUpdated POTFILES.skip
Piotr Drąg [Wed, 14 Nov 2012 15:15:27 +0000 (16:15 +0100)]
Updated POTFILES.skip

11 years agosizerequest: Optimize CONSTANT_SIZE better
Benjamin Otte [Wed, 14 Nov 2012 13:03:47 +0000 (14:03 +0100)]
sizerequest: Optimize CONSTANT_SIZE better

We can set for_size to -1 earlier than we did. Doing so makes sure we
only cache one value (as we should in the first place). In GTK 3.6, this
worked properly, but with Previously, this check was moved further up to
avoid interacting with size groups. But after recent refactorings, size
groups are handled way earlier anyway.

11 years agostylecontext: Add a flag to force style_updated() emission
Benjamin Otte [Wed, 14 Nov 2012 12:24:58 +0000 (13:24 +0100)]
stylecontext: Add a flag to force style_updated() emission

This is used in gtk_widget_reset_style() (via GTK_CSS_CHANGE_ANY) now,
and that makes GtkSettings font related changes work again.

11 years agosizerequestcache: Move rest of code to array
Benjamin Otte [Wed, 14 Nov 2012 00:50:17 +0000 (01:50 +0100)]
sizerequestcache: Move rest of code to array

... of orientation. Reduces more duplicate if branches.

11 years agosizerequestcache: Make code an array
Benjamin Otte [Wed, 14 Nov 2012 00:35:38 +0000 (01:35 +0100)]
sizerequestcache: Make code an array

We can use orientation as the index into an array. That way we can
delete half the code. Do it for the base request first in this patch.

11 years agosizegroup: Simplify comparison
Benjamin Otte [Wed, 14 Nov 2012 00:29:06 +0000 (01:29 +0100)]
sizegroup: Simplify comparison

11 years agosizerequest: Use GtkOrientation
Benjamin Otte [Wed, 14 Nov 2012 00:25:21 +0000 (01:25 +0100)]
sizerequest: Use GtkOrientation

... instead of GtkSizeGroupMode. Orientation is what we're interested in
after all. When we need a GtkSizeGroupMode, we can do the translation
where we need it.

11 years agosizerequestcache: Move lookup function
Benjamin Otte [Wed, 14 Nov 2012 00:10:21 +0000 (01:10 +0100)]
sizerequestcache: Move lookup function

...and clean up its API.

11 years agosizerequestcache: Move commit function
Benjamin Otte [Tue, 13 Nov 2012 23:55:50 +0000 (00:55 +0100)]
sizerequestcache: Move commit function

11 years agowidget: Get rid of unused flags
Benjamin Otte [Tue, 13 Nov 2012 21:16:51 +0000 (22:16 +0100)]
widget: Get rid of unused flags

Now that we clear the cache immediately, there's no need anymore to
track if a request has been queued.

11 years agosizerequest: Cache the request mode
Benjamin Otte [Tue, 13 Nov 2012 21:02:53 +0000 (22:02 +0100)]
sizerequest: Cache the request mode

... in the GtkSizeRequestCache. That way, we only need to query it once,
and can remove the caching code from GtkContainer.

11 years agosizerequestcache: Make clear_cache clear all the cache
Benjamin Otte [Tue, 13 Nov 2012 20:51:29 +0000 (21:51 +0100)]
sizerequestcache: Make clear_cache clear all the cache

11 years agosizerequestcache: Move functions
Benjamin Otte [Tue, 13 Nov 2012 20:43:50 +0000 (21:43 +0100)]
sizerequestcache: Move functions

... into the sizerequestcache.c file.

11 years agoreftests: Turns out, green changed color
Benjamin Otte [Tue, 13 Nov 2012 20:41:08 +0000 (21:41 +0100)]
reftests: Turns out, green changed color

What used to be "green" is now "lime"

11 years agoreftests: Update named colors reftest
Benjamin Otte [Tue, 13 Nov 2012 20:21:10 +0000 (21:21 +0100)]
reftests: Update named colors reftest

Make reftest conform with correct colors. Pango has been updated to
these colors in commit d2c319b9ded8cce864914d9f1fd704a7aff3112f

11 years agosizerequest: Split out size request cache code into separate header
Benjamin Otte [Tue, 13 Nov 2012 12:41:05 +0000 (13:41 +0100)]
sizerequest: Split out size request cache code into separate header

11 years agoquartz: move SPLASHSCREEN-hinted windows to NSStatusWindowLevel
Michael Natterer [Tue, 13 Nov 2012 18:58:40 +0000 (19:58 +0100)]
quartz: move SPLASHSCREEN-hinted windows to NSStatusWindowLevel

which does not really have a different effect than the previously
used NSPopUpMenuWindowLevel, but is what all code examples I found
are using, and it does make more sense.
(cherry picked from commit 47f0e3f1e1cd6b0ae61ec7ced48cc9802f1a95a4)

11 years agoRemove bookmark duplicate of shortcut
Timothy Arceri [Wed, 31 Oct 2012 11:05:48 +0000 (22:05 +1100)]
Remove bookmark duplicate of shortcut

Application code can set shortcut folders that are already bookmarks.
This code causes the bookmarks to be refreshed after the shortcut is
added removing any possible bookmark duplicates

https://bugzilla.gnome.org/show_bug.cgi?id=577806

11 years agoVisual C++ property sheets: Update GtkBinaryVersion
Chun-wei Fan [Tue, 13 Nov 2012 06:26:08 +0000 (14:26 +0800)]
Visual C++ property sheets: Update GtkBinaryVersion

This should now be 3.0.0 like the autotools builds...

11 years agoAdd accessibles for GtkEntry icons
Mike Gorse [Sun, 11 Nov 2012 17:00:49 +0000 (11:00 -0600)]
Add accessibles for GtkEntry icons

Expose GtkEntry icons as child accessibles of a GtkEntry, and provide
actions to simulate clicking them. Also, refactor the a11y children test
slightly to add a test.

https://bugzilla.gnome.org/show_bug.cgi?id=686347

11 years agoSend a notification when a GtkEntry icon's tooltip text changes
Mike Gorse [Sun, 11 Nov 2012 17:01:57 +0000 (11:01 -0600)]
Send a notification when a GtkEntry icon's tooltip text changes

11 years agoreftests: Add a test for border-width problems
Benjamin Otte [Sun, 11 Nov 2012 19:26:05 +0000 (20:26 +0100)]
reftests: Add a test for border-width problems

11 years agobin: Handle border width if we have to
Benjamin Otte [Sun, 11 Nov 2012 19:24:58 +0000 (20:24 +0100)]
bin: Handle border width if we have to

Some bin subclasses call gtk_container_handle_border_width(), some
don't. So work with both cases.

11 years agocontainer: Simplify code
Benjamin Otte [Sun, 11 Nov 2012 18:48:41 +0000 (19:48 +0100)]
container: Simplify code

We will never get allocated a too small size, so no need to handle that
case.

11 years agowindow: Remove useless functions
Benjamin Otte [Sun, 11 Nov 2012 18:42:56 +0000 (19:42 +0100)]
window: Remove useless functions

Now that GtkBin implements sizing functionality, there's no need to do
the same in GtkWindow

11 years agobin: Only handle size for the child if it is visible
Benjamin Otte [Sun, 11 Nov 2012 18:30:11 +0000 (19:30 +0100)]
bin: Only handle size for the child if it is visible

11 years agoUpdated POTFILES.skip
Piotr Drąg [Sat, 10 Nov 2012 19:21:33 +0000 (20:21 +0100)]
Updated POTFILES.skip

11 years agotests: Add an intersection test for the recent bug
Benjamin Otte [Sat, 10 Nov 2012 17:54:35 +0000 (18:54 +0100)]
tests: Add an intersection test for the recent bug

Just using the hardcoded bitmasks triggered the bug fixed in commit
e8f2eeac9221d91ba32447bbcbdc5ba057647f8e - so just do that as the test.

11 years agotests: Add some bitmasks to the hardcoded list
Benjamin Otte [Sat, 10 Nov 2012 17:53:34 +0000 (18:53 +0100)]
tests: Add some bitmasks to the hardcoded list

The bitmasks with the 31st, 32nd and 63rd bit set are added. The make up
the largest bitmasks on 32bit/64bit that can be represented without
allocating and the smallest bitmask on 32bit that must be allocated.

11 years agobitmask: Fix intersection code
Benjamin Otte [Sat, 10 Nov 2012 17:35:37 +0000 (18:35 +0100)]
bitmask: Fix intersection code

With the fix in 77912a65e2aa6eb9cfee994fa93bbfbc6b9f8538, another bug
got visible: booleans are 32 bits, so if the intersection between the 2
bitmasks happened in higher bits, the return value would be truncated to
FALSE.

This actually made slider handles disappear, so it was pretty visible.

11 years agocssvalue: Make shade() work properly again
Benjamin Otte [Fri, 9 Nov 2012 19:30:48 +0000 (20:30 +0100)]
cssvalue: Make shade() work properly again

In a previous commit, I accidentally scaled the hue instead of the
saturation. Ooops.

11 years agoreftests: Add a test for all the color names
Benjamin Otte [Fri, 9 Nov 2012 19:23:56 +0000 (20:23 +0100)]
reftests: Add a test for all the color names

BIG NOTE: We fail on some of these to give the colors defined in the CSS
specs. This is not good, but I'm not sure how to best fix it.
For those cases, I've kept the correct color in the CSS file but added
the correct one next to it.

11 years agoUpdated POTFILES.skip
Piotr Drąg [Fri, 9 Nov 2012 23:38:13 +0000 (00:38 +0100)]
Updated POTFILES.skip

11 years agoicon-theme: Add some preconditions for NULL arguments
Stef Walter [Fri, 9 Nov 2012 10:55:44 +0000 (11:55 +0100)]
icon-theme: Add some preconditions for NULL arguments

Related to this crash: https://bugzilla.gnome.org/show_bug.cgi?id=687967

https://bugzilla.gnome.org/show_bug.cgi?id=687977

11 years agoMake _gtk_css_lookup_get_missing inline
Alexander Larsson [Fri, 9 Nov 2012 09:09:06 +0000 (10:09 +0100)]
Make _gtk_css_lookup_get_missing inline

This is called a lot in the loop in gtk_css_style_provider_lookup which
actually showed up on profiles.

11 years agogtk_css_style_provider_lookup: minor loop optimiziation
Alexander Larsson [Fri, 9 Nov 2012 09:06:55 +0000 (10:06 +0100)]
gtk_css_style_provider_lookup: minor loop optimiziation

This is a minor performance improvement but this loop
is run a lot so it actually matters in large state
changes.

11 years agoExit early in gtk_style_context_update_cache codepaths
Alexander Larsson [Fri, 9 Nov 2012 09:15:23 +0000 (10:15 +0100)]
Exit early in gtk_style_context_update_cache codepaths

If lookup->missing is empty we don't need to continue looking.
We short circuit in several places as this can happen
after iteratively makeign lookup->missing smaller.

11 years agoFix cnp bug in _gtk_bitmask_intersects
Alexander Larsson [Fri, 9 Nov 2012 08:05:47 +0000 (09:05 +0100)]
Fix cnp bug in _gtk_bitmask_intersects

We need to use the allocated codepath if *any* argument is
allocated, not if one arg is not allocated.
This bug caused unnecessary calls to _gtk_bitmask_is_allocated,
as well as return completely wrong result if both bitmask are
allocated.

11 years agogdk: Add gdk_window_has_alpha helper
Alexander Larsson [Wed, 7 Nov 2012 11:57:38 +0000 (12:57 +0100)]
gdk: Add gdk_window_has_alpha helper

This centralizes the current checks for has_alpha_bg, which
lets us extend the check later.

https://bugzilla.gnome.org/show_bug.cgi?id=687842

11 years agoAdd "parent widget" button to test property editor
Alexander Larsson [Wed, 7 Nov 2012 11:54:55 +0000 (12:54 +0100)]
Add "parent widget" button to test property editor

Without this its hard to access the properties of container
widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842

11 years agogtkbin: Remove the silliest code on earth
Jasper St. Pierre [Fri, 9 Nov 2012 00:13:52 +0000 (19:13 -0500)]
gtkbin: Remove the silliest code on earth

What is this bin doing with all these crazy deltas? Company does:

<Company> that can safely be removed
<Company> in general, code that isn't obvious can either be understood
<Company> with a bit of thinking or it can be removed
<Company> if in doubt, go for the 2nd of those :)

Most GtkBin subclasses override this strange garbage anyway, so it's
not like this code is ever *run*, per se. Just make it proxy directly
to the child, and hope nothing goes wrong.

11 years agogtkbin: Complete more of a base implementation for GtkBin subclasses
Jasper St. Pierre [Thu, 8 Nov 2012 23:21:01 +0000 (18:21 -0500)]
gtkbin: Complete more of a base implementation for GtkBin subclasses

Implement get_preferred_width, get_preferred_height, and size_allocate.
This allows GtkBin subclasses to be quick and easy, without the
author doing the subclassing to have to do much work.

11 years agogtkversion.h.in: Put the documentation inside the header guards
Jasper St. Pierre [Thu, 8 Nov 2012 23:40:38 +0000 (18:40 -0500)]
gtkversion.h.in: Put the documentation inside the header guards

This fixes a warning with gobject-introspecion scanning

11 years agoreftests: Add test for recent fix
Benjamin Otte [Thu, 8 Nov 2012 22:16:55 +0000 (23:16 +0100)]
reftests: Add test for recent fix

11 years agolabel: Fix another sizing corner case causing segfaults
Benjamin Otte [Thu, 8 Nov 2012 22:15:19 +0000 (23:15 +0100)]
label: Fix another sizing corner case causing segfaults

If the "wider" label is the smaller one, use the wider size for both
cases. This can happen when ellipsizing a single character, which is
often smaller than the ellipsizing glpyph(s).

11 years agostylecontext: Fix a memleak
Benjamin Otte [Thu, 8 Nov 2012 21:08:36 +0000 (22:08 +0100)]
stylecontext: Fix a memleak

11 years agostylecontext: Remove unused function
Benjamin Otte [Thu, 8 Nov 2012 17:21:45 +0000 (18:21 +0100)]
stylecontext: Remove unused function

11 years agocssvalue: Convert shadows to GtkCssColorValue
Benjamin Otte [Thu, 8 Nov 2012 16:33:53 +0000 (17:33 +0100)]
cssvalue: Convert shadows to GtkCssColorValue

11 years agocssimage: Use GtkCssColorValue
Benjamin Otte [Thu, 8 Nov 2012 16:25:26 +0000 (17:25 +0100)]
cssimage: Use GtkCssColorValue

11 years agocssstyleproperty: Replace symbolic colors with GtkCssColorValue
Benjamin Otte [Thu, 8 Nov 2012 16:22:56 +0000 (17:22 +0100)]
cssstyleproperty: Replace symbolic colors with GtkCssColorValue

11 years agocssvalue: Add GtkCssColorValue
Benjamin Otte [Thu, 8 Nov 2012 16:03:15 +0000 (17:03 +0100)]
cssvalue: Add GtkCssColorValue

This is mostly copy/paste from GtkSymbolicColor and is indeed intended
to replace it.

11 years agosymboliccolor: Change the print output
Benjamin Otte [Thu, 8 Nov 2012 15:17:00 +0000 (16:17 +0100)]
symboliccolor: Change the print output

Functions should not have a space before the opening parenthesis. So
change output like
  alpha (@color, 0.5)
to
  alpha(@color, 0.5)
and do the same for "shade" and "mix".

Tests have been updated accordingly.

11 years agosymboliccolor: Split out HSLA code
Benjamin Otte [Thu, 8 Nov 2012 14:26:33 +0000 (15:26 +0100)]
symboliccolor: Split out HSLA code

11 years agoUpdate a11y test results
Matthias Clasen [Thu, 8 Nov 2012 01:21:50 +0000 (20:21 -0500)]
Update a11y test results

These are expected changes, since a11y class name show up in the
dumps.

11 years agoNuke GtkBoxAccessible
Matthias Clasen [Thu, 8 Nov 2012 01:17:30 +0000 (20:17 -0500)]
Nuke GtkBoxAccessible

It didn't contain anything useful.

11 years agotext-cell-accessible: fix a double unref
Cosimo Cecchi [Wed, 7 Nov 2012 20:46:16 +0000 (15:46 -0500)]
text-cell-accessible: fix a double unref

We're unreffing the GtkCellRenderer object twice, causing the
application to crash when trying to access the renderer later.

https://bugzilla.gnome.org/show_bug.cgi?id=687872

11 years agoUpdated Traditional Chinese translation(Hong Kong and Taiwan)
Cheng-Chia Tseng [Tue, 6 Nov 2012 18:35:44 +0000 (02:35 +0800)]
Updated Traditional Chinese translation(Hong Kong and Taiwan)

11 years agogradient: Add color stops to the right gradient
Benjamin Otte [Tue, 6 Nov 2012 19:51:29 +0000 (20:51 +0100)]
gradient: Add color stops to the right gradient

This was causing an infinite loop happily eating up memory.

https://bugzilla.gnome.org/show_bug.cgi?id=687467

11 years agotests: Include config.h
Benjamin Otte [Tue, 6 Nov 2012 19:51:15 +0000 (20:51 +0100)]
tests: Include config.h

11 years agoDisable deprecation checks for all libraries we depend on on stable branches.
Benjamin Otte [Tue, 6 Nov 2012 19:50:09 +0000 (20:50 +0100)]
Disable deprecation checks for all libraries we depend on on stable branches.

This is so newer versions of those libraries don't cause more warnings
with a stable GTK version.
We don't ever want to turn off deprecation warnings for master however,
because that's where we get rid of deprecated API we use.

Note that only glib allows use to easily do this, so nothing is done for
Pango, gdk-pixbuf or Cairo here.

11 years agocssimage: Fix huge memleak
Benjamin Otte [Tue, 6 Nov 2012 16:50:14 +0000 (17:50 +0100)]
cssimage: Fix huge memleak

When transitioning gradients, we were leaking the gradient structs. Not
good.

https://bugzilla.gnome.org/show_bug.cgi?id=687467

11 years agocss: Fix copy/paste error
Cosimo Cecchi [Tue, 6 Nov 2012 16:49:15 +0000 (17:49 +0100)]
css: Fix copy/paste error

Benjamin replaced start with end in a bunch of locations, but not all of
them apparently.

11 years agoUpdated POTFILES.skip
Piotr Drąg [Mon, 5 Nov 2012 22:04:55 +0000 (23:04 +0100)]
Updated POTFILES.skip

11 years agoreftests: Add a reftest for latest fix
Benjamin Otte [Mon, 5 Nov 2012 18:34:00 +0000 (19:34 +0100)]
reftests: Add a reftest for latest fix

11 years agolabel: Handle crazy corner cases
Benjamin Otte [Mon, 5 Nov 2012 17:55:27 +0000 (18:55 +0100)]
label: Handle crazy corner cases

With ellipsizing, the ellipsized text can have a smaller height than the
non-ellipsized text. So the wider text is also higher. Example:
  .<big>TEXT</big>
will ellipsize to the small text.

Reported-By: Rico Tzschichholz <ricotz@t-online.de>
11 years agoFixed Brazilian Portuguese Translation
Adorilson Bezerra [Mon, 5 Nov 2012 14:11:26 +0000 (12:11 -0200)]
Fixed Brazilian Portuguese Translation

11 years agoBump GLib dependency to 2.35
Matthias Clasen [Tue, 30 Oct 2012 16:52:11 +0000 (12:52 -0400)]
Bump GLib dependency to 2.35

And drop deprecated g_type_init() calls.

11 years agoreftests: Add test for recent fix
Benjamin Otte [Sun, 4 Nov 2012 16:57:49 +0000 (17:57 +0100)]
reftests: Add test for recent fix

This test checks the fix in a46368dede684ded093395ac056eaeecf554330d

11 years agoreftests: Mark windows as popup
Benjamin Otte [Sun, 4 Nov 2012 16:15:20 +0000 (17:15 +0100)]
reftests: Mark windows as popup

This makes the tests run faster and should always be done.

11 years agosizerequest: do not derefence NULL pointers
Stefano Facchini [Sun, 4 Nov 2012 16:42:55 +0000 (17:42 +0100)]
sizerequest: do not derefence NULL pointers

11 years agogtkmenubutton: remove weak pointer when needed
Paolo Borelli [Sun, 4 Nov 2012 15:46:35 +0000 (16:46 +0100)]
gtkmenubutton: remove weak pointer when needed

We must make sure to remove the weak pointer when disposing the widget
or when resetting the align widget otherwise glib will try to nullify
invalid memory.

11 years agogtkmenubutton: set menu to NULL in dispose.
Paolo Borelli [Sun, 4 Nov 2012 11:09:23 +0000 (12:09 +0100)]
gtkmenubutton: set menu to NULL in dispose.

Prevent menu to be detached multiple times.

11 years agosizerequest: Restructure code
Benjamin Otte [Sun, 4 Nov 2012 15:10:20 +0000 (16:10 +0100)]
sizerequest: Restructure code

Make the compute_size_request() function take into account size groups
itself instead of doing a weird "bump_requisition" call.

11 years agosizerequest: Move sizegroups function to different source file
Benjamin Otte [Sun, 4 Nov 2012 15:02:14 +0000 (16:02 +0100)]
sizerequest: Move sizegroups function to different source file

11 years agosizegroup: Construct the set of sizegroup peers as a hash table
Benjamin Otte [Sun, 4 Nov 2012 14:47:03 +0000 (15:47 +0100)]
sizegroup: Construct the set of sizegroup peers as a hash table

This way we don't need a marker on GtkWidgetParivate that needs to be
unset later, so we have all our data in the same place and can avoid
problems with reentrancy and shenanigans like that.

But the main reason I wrote that is cleaner code.

11 years agoreftests: Add a test from evolution
Benjamin Otte [Sun, 4 Nov 2012 13:28:04 +0000 (14:28 +0100)]
reftests: Add a test from evolution

This was used in a bug report.

https://bugzilla.gnome.org/show_bug.cgi?id=677609

11 years agoreftests: Add a test for all the recent sizegroup hackery
Benjamin Otte [Sat, 3 Nov 2012 18:01:11 +0000 (19:01 +0100)]
reftests: Add a test for all the recent sizegroup hackery

11 years agosizegroup: Use _gtk_widget_compute_size_for_orientation()
Benjamin Otte [Sat, 3 Nov 2012 17:57:50 +0000 (18:57 +0100)]
sizegroup: Use _gtk_widget_compute_size_for_orientation()

With this function now available, we can do size computation in 2
ways:
(1) Compute size with size groups
(2) Compute size without size groups

And have (1) use (2) instead of setting flags on widgets. This patch
does exactly that.

11 years agosizerequest: Move optimization
Benjamin Otte [Sat, 3 Nov 2012 17:52:28 +0000 (18:52 +0100)]
sizerequest: Move optimization

With size groups now doing hfw, doing the optimization for CONSTANT_SIZE
was done too early. Size groups need to know that it's a hfw request, so
the other widgets in the size group get the correct behavior.

11 years agolabel: Redo get_preferred_width/height()
Benjamin Otte [Sat, 3 Nov 2012 14:36:22 +0000 (15:36 +0100)]
label: Redo get_preferred_width/height()

This is important for size groups mostly, but also has some small fixes.
The label-sizing reftest as been updated accordingly.

11 years agolabel: Fix ellipsize and wrap being set
Benjamin Otte [Fri, 2 Nov 2012 20:49:32 +0000 (21:49 +0100)]
label: Fix ellipsize and wrap being set

The label code assumed that Pango treats this as "wrap to as much space
as possible and then ellipsize all the lines", but for Pango, ellipsize
takes precedence over wrap. So do the same thing in GtkLabel.

Also updated is the reftest that checked this behavior.

11 years agoreftests: Improve reftest performance
Benjamin Otte [Fri, 2 Nov 2012 20:38:16 +0000 (21:38 +0100)]
reftests: Improve reftest performance

Get rid of all the event boxes in this test. Event boxes need GDK
windows which cost a lot of performance when running the test and they
clip the label output.

Getting rid of the clipping also shows 2 bugs in this test that weren't
visible before. Those will be fixed in a followup patch.

11 years agoreftests: Make label-sizing tests use better CSS
Benjamin Otte [Fri, 2 Nov 2012 18:16:46 +0000 (19:16 +0100)]
reftests: Make label-sizing tests use better CSS

ow that labels can have backgrounds, just use label backgrounds

11 years agosizerequest: Export _gtk_widget_compute_size_for_orientation()
Benjamin Otte [Fri, 2 Nov 2012 12:40:00 +0000 (13:40 +0100)]
sizerequest: Export _gtk_widget_compute_size_for_orientation()

and add an "ignore_size_groups" flag to it. This way we can use it for
size group shenanigans.

11 years agosizegroup: Move GtkSizeGroupMode to gtkenums.h
Benjamin Otte [Fri, 2 Nov 2012 12:39:19 +0000 (13:39 +0100)]
sizegroup: Move GtkSizeGroupMode to gtkenums.h

This is in preparation for the next patch, which would otherwise lead to
conflicts.

11 years agosizerequest: Cache sizes without size groups
Benjamin Otte [Thu, 1 Nov 2012 23:50:54 +0000 (00:50 +0100)]
sizerequest: Cache sizes without size groups

We compute on-demand for size groups anyway, so we can (in theory, this
patch doesn't do that yet) get around costly cache blowing when
invalidating single widgets of a size group this way.

11 years agosizegroups: Use is_visible() instead of get_mapped() for visibility
Benjamin Otte [Thu, 1 Nov 2012 23:44:30 +0000 (00:44 +0100)]
sizegroups: Use is_visible() instead of get_mapped() for visibility

The current approach of using gtk_widget_get_mapped() is broken:
The usual steps taken when showing a window are:
(1) request the sizes
(2) allocate the sizes
(3) show the window in the allocated size

Showing the window with a random size between steps (1) and (2) would of
course
result in extra work and potential flickering when the widgets get
resized to
their proper sizes.

However, as GtkSizeGroup::ignore-hidden uses gtk_widget_get_mapped() to
determine visibility for a widget, the following will happen:
(1) the widget will request a 0 size
(2) the widget will be allocated a 0 size
(3) the widget will be too small when it is shown

gtk_widget_get_visible() however is set in advance. Note that toggling
visibility also causes a gtk-widget_queue_resize() call already so we
take care of changes in here automatically.

11 years agoAPI: Add gtk_widget_is_visible()
Benjamin Otte [Thu, 1 Nov 2012 23:42:45 +0000 (00:42 +0100)]
API: Add gtk_widget_is_visible()

This is a recursive gtk_widget_get_visible(): Returns TRUE if the widget
and all its parents are visible.

11 years agosizegroup: Handle hfw in size groups
Benjamin Otte [Thu, 1 Nov 2012 23:33:42 +0000 (00:33 +0100)]
sizegroup: Handle hfw in size groups