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)
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)
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.
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.
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.
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)
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
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.
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.
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.
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.
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.
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.
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.
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.
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).
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".
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.
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.
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.
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.
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.
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.
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.
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.
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.