Commit Graph

18411 Commits

Author SHA1 Message Date
Benjamin Otte
f47f94be42 window: Remove call to gtk_widget_reset_rc_styles()
First of all, that call is deprecated. Second, we don't have RC styles
anymore. Third, what that function does today is invalidate style
contexts, but that happens automatically when setting the screen on the
style context later.

So this function is completely unnecessary.
2013-04-02 11:45:44 +02:00
Benjamin Otte
225dec6940 celrendererspinner: Don't use deprecated API 2013-04-02 11:45:44 +02:00
Benjamin Otte
231520af8f widget: Get rid of deprecation warnings 2013-04-02 11:45:44 +02:00
Ryan Lortie
45a94ccc88 tests: improve gtkmenu testcase
Don't just create a menushell and populate it with random data -- verify that
the resulting menu layout is actually correct.

This is introduced in a separate commit because the old code was failing this
part of the test.

https://bugzilla.gnome.org/show_bug.cgi?id=696468
2013-04-01 16:45:20 -04:00
Ryan Lortie
5617b58420 Introduce GtkMenuTracker
GtkMenuTracker folds a nested structure of sections in a GMenuModel into
a single linear menu, which it expresses to its user by means of 'insert
item at position' and 'remove item at position' callbacks.

The logic for where to insert separators and how to handle action
namespaces is contained within the tracker, removing the need to have
this logic duplicated in the 3 or 4 places that consume GMenuModel.

In comparison with the previous code, the tracker no longer completely
destroys and rebuilds menus every time a single change occurs.  As a
result, the new gtkmenu testcase now runs in approximately 3 seconds
instead of ~60 before.

https://bugzilla.gnome.org/show_bug.cgi?id=696468
2013-04-01 16:45:19 -04:00
Ryan Lortie
e250e52175 tests: add a test for gtk_menu_shell_bind()
Borrow the RandomMenu code from the GLib testsuite and hook it up to
gtk_menu_shell_bind().

https://bugzilla.gnome.org/show_bug.cgi?id=696468
2013-04-01 16:45:19 -04:00
Sébastien Wilmet
d599985a41 gtktextattributes: move comment above relevant struct
https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
a5f52afd38 GtkTextTagTable: simplify a bit the code
https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
97dfcc1073 GtkTextView: remove some dead code
https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
6f990fa7e4 gtktextattributes: explain what is "pg_bg"
I didn't know what "pg" stands for.

https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
3a8f70dd1e gtktextattributes: include the right headers
Some function prototypes in gtktexttagprivate.h are implemented in
gtktextattributes.c.

https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Sébastien Wilmet
fd84704d94 gtktexttypes: remove inline_byte_begins_utf8_char()
The function was used only in gtk_text_byte_begins_utf8_char().

https://bugzilla.gnome.org/show_bug.cgi?id=697048
2013-04-01 21:12:49 +02:00
Benjamin Otte
cbee390148 cssvalue: At cycle detection to color resolving
The following CSS would infloop:

@define-color self @self

as it would infinitely lookup the color named "self" and try to resolve
it. This patch adds detection of such cycles to the resolve function by
keeping a list of currently resolving colors in the cycle_list variable.
2013-03-28 23:18:59 +01:00
Benjamin Otte
c25d8e3aea cssvalue: Handle named colors not resolving
If a named color references a nonexistant named color, we didn't catch
that error and ended up crashing on a NULL-dereference.
This crashed Boxes, because its CSS referenced values from the theme
that didn't exist in any theme.
2013-03-28 23:18:59 +01:00
Benjamin Otte
dded6a0673 menuitem: Remove old themeing enhancement
CSS doesn't allow themeing parents based on the state of their children,
so this code just causes extra redraws today.
2013-03-28 23:18:59 +01:00
Benjamin Otte
d20ac0acf9 menushell: Remove unused header 2013-03-28 23:18:58 +01:00
Benjamin Otte
436af3fcb5 menu: Move enum declaration to correct header
That enum is used in GtkMenuShellClass, so put it there.
2013-03-28 23:18:58 +01:00
Benjamin Otte
030c65f299 tearoffmenuitem: Use public API, don't poke GtkMenuPrivate 2013-03-28 23:18:58 +01:00
Alexander Larsson
7df7e092b9 GtkOverlay: Respect overlay child min size
Never allocate an overlayed child less than its minimum request.
If the minimum doesn't fit we will gracefully clip via the
widget window.

https://bugzilla.gnome.org/show_bug.cgi?id=696623
2013-03-28 13:32:09 +01:00
Alexander Larsson
785a916267 GtkOverlay: Don't allocate child except in size_allocate
We were calling gtk_overlay_child_allocate() both in realize
and in add as we wanted to create and position the child windows
for the widgets. However, this call also actually called
gtk_widget_size_allocate() on the child, which it shouldn't. In some
cases the overlay is realized before being allocated, and thus it
will allocate the child at 0x0 which is an invalid size for it to be in.
In particular, if the child has margins set this will result in negative
allocations and warnings.

This fix splits out the allocation computation so that
gtk_overlay_create_child_window can use it without callers
having to call gtk_overlay_child_allocate() to move the windows.

https://bugzilla.gnome.org/show_bug.cgi?id=696623
2013-03-28 13:32:06 +01:00
Kristian Rietveld
6f607fc8b4 quartz: move atom/pasteboard type conversions functions to GDK
(cherry picked from commit a269c2f8d2)
2013-03-28 13:10:38 +01:00
Matthias Clasen
93efaa5ebe Fix GtkApplicationWindow menubar placement
Since the menubar is part of the content, we need to give
it the content_window as parent window, to make things
work again.
https://bugzilla.gnome.org/show_bug.cgi?id=696561
2013-03-27 00:23:19 -04:00
Matthias Clasen
bdfd0d4638 Don't return FALSE from a non-boolean function
https://bugzilla.gnome.org/show_bug.cgi?id=696608
2013-03-26 23:30:10 -04:00
Sébastien Wilmet
6cb2816c45 GtkWidget: add missing deprecation marks
https://bugzilla.gnome.org/show_bug.cgi?id=696138
2013-03-24 14:22:38 -04:00
Sébastien Wilmet
30788062f7 GtkLabel: fix underlining of mnemonics
The underscore was shown in front of the mnemonic instead of underlining
it (e.g., _Save).

Thanks to Lars Uebernickel.

https://bugzilla.gnome.org/show_bug.cgi?id=674759
2013-03-24 15:07:40 +01:00
Matthias Clasen
d1ad324d3d csd: Reparent the content
This lets us avoid problems with cursor changes.
2013-03-24 01:15:33 -04:00
Matthias Clasen
65cd2a59c3 Make gtk_init_check work as expected
When no GDK backend can be initialized (either because
GDK_BACKEND has been set to the wrong value, or the backends
are simply not included), the expectation is that gtk_init_check
should return FALSE, not error out.
This commit makes it so, by using gdk_display_manager_peek
instead of gdk_display_manager_get in code paths that are used
during initialization.
2013-03-23 19:41:39 -04:00
Tarnyko
0f59ff4550 win32: Bring back spinner animation
Define the spinner animation in css.
https://bugzilla.gnome.org/show_bug.cgi?id=696202
2013-03-23 17:42:55 -04:00
Colin Walters
4f0e9cbf81 gtktoolpalette: Only call gdk_atom_intern when we're constructed
Otherwise we end up trying to instantiate a display manager in
class_init which breaks introspection scanning.

https://bugzilla.gnome.org/show_bug.cgi?id=696457
2013-03-23 17:07:15 -04:00
Tarnyko
7ffaab3f91 win32: Improve GtkAssistant theming
The highlighted color chosen for GtkAssistant header font
(deep blue) makes it hardly readable is most cases. Switch
to light gray.
https://bugzilla.gnome.org/show_bug.cgi?id=696171
2013-03-23 15:47:39 -04:00
Matthias Clasen
cc86a7bb7e Add gtk_grid_remove_{row,column}
It is sometimes convenient to deal with entire rows or
columns at a time.
https://bugzilla.gnome.org/show_bug.cgi?id=695994
2013-03-23 15:43:37 -04:00
John Lindgren
666d10ec76 Use natural size to set adjustment ranges
This is an (unintentional) side effect of my changes to GtkTreeView's
get_preferred_size() implementation.  It seems odd to me that
GtkTreeView directly determines its own size when inside a
GtkScrolledWindow, but since it does, it should be using its natural
size, not its minimum size.
2013-03-23 19:49:03 +01:00
Vadim Godunko
55012318a6 Fix drawing of grid lines in RTL
The vertical grid lines were not properly positions in
RTL locales.
https://bugzilla.gnome.org/show_bug.cgi?id=696051
2013-03-23 14:01:35 -04:00
Tristan Van Berkom
1a088d3aba GtkBuilder: Fixed documentation
The documentation was referring to an <external-object> tag
which we never implemented
2013-03-23 20:44:12 +09:00
Matthias Clasen
75f4f7a471 Update cursor theme on wayland
Call the new new api from gtksettings.c when it changes, just
as we do for X11.
https://bugzilla.gnome.org/show_bug.cgi?id=696428
2013-03-22 20:33:47 -04:00
Cosimo Cecchi
5568dcb53c appchooserbutton: filter out applications not supposed to be visible
Ensure NoDisplay=true applications don't end up in the list populated by
GtkAppChooserButton.

https://bugzilla.gnome.org/show_bug.cgi?id=696405
2013-03-22 15:27:41 -04:00
Matthias Clasen
69f12b1090 Don't react to clicks in content
This breaks way too many things, and we explicitly trigger
drags from menubars and toolbars, where we want it.
2013-03-21 18:07:21 -04:00
Matthias Clasen
02a0759c5d csd: Make link activation work reliably
The label code was just letting some button press events bubble
up, which caused misbehaviour with the window dragging code.
https://bugzilla.gnome.org/show_bug.cgi?id=695506
2013-03-21 18:07:21 -04:00
Matthias Clasen
6eaa5ffa8a csd: Allow moving maximized windows
This make the nice 'snap off' feature of gnome-shell work
with client-side decorations. weston moves the maximized window
around, which is less ideal...
2013-03-21 18:07:21 -04:00
Cosimo Cecchi
8fd9575ab6 window: don't add the background style class when drawing CSD elements
We already set it in init, so this is just redundant.
The additional window-content style class here is needed so that we can
distinguish between the full X window background and the background for
the actual window contents.
2013-03-21 16:32:00 -04:00
Cosimo Cecchi
4bcaadac51 window: add a "client-decorated" style class when the window is so
The theme might want to apply some specific theming to a client
decorated toplevel window, so add a style class for that.
2013-03-21 16:31:14 -04:00
Matthias Clasen
329f7af159 Fix DND
The removal of the Motif DND code accidentally changed the
value of the TARGET_DELETE enumeration value, breaking DND
pretty badly.
2013-03-21 00:00:19 -04:00
Matthias Clasen
2bc313c624 GtkColorChooserDialog: make alternative button order work
The alternative button order that we set did not actually
work, since the ok button did not have a response id.
Partial fix for
https://bugzilla.gnome.org/show_bug.cgi?id=695493
2013-03-21 00:00:19 -04:00
Matthias Clasen
98801b07b4 GtkColorChooser: Fix selection of colors
Prevent the new window dragging code from interfering with
selection of colors on button release, by handling button
presses we care about instead of letting them bubble up to
the window.
Partial fix for
https://bugzilla.gnome.org/show_bug.cgi?id=695493
2013-03-20 22:21:16 -04:00
Matthias Clasen
da2a102adb GtkWindow: clean up button event handling
We were not translating event coordinates to the toplevel
window, thus the regions we determined were not right.
We were also not respecting the maximized state, and we
were unnecessarily refusing to handle events when not decorated.
https://bugzilla.gnome.org/show_bug.cgi?id=696197
2013-03-20 18:21:12 -04:00
Alexander Larsson
76e466197a GtkWidget: Handle style updates before realize
If the style changes before we're realized we will delay the
style-updated signal until realize. However, we then lose
the changes bitmap. This means that gtk_widget_real_style_updated()
must treat a NULL change as "everything changed" and queue a resize.
2013-03-20 13:56:16 +01:00
Matthias Clasen
3731a2bd90 GtkHeaderBar: Add subtitle support
As seen in GdHeaderBar.
2013-03-19 22:07:26 -04:00
Matthias Clasen
d42c2c3f19 GtkHeaderBar: Survive toggling custom / non-custom titles
The code was always adding a label widget as a child, but
then skipping over it in forall if a custom_title was present.
This confuses internal logic of GTK+ which assumes that it
can iterate over the entire widget hierarchy with forall,
to maintain state. Fix this by destroying the label when
a custom_title is set, and recreating it as needed.
2013-03-19 20:52:54 -04:00
Matthias Clasen
3289b3efbf GtkHeaderBar: Don't leak
Should have a finalize function, if there's strings to free.
Also avoid some pointless extra ref on custom title widgets.
2013-03-19 20:35:28 -04:00
Rob Bradford
8cdbee7fd2 window: Use update_window_buttons to hide title on fullscreen
The function update_window_buttons shows or hides the title header after it
has finished updating the visibility of the various buttons. Unfortunately
this
conflicted with the hiding of the title done when going fullscreen.

This solves the problem and fixes the rendering of fullscreen applications by
using update_window_buttons to control the visibility of the box in the
fullscreen case.
2013-03-19 19:48:35 +00:00
Christian Persch
953253f685 gtk: gtk_init_with_args allows NULL for parameter_string 2013-03-18 14:12:12 +01:00
Matthias Clasen
c4dc3a779a Revert "GtkHeaderBar: Allow window dragging"
This reverts commit 30a1a79322.

This turns out to be unnecessary when you can set the titlebar
on the window and let GtkWindow handle the events. As a benefit,
we get the window menu on custom titlebars for free.
2013-03-18 08:50:23 -04:00
Matthias Clasen
30d0542309 Add documentation for gtk_window_set_titlebar 2013-03-18 08:50:22 -04:00
Matthias Clasen
4afbaf699f Add gtk_window_set_titlebar
A new function that sets a custom titlebar on a GtkWindow.
With client-side decorations, the custom titlebar simply
replaces the one that GtkWindow would otherwise create itself.
With traditional decorations, we tell the window manager
to just decorate the window with a border. This works ok
at least with metacity and mutter.
2013-03-18 08:50:22 -04:00
Matthias Clasen
105c808d0a Small cleanup in gtk_window_draw
Get the allocation once, at the beginning.
2013-03-18 08:50:22 -04:00
Matthias Clasen
4a2c3bbf3c window: Don't draw titlebar background
GtkHeaderBar can do its own drawing, no need to do this
in gtk_window_draw.
2013-03-18 08:50:22 -04:00
Matthias Clasen
e29c25cd1b Trivial whitespace fix 2013-03-18 08:50:22 -04:00
Matthias Clasen
63f0f03a73 Add forgotten check
We don't want to create titlebar widgets if the window
is not decorated anyway.
2013-03-18 08:50:21 -04:00
Matthias Clasen
bec5798180 Fix a typo 2013-03-18 01:20:08 -04:00
Matthias Clasen
30a1a79322 GtkHeaderBar: Allow window dragging
We use the same window-dragging style property here to enable
this as for menubars and toolbars.
2013-03-18 01:02:19 -04:00
Matthias Clasen
2fe07c9068 Fix double accounting of border width
For csd, we were subtracting the border width one too many
times from the child height, causing clipped off content e.g.
in the 'Properties' window in testgtk.
2013-03-17 19:01:25 -04:00
Matthias Clasen
75a1e8251e Allocate the titlebar height according to width 2013-03-17 19:01:25 -04:00
Matthias Clasen
68b9bafd1d Add some visible border to the default csd 2013-03-17 19:01:25 -04:00
Matthias Clasen
df96b0239f GtkFontButton: default show-preview-entry to TRUE
This is what the property declaration says, after all.
https://bugzilla.gnome.org/show_bug.cgi?id=695948
2013-03-17 16:24:34 -04:00
Alban Browaeys
da961b7ab8 GtkEntryAccessible: also handle entry icon tooltip NULL in notify_gtk.
To clear the tooltip one is to set the tooltip to NULL. Though
the GtkEntryAccessible expect this tooltip to not be NULL in
gtk_entry_accessible_notify_gtk (already handling this case
 in its _init).

Fixes:
** (epiphany:23914): CRITICAL **: atk_object_set_description: assertion
`description != NULL' failed
when epiphany g_object_set the entry icon tooltip to NULL (clear the
tooltip) in its find bar.

https://bugzilla.gnome.org/show_bug.cgi?id=695375
2013-03-17 16:12:52 -04:00
Sébastien Wilmet
8e65fa1b43 GtkLabel: fix mnemonic-keyval when use-markup is true
To extract the mnemonic key value, the string must contain the
underscore. But when the "gtk-auto-mnemonics" setting is true and when
the Alt key is not pressed, the underscore must not be displayed. The
problem was that the 'new_str' variable was used for both purposes:
extract the text to display, and extract the accelerator character.

When the underscore must not be visible, the underscores were removed
from the 'new_str' variable before extracting the accelerator character.

Now there are two strings, one for each purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=674759
2013-03-17 16:10:10 -04:00
Rob Bradford
37509621bd css: Add style entries for client side decorations to default CSS 2013-03-17 12:19:51 -04:00
Matthias Clasen
a41f7e4741 window: Render inner and outer border separately
This lets themes render a window frame in the inner border,
and a shadow or nothing in the outer border.
2013-03-17 12:19:50 -04:00
Matthias Clasen
70ccfb0efc window: Split the border into inner and outer
For now, nothing changes, we're using the sum of inner and
outer border everywhere.

In the future, we will make the inner border the visible
window frame, and the outer border the shadow/resize border.
2013-03-17 12:19:50 -04:00
Matthias Clasen
41aad21693 window: Hide the border when maximized
Dragging windows from the border is not useful when maximized.
2013-03-17 12:19:50 -04:00
Matthias Clasen
003d9f4225 window: Add a window menu to the titlebar
The menu is triggered by right-click on the titlebar
or with the menu key.
2013-03-17 12:19:50 -04:00
Matthias Clasen
bf03c85e43 window: Allow resizing by clicking on the border
We also change cursors to indicate what interactions
are possible in various window regions.
Double clicking on the titlebar maximizes the window.
2013-03-17 12:19:50 -04:00
Matthias Clasen
037b1435ae window: Allow theme control over window buttons
Add a style property to control the presence and order of
window buttons. We allow buttons at the left and right side,
they can be specified like this: icon,close:minimize,maximize.

Also, change the default button layout back to have just a close
button on the right, use icons in buttons, and set style classes
on the buttons, to allow better theming.
2013-03-17 12:19:50 -04:00
Matthias Clasen
7d71f8888d Add icons for frame buttons
Add window-minimize, window-maximize, window-restore and window-delete
icons to the builtin icon theme. These will be used for icons in
the window buttons, and the expectation is that the icon theme
will provide icons matching the desired decoration style.

window-delete is used instead of window-close, since window-close
is also used for GTK_STOCK_CLOSE, and the two may require different
styles when used inside the application vs in the window frame.
2013-03-17 12:19:50 -04:00
Matthias Clasen
93c345e49f window: Hide frame buttons when appropriate
Hide the close button if the window is not deletable, hide the
maximize button if the window is not resizable, and hide all
buttons if the window is a dialog.

Update buttons when the window state changes.
2013-03-17 12:19:49 -04:00
Matthias Clasen
d05d08a2f3 window: Use same title fallback mechanism as X backend
This looks at the application name or program name and uses that
as the title if gtk_window_set_title has not been called.
2013-03-17 12:19:49 -04:00
Matthias Clasen
b141121ef6 window: Add support for enabling client decorations on non-Wayland
Client side decorations can be enabled on non-Wayland platforms by
setting the GTK_CSD="1" environment variable.

We must ensure we have a GdkVisual that has an alpha channel since
the decorations rely on transparency. If we cannot get a visual with
an alpha channel then we do not enable client side decorations.
2013-03-17 12:19:49 -04:00
Rob Bradford
f17b7136dd window: Hide the decorations on fullscreen
This is expected behaviour for fullscreen windows.
2013-03-17 12:19:31 -04:00
Rob Bradford
4618e0dcc7 window: Don't set a background pattern/colour when client decorated
Otherwise we'll potentially get some background sticking through our rounded
corners in our decorations. The actual background will get drawn as part of
the decoration drawing.
2013-03-17 12:13:35 -04:00
Kristian Høgsberg
6a8362111e window: Add initial support for client-side decorations under Wayland
This change comprises four main parts:
 * the creation of the widgets that form the decorations,
 * implementation of get_preferred_height/width, and the for_width/for_height
   variants,
 * taking the decorations into account when allocating,
 * and drawing the decorations themselves.

Kristian did the bulk of the original work on this but any bugs are almost
certainly mine through the many refactorings and rebasings.
2013-03-17 12:13:35 -04:00
Matthias Clasen
3f9455301e Add GtkHeaderBar
This widget has been developed as GdHeaderBar in libgd.
The copy here has been renamed and changed to use GTK+
internals.
2013-03-17 12:12:53 -04:00
Rob Bradford
55a98da4d4 window: Allow _gtk_window_set_allocation to return a modified allocation
Update the documentation and users of this function to handle
the future case that that we have some internal decorations to the window and
useable allocation is thus smaller.

By having a separate out parameter there is no need to have an in/out function
and allows for greater robustness.

The current implementation simply returns the allocation provided.
2013-03-17 11:28:26 -04:00
Sébastien Wilmet
66dfab0b0a Small API doc fixes
For gtk_text_iter_get_char(), due to the "Returns" at the beginning of
the description, the description was not visible. So the first sentence
has been reworded.
2013-03-16 22:18:50 +01:00
Matthias Clasen
5e1a06d1b1 GtkGrid: Tweak size allocation
If there are rows that contain only spanning children,
our algorithm was unnecessarily distributing extra space
to the other rows, even if they contain only non-expanding
children.

We improve the behaviour by treating rows containing only
spanning children as expanding.
2013-03-15 23:38:30 -04:00
Benjamin Otte
f9f6c4fa49 stylecontext: Do invalidation on first resize container
... instead of taking the last one we find. This is necessary as
attached widgets (mostly menus) can be attached to an invisible widget,
but we still want to invalidate styles for them.

https://bugzilla.gnome.org/show_bug.cgi?id=695772
2013-03-16 00:06:55 +01:00
Christian Persch
af0007d0d8 docs: Typo fix 2013-03-15 18:51:11 +01:00
Benjamin Otte
bda5987335 separator: Don't use padding and borders wrongly
Borders for size requests and padding for drawing? Really?

Removed them, as that is the least invasive fix shortly before a
release.
2013-03-15 18:18:40 +01:00
Matthias Clasen
a731cd1ef6 Minor doc cleanup
Remove widget references from interface docs.

https://bugzilla.gnome.org/show_bug.cgi?id=695874
2013-03-14 20:29:00 -04:00
Benjamin Otte
feb64f40b0 a11y: Emit text-changed signals directly
When setting new text on the label, the text-changed::delete signal
needs to be emitted before deleting the text (so that atk-bridge can
query the old text) while the text-changed::insert event needs to happen
afterwards (for the same reason). The old code using the notify signal
was only emitted after changing the text.
2013-03-15 00:58:29 +01:00
Bastien Nocera
ee44ed75ca GtkApplication: Allow passing windows on non-X11 targets
It's not the application's fault that we don't do anything
with the passed GtkWindow on non-X11, so don't try to get an XID
on non-X11.

https://bugzilla.gnome.org/show_bug.cgi?id=695783
2013-03-14 17:48:20 +01:00
Chun-wei Fan
b9e189150b gdk/gdkwindow.c, gtk/gtkwidget.c: Include fallback-c89.c
Both of them started to make use of round(), a C99 function.  So, include
fallback-c89.c to provide a fallback implementation for round() for
compilers that don't have round()

https://bugzilla.gnome.org/show_bug.cgi?id=694339
2013-03-13 13:22:48 +08:00
John Lindgren
5e2c232145 treeview: Don't emit cursor-changed in destruction
This is a workaround until we have a good idea on how we want to handle
signal disconnection before/during/after dispose and destroy vfunc
calls.

https://bugzilla.gnome.org/show_bug.cgi?id=671939
2013-03-13 02:06:29 +01:00
Matthias Clasen
0cc688aa92 Drop the Motif DND protocol
The implementation is not working and unused, since XDND is the
de-facto standard under X nowadays.

https://bugzilla.gnome.org/show_bug.cgi?id=695476
2013-03-12 20:03:19 -04:00
Federico Mena Quintero
563eb60666 filechooserbutton: Duh, remove all the timeouts after tests
Otherwise tests may start failing if they start after an old timeout triggers.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
d84f5ae17e filechooserbutton: Add a description string to assertions about emitted signals
On failed tests, this lets us more easily see see which assertion failed.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
aaedf5a352 filechooserbutton: Give proper names to the SELECT_FOLDER tests with cancelled dialog
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
79695ee64d filechooserbutton: Don't duplicate tests for GTK_RESPONSE_DELETE_EVENT
Instead, re-run tests made for GTK_RESPONSE_CANCEL with the delete-event response.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
3b2182e711 filechooserbutton: Do not propagate state from the dialog unless it is active
Change of plans to match the tests from the previous commit.

The state of the underlying dialog is never reflected by GtkFileChooserButton's API,
as the dialog is a transient thing.  The file chooser button only updates its state from the dialog,
and reflects the dialog's state, when the dialog has been confirmed and dismissed by the user.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:48 -06:00
Federico Mena Quintero
1865b9a111 filechooserbutton: whitespace fixes 2013-03-12 14:31:47 -06:00
Federico Mena Quintero
f5217289ca filechooserbutton: For the open-dialog-cancel-* tests, add a real nomenclature and test all the combinations
We used to have numeric names, which are a pain to maintain when new tests are added.
Now we have a real nomenclature (see the comment at the beginning of the open-dialog-cancel-* tests),
which lets us see easily if we have tested all the combinations.

Also, added all the combinations that were missing and removed redundant tests.
Not all the tests pass currently.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
2cfc56ced8 filechooserbutton: Update the button's state only on programmatic changes to the filechooser's state
The idea is that the button will only update its state of the selection and current folder
when changes to those are done either by the calling program (with the filechooser's API)
or when the user actually confirms and dismisses the underlying GtkFileChooserDialog.

If the user makes changes to the dialog but has not dismissed it yet, those changes
will not be reflected in the button (as one would expect).

This commit also makes sure the current-folder-changed and selection-changed signals
are emitted at the right times.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
fa4878979e filechooserbutton: Emit 'selection-changed' when changing the selection programmatically
We only emitted that signal when the selection changed through the underlying GtkFileChooserDialog.

To do this when the dialog is not active and the selection is changed by the calling program
(instead of by the user), we need to wait until the GtkFileChooserButton's UI has been updated
via an async callback from GIO.  So, we keep track of whether an entry point into the
button's API caused a programmatic change in the selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
a8c4d0935b filechooserbutton: For tests, wait for signals instead of just sleeping
This should let tests complete faster.  Also, this will let us test
that the correct signals are actually being emitted.

The tests now fail, as the signals are not being emitted when they
should.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 14:31:47 -06:00
Federico Mena Quintero
1247a842a2 filechooserbutton: whitespace fixes 2013-03-12 14:31:47 -06:00
Carl-Anton Ingmarsson
5d011386a6 label: Fix memleak
Caused by recent refactoring in e09957a47d
2013-03-12 20:23:09 +01:00
Benjamin Otte
fb170239c7 stylecontext: If we force invalidate, invalidate all properties
We only FORCE_INVALIDATE when something weird changes that the CSS
machinery can't detect. But now that our style_updated functions skip
recomputations when some properties don't change we want to make sure
these recomputations are still run. So we just claim all properties
changed.

http://bugzilla.gnome.org/show_bug.cgi?id=695482
2013-03-12 12:46:37 +01:00
Benjamin Otte
e09957a47d label: refactor code
If text didn't change, don't change it.

And if that sentence made no sense, that might explain why I refactored.
2013-03-12 12:46:37 +01:00
Aleksander Morgado
24fa277329 combobox: popdown the combobox when on 'grab-broken-event'
And also explicitly remove pointer/keyboard grabs from the display.

Whenever the grab is reported lost, we should popdown the combobox, so that the
GDK_WINDOW_TEMP window is hidden and removed from the toplevel, as done with
the menu for example.

Leaving the GDK_WINDOW_TEMP window open when re-activating the application
triggers several issues in the win32 backend, due to restacking windows of the
non-toplevel group into the toplevel group:

https://bugzilla.gnome.org/show_bug.cgi?id=695200
2013-03-12 07:23:17 -04:00
Federico Mena Quintero
1c796018d1 filechooserbutton: During unselect_all(), update the widgets in all situations
Not just if we thought we had a selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-11 18:16:29 -06:00
Federico Mena Quintero
3a86af43fa filechooserbutton: Add tests for unselect_all()
These all pass except one.
2013-03-11 18:16:29 -06:00
Federico Mena Quintero
f2d6def72e filechooserbutton: HACK: Set a reasonable size for the dialog in the tests' second iteration
Something is causing the GtkFileChooserDialog to be resized really small on the second time it is run
during each test for GtkFileChooserButton.  So as a temporary hack we set it to 500x500 pixels on
the second run, so the size allocation code doesn't bomb on us.
2013-03-11 18:16:29 -06:00
Federico Mena Quintero
cade42d509 gtkfilechooserbutton: In tests, allow the possibility of doing unselect_all 2013-03-11 18:16:29 -06:00
Federico Mena Quintero
45ad8a06ad filechooserbutton: When the combo box changes, set the *file*, not the current folder
The currently-selected file *is* the selection even in SELECT_FOLDER mode.  Do not confuse this
with the current folder.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-11 18:16:29 -06:00
Cosimo Cecchi
fd51c8f5e9 treeview: fix a critical warning
gtk_tree_view_column_unset_tree_view() resets column->priv->tree_view to
NULL.
The function is called when a column is removed, but later from the same
function we would call _gtk_tree_view_column_unrealize_button(), which
expects column->priv->tree_view to be != NULL, causing these critical
warnings

Gtk-CRITICAL **: gtk_widget_unregister_window: assertion
`GTK_IS_WIDGET (widget)' failed

This commit moves the call to unset the tree view after the button is
unrealized.

https://bugzilla.gnome.org/show_bug.cgi?id=695473
2013-03-08 20:20:28 -05:00
Matthias Clasen
1f8286004f Avoid a warning under Wayland
Just having an ifdef is not enough, we need to check the type
of the window at runtime.
2013-03-08 19:49:00 -05:00
Federico Mena Quintero
f076b6bb02 filechooserbutton: Update the combo box even after the dialog is cancelled
We assumed that we didn't have to update the combo box if the dialog got cancelled,
as it should simply retain its previous contents.  But this assumption doesn't work
as the dialog is brought up with the 'Other...' item - we don't want the
combo box to keep showing 'Other...' if the dialog is cancelled.

The test from the previous commit now passes.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:43:21 -06:00
Federico Mena Quintero
e4c2ef108c filechooserbutton: New test for opening the Other item in the combo box and then canceling the dialog
There is this bug:

1. Start with a file chooser button in SELECT_FOLDER mode, and select a folder from the combo box.

2. Click on the button's combo box, select 'Other...'

3. You get the file chooser dialog. Cancel the dialog.

4. The file chooser button's combo box still shows 'Other...' instead of
   showing the selection from (1).

This is a test to ensure that the original selection is restored.
The test fails right now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:37:21 -06:00
Matthias Clasen
1ddfc3a985 Fix the build
This was broken in commit 5bbbc47a4c
2013-03-08 06:26:34 -05:00
Aleksander Morgado
5bbbc47a4c spinbutton: don't override initial text in non-numeric-only spin buttons
https://bugzilla.gnome.org/show_bug.cgi?id=695312
2013-03-08 11:23:11 +01:00
Federico Mena Quintero
67f5e595a7 filechooserbutton: Don't show the (None) item when the combo box is popped up
This is surprisingly tricky, since the (None) item *has* to be a visible item while
the combo box is *not* popped up, so that it can show its contents.  But the item
has to be *not* visible when the combo box is popped up.

Also, update the whole button's selection, not just the underlying dialog's, when
the combo box changes its selection - based on a patch by Paul Davis in
https://bugzilla.gnome.org/show_bug.cgi?id=691040#c20

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
1074aa0c49 filechooserbutton: In SELECT_FOLDER, when the selection is empty, show (None) in the combo box
We do this by adding a new row type, ROW_TYPE_EMPTY_SELECTION.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
bbf915118b filechooserbutton: Update the button/combo at construction time
This way the internal labels will show the correct selection even if nothing
has been selected programmatically.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
32aa7f0582 filechooserbutton: Update the button/combo whenever the selection is changed programmatically
We didn't change it when the file chooser button's dialog was inactive, and so
the actual file chooser button would not visually reflect the current selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
cc75ebec15 filechooserbutton: Test that the expected filename is shown
We do some gymnastics to pull the string out of the GtkButton or the GtkComboBox that is
being used in GtkFileChooserButton to show the current selection when the dialog
is inactive - namely, we look for the subwidget with the correct ATK role, and pull its
accessible name.

Currently the test fails; this is https://bugzilla.gnome.org/show_bug.cgi?id=691040#c18

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-07 20:45:58 -06:00
Federico Mena Quintero
8a17cad2e5 Don't mention gtk_set_locale() in docs; this function does not exist 2013-03-07 20:45:57 -06:00
Giovanni Campagna
ca2368dba9 GtkTextView: don't popdown a bubble if we don't have one
This causes a segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=695304
2013-03-06 17:08:48 +01:00
Bastien Nocera
ea043cab57 GtkEntry: Sanity check the end_pos value in _get_display_text() 2013-03-06 15:50:31 +01:00
Bastien Nocera
32825a66ac GtkLabelAccessible: Sanity check _get_text() input values 2013-03-06 15:50:30 +01:00
Federico Mena Quintero
a89d420270 filechooser: Use _gtk_file_has_native_path() throughout when testing for local_only
In the case of checking for local_only, g_file_is_native() is not useful, since it
will return FALSE for something in a FUSE mount.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-05 17:17:42 -06:00
Federico Mena Quintero
d484721b5c filechooser: Also convert get_uris() to returning native paths
It was only being done in gtk_file_chooser_get_uri().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-05 17:17:42 -06:00
Federico Mena Quintero
56bcb1933f filechooser: Rename _gtk_file_is_path_not_local() to _gtk_file_has_native_path()
Negatives in names of boolean functions are confusing.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-05 17:17:42 -06:00
Timothy Arceri
cf216d780c filechooser: Show FUSE mounted locations in shortcuts
Since FUSE locations can be handled safely by applications show these mounted locations regardless of whether gtk_file_chooser_set_local_only()
is set to TRUE

https://bugzilla.gnome.org/show_bug.cgi?id=586367
2013-03-05 17:17:42 -06:00
Cosimo Cecchi
e54f8f4c62 GtkBubbleWindow: use OSD style class 2013-03-05 16:48:02 -05:00
Cosimo Cecchi
3c8e1c92a8 GtkBubbleWindow: rework how drawing is done
Use gtk_render_frame_gap(), refactoring the code fetching coordinates to
be usable by it. This allows for rounded corners in the window shape.
2013-03-05 16:48:01 -05:00
Cosimo Cecchi
6f1476edd3 GtkBubbleWindow: allocate CSS borders and paddings 2013-03-05 16:48:01 -05:00
Matthias Clasen
e1edc998a2 Rename property to be more neutral
Don't put toolbar in the name of the property - we may use
a different container down the road, and then this name
would be misleading.
2013-03-05 16:48:01 -05:00
Matthias Clasen
3c04597306 Really keep GtkBubbleWindow private
_-prefix the symbols to keep them from leaking out.
Also, un-doc-commentize the sources.
2013-03-05 16:48:01 -05:00
Matthias Clasen
7c2a752b37 Small documentation tweak 2013-03-05 16:48:01 -05:00
Matthias Clasen
190dcfe050 Popdown the bubble window when text view is scrolled 2013-03-05 16:48:01 -05:00
Matthias Clasen
88623b98a7 Allow to populate bubbles with extra content
We do this by making the ::populate-popup signals a little more
flexible. They used to just accept a GtkMenu as argument, now
they can take a menu or a toolbar. To not break the expectations
of existing callbacks, we only emit ::populate-popup with a toolbar
if the :populate-toolbar property is TRUE.
2013-03-05 16:48:00 -05:00
Matthias Clasen
f1f3a033e5 Drop GtkSelectionWindow
It is no longer used.
2013-03-05 16:48:00 -05:00
Matthias Clasen
bb3c56abe2 Do without GtkSelectionWindow
Just populate a toolbar directly, in GtkEntry and GtkTextView.
2013-03-05 16:48:00 -05:00
Matthias Clasen
a8ea64dbb1 Fix a typo 2013-03-05 16:48:00 -05:00
Carlos Garnacho
ceeed09d07 Made GtkBubble/SelectionWindow private at the moment 2013-03-05 16:48:00 -05:00
Carlos Garnacho
0ba92bc26d Use gdk_threads_add_timeout to popup the selection window
Second granularity may bite us back there
2013-03-05 16:47:59 -05:00
Matthias Clasen
9f41970832 Fix includes
gtkbubblewindow.h was including gtk.h, which in turn included
gtkselectionwindow.h, leading to build failure.
2013-03-05 16:47:59 -05:00
Carlos Garnacho
51ecaa062d Don't allow individual #includes for GtkBubble/SelectionWindow 2013-03-05 16:47:59 -05:00
Carlos Garnacho
a960230a20 GtkBubbleWindow: Use style border color to stroke the bubble shape
This improves themeability a bit, corners are still square though...
2013-03-05 16:47:59 -05:00
Carlos Garnacho
320613c439 textview: Use GtkSelectionWindow for touch text selection
This enables touch devices to manipulate the text selection
2013-03-05 16:47:59 -05:00
Carlos Garnacho
6767541ead entry: Use GtkSelectionWindow for touch text selection
This enables touch devices to manipulate the text selection
2013-03-05 16:47:59 -05:00
Carlos Garnacho
7260e0570c Add GtkSelectionWindow
This is a helper object to provide context-dependent content
edition apt for touch devices.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
51be6b88db Add GtkBubbleWindow
This popup window widget can be used for touch friendly context
menus that point to a concrete area.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
a97178af65 texthandle: Set a bigger input shape, covering the line height
Now, even if the handles being rendered are small, the handle touch
input shape will be as wide as the visible part of the rendered asset, and
high enough to cover both the handle and the height of the line where
the selection bound is.

Also, make handles have the same virtual distance to the line top/bottom
when a drag starts, so the handle doesn't jump to another line after a
too short threshold.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
17d3775555 Ensure the insertion handle stays on fake events (eg from IM)
Don't set handles mode to none if the event has send_event set.
For consistency with GtkEntry, also make GtkTextView keep the
handle mode on buffer changes.
2013-03-05 16:47:58 -05:00
Carlos Garnacho
d97861bd8b texthandles: Keep state internally to avoid X overhead
Handles now do sync X calls less often. As visibility state
is kept, it now can move+resize+show handles at once instead
of in separated steps.
2013-03-05 16:47:58 -05:00
Benjamin Otte
dc331ccb17 entrycompletion: Don't reconnect signals all the time
We block signal handlers areound GtkEntry signal emission and if those
signals get used to call functions on the completion that cause a
reconnection of the signals, then the reconnected signals will not be
blocked anymore (so they might get emitted?) and unblocking the old
signal id will later cause warnings.

Fixes spurious warnings in gtk/tests/filechooser tests.
2013-03-05 13:09:10 +01:00
Benjamin Otte
173317e9ce a11y: Emit active-descendants-changed when focus changes
This fixes the a11y/tree-relationships testcase.

The emission was lost in refactoring in commit
76670734f4
2013-03-05 11:56:56 +01:00
Alban Browaeys
aa08f4d8f5 bin: initialize out variables to zero for get_preferred_ functions.
Fixes case of child not visible then minimum_width/heigth natural_width
/heigth not initialized. Thus caller gets a random value.

https://bugzilla.gnome.org/show_bug.cgi?id=695131
2013-03-04 20:04:05 -05:00
Aleksander Morgado
d98b4fd0b4 clipboard: remove dead code
When setting contents of the clipboard and ownership or user data changes, we
end up calling clipboard_unset() to fully cleanup the previous clipboard state.
This call will itself call clear_func() for the previous user_data, and always
reset both 'get_func' and 'clear_func' to NULL.

So it's actually not possible to have 'get_func' being non-NULL once we have
called clipboard_unset(), so just remove that condition check and the code
inside.

https://bugzilla.gnome.org/show_bug.cgi?id=694924
2013-03-04 19:37:38 -05:00
Michael Hofmann
670e532a6b GtkColorChooserWidget: deselect swatch before removing palettes
When adding custom palettes, set the current swatch to NULL if the
palette it is on is going to be removed.

https://bugzilla.gnome.org/show_bug.cgi?id=693995
2013-03-04 18:32:00 -05:00
Will Thompson
c6fbdb67f3 gtkenums: correct various documentation typos 2013-03-04 22:49:43 +00:00
Will Thompson
507bf6e5cf docs: correct various spelling and grammar errors
I noticed a few cases of "wether", and while fixing them noticed a few
"its" which should be "it's". It all went downhill from there.
2013-03-04 22:48:22 +00:00
Giovanni Campagna
9d81b69e06 GtkIconTheme: fix regression from 0db32f0632
icon_info_dup() is now called also for GtkIconInfos that already have
a pixbuf, so we must make sure that we correctly carry that from
the original icon_info to the copy.
2013-03-04 21:34:23 +01:00
Cosimo Cecchi
944fa635ae appchooserdialog: remove redundant checks
This is checked by GIO for us now.
Also, it's generally just a bad idea spawning error dialogs from inside
a library on top of other dialogs: lesson learned.

https://bugzilla.gnome.org/show_bug.cgi?id=675333
2013-03-04 14:41:21 -05:00
Giovanni Campagna
0db32f0632 GtkIconTheme: fix failed assertion when asynchrnously loading emblemed icons
If you tried to lookup an icon that was not emblemed, and then looked up
an emblemed icon with the same base, we would override the iconinfo adding
the emblems inline. Later, when the icon finished rendering, inside
gtk_icon_info_load_icon_finish, we would copy the result from the duplicate
(which did not include the emblem infos), but the icon would still fail the
assertion, because emblems infos are present but emblem_applied is false
(they were not requested in the first place!).
Solve this by avoiding the overwrite on a cached iconinfo, and instead duplicate
the iconinfo before adding the emblems. It is expected that another layer
of caching (such as StTextureCache in gnome-shell) will take care of avoiding
multiple rendering of the same icon+emblem combination.

https://bugzilla.gnome.org/show_bug.cgi?id=694968
2013-03-04 16:28:00 +01:00
William Jon McCann
cb27c4b08c Place the search icon in the primary slot of the entry
Instead of using the secondary slot for both clear and search. This
Makes it possible to use the search icon for actions regardless of
whether text has been entered, makes it possible to use the primary
icon to indicate search status, allows us to indicate the purpose
of the entry even if text has been already entered.

https://bugzilla.gnome.org/show_bug.cgi?id=694990
2013-03-03 11:16:09 -05:00
Matthias Clasen
b1fad0f478 Fix make check 2013-03-01 19:27:10 -05:00
Cosimo Cecchi
50065b7ba0 treeview: center expander allocated space
This patch centers the expander in the extra space allocated by the
horizontal-separator style property.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2013-03-01 13:55:05 -05:00
Cosimo Cecchi
d0895d6c0f treeview: properly calculate the treeview expander size
It should be expander-size + horizontal-separator / 2. Rework code
calculating the render position of the arrow to account for the larger
size.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2013-03-01 13:55:05 -05:00
Cosimo Cecchi
32bd10bf74 treeview: remove extra padding handling
We'll replace this with a proper calculation.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2013-03-01 13:55:05 -05:00
Alexander Larsson
c4539df2f2 Re-fix opacity group handling
The last change fixed the windowed widget case but broke
opacity group handling for windowed child widgets. This fixes
up the code by making sure we norender_children in when there
is an opacity group.

This also cleans up the comments about how this works to something
that is hopefully more understandable.
2013-03-01 14:56:30 +01:00
Alexander Larsson
b5ee44b419 TextView: Properly render background
We always need to render the background, as the window
background is not always set (i.e. during gtk_widget_draw()) or
when its partially visible.

https://bugzilla.gnome.org/show_bug.cgi?id=694925
2013-03-01 12:50:20 +01:00
Matthias Clasen
02e9152738 Fix DND with frame sync
Mutter magically ignores override-redirect windows with geometry
-100-100+1+1, and this breaks the frame synchronization between
gtk+ and mutter. For now, we avoid the issue by simply giving
the window a different geometry.
https://bugzilla.gnome.org/show_bug.cgi?id=694217
2013-02-28 07:48:06 -05:00
Matthias Clasen
4bb90a7443 Remove GTK_SELECTION_MODE_EXTENDED from the docs
It does not exist anymore as an enum value.
2013-02-28 07:48:06 -05:00
Federico Mena Quintero
0ae26b94f2 Remove a NULL-GError that is no longer useful
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 18:12:20 -06:00
Cosimo Cecchi
d434a9103c range: don't draw origin when the slider is invisible
When the range of the GtkRange is zero (i.e. the upper and lower bounds
of the adjustment have the same value), don't use an origin to draw the
trough, as the slider will also be hidden, and the juncture between the
two sections of the trough will be visible.
2013-02-27 17:20:59 -05:00
Federico Mena Quintero
63b9598b51 Don't use inout ints in the drag-action-requested signal
It's not friendly to bindings, and we didn't need an inout parameter anyway.
We use a simple return value from the signal handler now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 14:39:39 -06:00
Federico Mena Quintero
bc38811645 Remove a couple of FIXMEs 2013-02-27 14:17:10 -06:00
Federico Mena Quintero
a7213e3ccf Disallow drops on the recent:/// item
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 14:04:33 -06:00
Federico Mena Quintero
3363974c09 Remove temporary debugging code
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 14:04:23 -06:00
Federico Mena Quintero
0d95705bd5 GtkTreeView: Add some CSS for the 'dnd' style class so drawing the drag-dest-row works
The default CSS didn't have anything for GtkTreeView's 'dnd' style class.  So,
the call to gtk_render_frame() to draw the highlight frame for the drag-dest-row
was getting a border-width of 0, and nothing was drawn as a result.

Now we just copy the default from Adwaita, but make the border-radius 0, to make it
square like the rest of the Raleigh theme...
2013-02-27 13:51:19 -06:00
Federico Mena Quintero
6d94f8a56c Don't allow drops in unmounted volumes
Unmounted volumes don't have a URI yet, so we can use that to distinguish them
from within the DnD code.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 12:16:31 -06:00
Federico Mena Quintero
dbf98bcfeb Properly indicate when new bookmarks are being dropped between other bookmarks
We weren't handling the drag-URIs-as-bookmarks case in drag_motion_callback().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-27 12:08:16 -06:00
Federico Mena Quintero
a46976fb79 Merge branch 'origin/master' into places-sidebar 2013-02-27 10:29:35 -06:00
Alexander Larsson
bbfc8f9a9b Fix opacity group hack
We can't norender the main window for a windowed widget as we then
never get any expose events.
2013-02-27 12:59:19 +01:00
Benjamin Otte
ce0675f1fb a11y: Emit text-changed signals when the text-buffer changes 2013-02-26 16:17:33 +01:00
Benjamin Otte
16e902d20a API: Export gtk_cell_renderer_class_set_accessible_type()
This function is necessary to implement cell renderer accessibility
support.
2013-02-25 21:42:31 +01:00
Matthias Clasen
b234025410 Some more documentation fixes
Make frame-clock-related symbols show up in the gtk docs.
2013-02-25 11:30:00 +01:00
Cosimo Cecchi
61344219d4 Revert "box: Don't special-case RTL hbox child positions anymore"
This reverts commit 6f86e57c4f.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:24 -05:00
Cosimo Cecchi
a07f767ed4 Revert "toolbar: Don't special-case RTL toolbar child positions anymore"
This reverts commit 821a675013.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:23 -05:00
Cosimo Cecchi
894f84c623 Revert "combobox: Don't special-case RTL child positions anymore"
This reverts commit cf712c462d.

https://bugzilla.gnome.org/show_bug.cgi?id=694451
2013-02-23 14:53:23 -05:00
Federico Mena Quintero
1708ae3f1a filechooserbutton: Don't ever use gtk_file_chooser_get_files()
The file chooser button only supports single-selection modes, so
switch the code to a simpler gtk_file_chooser_get_file() to avoid
dealing with GSLists of a single file.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-21 18:52:39 -06:00
Federico Mena Quintero
a41b73fbc7 GtkWidget::draw() - Document how to get the dirty region
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-21 18:48:13 -06:00
Руслан Ижбулатов
8e80fd1ab9 Make sure icon cache has /-separated subdirs only (v2 - use g_build_path)
https://bugzilla.gnome.org/show_bug.cgi?id=692955
2013-02-21 19:42:46 +01:00
Chun-wei Fan
d861779b69 Redo Completion of Visual Studio projects for gtka11y
Update the Visual Studio projects for gtka11y and the completion of the
projects that go along with it.  This have been distcheck'ed on my Ubuntu
12.04 system.
2013-02-21 15:48:04 +08:00
Federico Mena Quintero
77154f295f filechooserbutton: In tests, sleep after opening the dialog
This may ensure that the dialog is actually done initializing.  We need to kill this
sleeping business and really use signals, sigh...

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:13:07 -06:00
Federico Mena Quintero
158d74d257 filechooserbutton: Don't emit file-set signal when the change is not the result of a user action
We only emit that signal when the user confirms the button's internal GtkFileChooserDialog,
or when he drags-and-drops stuff into the button.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:13:03 -06:00
Federico Mena Quintero
cefcafc508 filechooserbutton: In the tests, run through the dialog more than one time
This ensures that data maintained by the button while the dialog opens/closes remains consistent.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:12:52 -06:00
Federico Mena Quintero
ac5cc19836 filechooserbutton: Add tests for cancelling the dialog via closing it (delete-event), instead of by simulating the Cancel button (response cancel)
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:09:13 -06:00
Federico Mena Quintero
2deb41fe63 filechooser: When stopping/clearing BROWSE model, really ensure that we end up in LOAD_EMPTY state
Previously we could end up in a situation where browse_list_model==NULL, and yet load_state==LOAD_FINISHED.
This is not a valid state.  So, when we get rid of the list model, really ensure that we end up
in LOAD_EMPTY so nothing assumes that there is a valid list model around.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:09:08 -06:00
Federico Mena Quintero
039cc929ad filechooser: Tighten up some assertions when actually selecting files in the treeview
The model must be fully loaded, and it must be inserted in the treeview.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-20 20:09:02 -06:00
Tristan Van Berkom
0f67bd7cfe GtkUIManager Buildable implementation: Fixing leaked reference count
Committing this on behalf of Milan Crha, bug: 694162
2013-02-20 18:17:14 +09:00
Benjamin Otte
76670734f4 a11y: Only emit expandable/expanded for expander column
We don't want to emit state changes for all the cells in a row, just for
the cell in the expander column. It's the only one that reports EXPANDED
or EXPANDABLE states, after all.

Also, contains refactoring of the affected functions for all the special
cases.

https://bugzilla.gnome.org/show_bug.cgi?id=694059
2013-02-20 02:44:33 +01:00
Benjamin Otte
7b4c49a95f a11y: Fix copy-paste error in state flag notification
We weren't checking the removed flag but the added flag for removal
emissions, so what would happen for every state change notification was:
- on state-added, both an "added" and a "removed" event were emitted
- on state-removed, nothing

https://bugzilla.gnome.org/show_bug.cgi?id=694059
2013-02-19 23:25:12 +01:00
Benjamin Otte
3166588033 tests: #ifdef out unused functions
... that are only used in that ifdef.
2013-02-19 14:44:49 +01:00
Rob Bradford
fe5146d8f2 window: Fix compiler warning when not building for X11
The callback function gtk_window_on_theme_variant_changed is only used on the
X11 backend (where GtkSettings is used for the settings information.)

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=674207
2013-02-19 13:11:30 +00:00
Cosimo Cecchi
7d4976b46e docs: add some missing gtk-doc blocks and Since tags for new API 2013-02-18 20:10:01 -05:00
Cosimo Cecchi
4c130ac904 tests: workarounds to keep treeview scrolling tests running
We can't safely examine allocations synchronously using
gtk_main_iteration(), as there might be not enough time for a new paint
clock tick to have expired and the allocation set on the widget.
Work this around adding g_usleep() calls before processing pending
mainloop events.
2013-02-18 19:39:12 -05:00
Torsten Schönfeld
afc57cabf0 GtkViewport: annotate the adjustment args of the constructor
NULL is accepted here, so add (allow-none).

https://bugzilla.gnome.org/show_bug.cgi?id=694022
2013-02-18 19:39:12 -05:00
jjacky
e916568781 Fix #673243: accelerators not visible on GtkRadioMenu
Also fixes a bug in set_property handler, where setting group to NULL would
cause a warning.

Signed-off-by: jjacky <i.am.jack.mail@gmail.com>
2013-02-18 19:38:48 -05:00
Cosimo Cecchi
018a425562 immodule: fix a GCC warning 2013-02-18 19:38:21 -05:00
Owen W. Taylor
3e81854351 gtk_widget_on_frame_clock_update: ref the widget
Handle a widget being destroyed while in a tick callback by
referencing the widget while dispatching tick callbacks.
2013-02-18 15:25:51 -05:00
Bastien Nocera
3c8a4126a8 GtkAccelLabel: Don't show "+" if there's no more keys to add
With the following code:
    #define INVALID_CHAR GDK_KEY_VoidSymbol - 1
    gtk_accelerator_get_label (INVALID_CHAR, GDK_SHIFT_MASK | GDK_CONTROL_MASK);
we would get this label:
    Shift+Ctrl+
instead of this label:
    Shift+Ctrl

https://bugzilla.gnome.org/show_bug.cgi?id=694075
2013-02-18 18:00:44 +01:00
Owen W. Taylor
1db87c897f Add gdk_frame_clock_begin/end_updating()
Add an API to start or stop continually updating the frame clock.
This is a slight convenience for applcations and avoids the problem
of getting one more frame run after an animation stops, but the
primary motivation for this is because it looks like we might have
to use timeBeginPeriod()/timeEndPeriod() on Windows to get reasonably
accurate timing, and for that we'll need to know if there is an
animation running.

https://bugzilla.gnome.org/show_bug.cgi?id=693934
2013-02-18 17:14:24 +01:00
Alexander Larsson
7319a0f237 GtkEntry: Fix text handle painting
We only draw the main entry on should_draw (widget->window), because
otherwise we also draw it on the GtkTextHandle widgets.

This is necessary due to the recent change for that to not return
TRUE and swallow the rest of the drawing operation.
2013-02-18 09:38:11 +01:00
Alexander Larsson
c6bbfc8e3d Add a few missing gtk_widget_unregister_window calls
This was causing warnings on widget unparent like:

Gdk-CRITICAL **: gdk_window_has_native: assertion `GDK_IS_WINDOW (window)' failed

Becasue the window was not properly removed from the lists on unrealize.
2013-02-18 09:35:58 +01:00
Paolo Borelli
bae84bdf23 [entry] unregister icon windows 2013-02-16 16:28:45 +01:00
Owen W. Taylor
ecddf94f43 GtkScrolledWindow: use gtk_widget_add_tick_callback()
This is slightly simpler and more robust than direct use of
GdkFrameClock.
2013-02-15 22:28:46 -05:00
Changwoo Ryu
658e7c4535 immodule: Fix context ID lookup on module with multiple contexts
https://bugzilla.gnome.org/show_bug.cgi?id=690247
2013-02-16 10:04:47 +09:00
Jasper St. Pierre
0fe08d43b5 Update gtk.symbols 2013-02-15 19:50:13 -05:00
Jasper St. Pierre
caa1721658 gtkplug: Remove a no-op func 2013-02-15 19:48:56 -05:00
Jasper St. Pierre
367364a8e1 Fix deprecations for GtkIconInfo 2013-02-15 19:48:56 -05:00
Jasper St. Pierre
489a10f488 gtkicontheme: Mark copy/free compat symbols as skip 2013-02-15 19:48:56 -05:00
William Jon McCann
8e96488bb2 Don't crash if inhibit is called with an unrealized window 2013-02-15 16:56:06 -05:00
Alexander Larsson
bbb981fd1a Fix gtk_widget_add_tick_callback sometimes not working
We clear GtkTickCallbackInfo on creation to ensure all fields start
as 0. Before we sometimes ended up with destroyed being 1
so the tick was never called.
2013-02-15 15:46:33 +01:00
Alexander Larsson
c6c33c5cd7 Fix up s/gtk_frame_clock/gdk_frame_clock/ in docs 2013-02-15 14:02:02 +01:00
Alexander Larsson
19784959e0 Fix GtkIconInfo docs
gtk_icon_info_copy and gtk_icon_info_free are deprecated for
the corresponding GObject methods.

We set correct transfer markup for the GtkIconInfo returning methods
to fix the introspection of them.

gtk_icon_info_load_symbolic_for_context_async had the wrong method
name in its documentation block.
2013-02-15 11:07:51 +01:00
Owen W. Taylor
ce835dee74 GtkContainer: fix disconnection from frame clock
We need to disconnect the frame clock when we unrealize (at which
point the old clock is still alive) not in destroy(). Since there
is no common unrealize for containers, trigger this from GtkWidget.
2013-02-14 17:19:53 -05:00
Owen W. Taylor
7bb07317f3 GtkTickCallback: document use of G_SOURCE_CONTINUE/REMOVE for return value
Document that G_SOURCE_CONTINUE and G_SOURCE_REMOVE are the preferred
return values from a tick callback.
2013-02-14 17:19:53 -05:00
Owen W. Taylor
6e986afbae Small documentation fixes for frame synchronization
Found by Benjamin Otte
2013-02-14 17:19:53 -05:00
Owen W. Taylor
449e8c8856 Add gtk_widget_add_tick_callback(), remove GtkTimeline, etc.
Add a very simple GtkWidget function for an "tick" callback, which
is connected to the ::update signal of GdkFrameClock.

Remove:

 - GtkTimeline. The consensus is that it is too complex.
 - GdkPaintClockTarget. In the rare cases where tick callbacks
    aren't sufficient, it's possible to track the
    paint clock with ::realize/::unrealize/::hierarchy-changed.

GtkTimeline is kept using ::update directly to allow using a GtkTimeline
with a paint clock but no widget.
2013-02-14 17:19:52 -05:00
Owen W. Taylor
645b5f398d Reimplement _NET_WM_SYNC_REQUEST inside X11 backend
Deprecate gdk_window_enable_synchronized_configure() and
gdk_window_configure_done() and make them no-ops. Implement the
handling of _NET_WM_SYNC_REQUEST in terms of the frame cycle -
we know that all processing will be finished in the next frame
cycle after the ConfigureNotify is received.
2013-02-14 17:19:51 -05:00
Owen W. Taylor
05386b44e0 GtkScrolledWindow: use GdkFrameClock for kinetic scrolling
Use GdkFrameClock when animating scrolling via touch, rather
than a timeout.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:49 -05:00
Owen W. Taylor
672100b822 GtkTimeline: Wrap around the progress correctly when looping
When we have a looping animation for something like an angle,
we need to make sure that the distance we go past 1.0 becomes
the starting distance for the next frame. This prevents a
stutter at the loop position.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:49 -05:00
Owen W. Taylor
215d029c83 GtkTimeline: introspection fixes, add :progress-type property
Fix up introspection information for GtkTimeline, install the
header has a public heaer, and add the property for :progress-type.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:49 -05:00
Owen W. Taylor
314dadca82 Hook GtkTimeline up to GdkFrameClock
Use GdkFrameClock for the timing of GtkTimeline. This require the
user to provide either a GtkWidget or a GdkFrameClock when creating
the timeline. The default constructor now takes a GtkWidget. If you
want to create a GdkFrameClock without a widget, you need to use
g_object_new() and pass in a GdkFrameClock and GdkScreen.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:49 -05:00
Owen W. Taylor
cbce5bcd0b GtkTimeline: remove settable FPS
The frames-per-second for an animation should be controlled by how
fast we can process frames and the the frame-rate of the display; it's not
a meaningful app-settable property.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:49 -05:00
Owen W. Taylor
db89b600e0 Add back GtkTimeline
Add back the GtkTimeline code that previously made private and
then removed. It will be hooked up to GdkFrameClock. This commit
purely adds the old code back.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:49 -05:00
Owen W. Taylor
344a69880a Add an UPDATE phase and GdkFrameClockTarget, use for GtkStyleContext
Switch GtkStyleContext to using GdkFrameClock. To do this, add a new
UPDATE phase to GdkFrameClock.

Add a GdkFrameClockTarget interface with a single set_clock() method,
and use this to deal with the fact that GtkWidget only has a frame
clock when realized.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:48 -05:00
Owen W. Taylor
c4545cc5d4 GdkFrameClock: Make the phase explicit when requesting the frame
Instead of having gdk_frame_clock_request_frame() have
gdk_frame_clock_request_phase() where we can say what phase we need.
This allows us to know if we get a frame-request during layout whether
it's just a request for drawing from the layout, or whether another
layout phase is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:48 -05:00
Owen W. Taylor
7753883add Use GdkFrameClock for relayout
Add a ::layout signal to GdkFrameClock and use it instead of an idle
handler to drive the restyling and relayout of containers.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:47 -05:00
Owen W. Taylor
77bac0d6ae Add GdkFrameClock
Add an object GdkFrameClock that we associate with a GdkWindow.
This tracks when the window needs to be repainted, and will also
be used for other operations in the future like relayout and
updating animations.

Based on a patch from Havoc Pennington:

 https://mail.gnome.org/archives/gtk-devel-list/2010-October/msg00004.html

https://bugzilla.gnome.org/show_bug.cgi?id=685460
2013-02-14 17:19:47 -05:00
Alexander Larsson
f35ad7ab8b GtkIconTheme: Add async versions of symbolic icon loaders
https://bugzilla.gnome.org/show_bug.cgi?id=693802
2013-02-14 22:10:15 +01:00
Alexander Larsson
23d5c41603 GtkIconTheme Don't leak pixbuf in symbolic icon cache
We need to unref the pixbuf we just put in the cache, because
symbolic_pixbuf_cache_new takes a ref.

https://bugzilla.gnome.org/show_bug.cgi?id=693802
2013-02-14 22:10:15 +01:00
Alexander Larsson
7690846c3f Add gtk_icon_info_load_icon_async
This lets you asynchronously load icons. We need this for gnome-shell
to replace its current non-threadsafe use of GtkIconTheme.

https://bugzilla.gnome.org/show_bug.cgi?id=693802
2013-02-14 22:10:09 +01:00
Alexander Larsson
e2d0846386 Make GtkIconInfo a GObject
This is necessary in order to have async operations on it.
All the old copy/free functions keeps working, and g_boxed_copy on a GObject
also works, so this should be mostly compatible, but techncally its a minor
ABI break since the GType changes fundamental type. Changes like this has
happened before though, like with GVariant becomming its own fundamental
type.

https://bugzilla.gnome.org/show_bug.cgi?id=693802
2013-02-14 22:07:25 +01:00
Federico Mena Quintero
936045e82b Merge branch 'master' into places-sidebar
Conflicts:
	docs/reference/gtk/gtk-docs.sgml
	gtk/gtkfilechooserdefault.c
	gtk/org.gtk.Settings.FileChooser.gschema.xml
2013-02-13 20:37:36 -06:00
Federico Mena Quintero
e16ade9836 filechooserbutton: Add tests for SELECT_FOLDER mode with the dialog active
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 18:01:39 -06:00
Federico Mena Quintero
22e5e77232 filechooser: Oops, cancel a file operation that was missing
In addition, remove a list of pending_cancellables that was no longer being used.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 18:01:39 -06:00
Federico Mena Quintero
69d844fbbb filechooserbutton: Add a battery of tests for GtkFileChooserButton
These are generic tests that can test the button in all of its modes,
instead of hand-written tests for each combination.

Some tests fail currently.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 18:01:39 -06:00