Commit Graph

23975 Commits

Author SHA1 Message Date
Carlos Garnacho
068a844930 gtkgesturezoom: Handle touchpad pinch events
We let these through in GtkEventController::filter, and handle
these especially on GtkGesture::update.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
d756463d9b gtkgesture: Add docs blurb about touchpad gestures
Not too long though, the precautions to take are minimal.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
e736e8dcb9 gtkgesture: Accumulate touchpad events' dx/dy in point data
This will make the gesture "center" the pointer position, plus
the accumulated dx/dy throughout the gesture progress.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
4457be688d gtkgesture: Handle touchpad events
These will be mutually exclusive with touch events, so it won't
be possible to trigger gestures through mixed input and whatnot.

The accounting of touchpad events is slightly different, there
will be a single internal PointData struct, stored in the hashtable
with the NULL event sequence/key (same than pointer events in
this regard), just that the events stored will be GdkEventTouchpad*,
so will hold information about all fingers at once.

But this difference is just internal, the GtkGesture API doesn't
make explicit assumptions about the number of points (the closest
to a per-point query API is gtk_gesture_get_sequences()). All
signals emitted just contain the last changed GdkEventSequence,
and API takes GdkEventSequences, so everything is consistent with
sequence=NULL for touchpad events.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
67ae7322e9 gtkgesture: Refactor n-points querying into a single function
Along the code, we're basically asking for 1) the total count of
touchpoints, and 2) the number of active touchpoints (not denied
nor ended).

Wrap both usecases into a _gtk_gesture_get_n_physical_touchpoints(),
and replace all occurrences.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
97e67e21a1 gtkgesture: Filter out touchpad events by default.
The gestures that don't want touchpad gesture events are majority,
even those that want such events will only listen to subsets (eg.
pinch, swipe,...).

So it makes sense to ignore touchpad events by default, and let
subclasses opt those in.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
8b1c9c0687 gtkgesture: Refactor gtk_gesture_handle_event()
We'll be dealing with event types and touchpad gesture phases,
replace the switch by a battery of if/elses. Otherwise, it's
just an style change.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
3808322f80 eventcontroller: Add private ::filter method
This will be used right before handle_event() in order to filter
out events, useful to make the previous "no touchpad events" behavior
the default, and have gesture subclasses include manually the touchpad
events they handle.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
777ac92862 gtkwidget: Ensure touchpad events trigger the bubbling phase
For all other events, we run the bubble phase deep in the specific
::motion/button-press/release/touch handlers.

For touchpad events, it doesn't make sense to use GtkWidgetClass
slots if the intended way to deal with these are gestures, so we
run the bubble phase directly from gtk_widget_event_internal().
2015-08-12 23:20:25 +02:00
Carlos Garnacho
6cd45af8b0 gtkmain: Handle rewriting of event fields during grabs for touchpad events
The window/coordinates will need translation in the case of touchpad gesture
events, same than with other pointer events.
2015-08-12 23:20:24 +02:00
Paolo Borelli
7281803169 cellrendererpixbuf: do not clear the icon helper twice
Do not call _gtk_icon_helper_clear explicitely when the properties
are set, since the corresponding _gtk_icon_helper_set_* method
already calls clear internally.
While at it rename the reset function to make it clear that it
is calling notify for the previous image type and avoid the
notification if the image type is not changing.
2015-08-12 21:40:04 +02:00
Matthias Clasen
a1332167fb color chooser: Reset show-editor on unmap
We have a testcolorchooser test, with a --edit option. It was
supposed to make the color chooser come up in edit mode, but
it didn't work ever since we dropped the ::response handler.
Fix it by resetting show-editor on unmap, instead of on map.
This way, users can set show-editor before showing the dialog,
and it will take effect.
2015-08-12 11:29:11 -04:00
David King
4a8ff565bc listbox: Describe behavior change in GtkListBoxCreateWidgetFunc
Help applicaiton authors who may already be binding GtkListBox to a
GListModel by describing the change for 3.18.

https://bugzilla.gnome.org/show_bug.cgi?id=753392
2015-08-12 12:56:05 +01:00
Matthias Clasen
12e98498f6 label: Flesh out pango attribute support
A few attribute types were missing from the support:
rise, letterspacing, fallback, font features. Add support
for these.
2015-08-11 20:57:52 -04:00
Matthias Clasen
aa9dd72e8f font chooser: Make repeated Escape cancel the dialog
The first Escape clears the search entry, the second Escape
closes the dialog.
2015-08-10 22:43:19 -04:00
Matthias Clasen
5f44339ce3 font chooser: Make the entry activate the default 2015-08-10 22:43:19 -04:00
Matthias Clasen
ecc8cd2369 font chooser: Use browse as selection mode 2015-08-10 22:43:19 -04:00
Matthias Clasen
61ffb517bc font chooser: Make Escape stop search 2015-08-10 22:43:18 -04:00
Georges Basile Stavracas Neto
e548c71394 placesview: show Disconnect instead of Eject
Since we're dealing with networks, terms like "Eject" or
the eject button are misleading, since we're not actually
ejecting but disconnecting.

Fix that by showing the appropriate icon and tooltip.
2015-08-10 15:35:56 -03:00
Georges Basile Stavracas Neto
0dff248516 placesview: sort by path
As pointed out by Cosimo, we should sort the
items according to their path.
2015-08-10 15:33:34 -03:00
Georges Basile Stavracas Neto
025f74161d placesview: plug a leak 2015-08-10 15:24:43 -03:00
Georges Basile Stavracas Neto
1219b67cdb placesview: no url for networks
We are not showing the URL of network locations
anymore, since they are distracting and not
necessary.

The code, however, forgot to cleanup the URL,
so we are still showing the URL for network
locations.

Fix that by properly cleanup the URL for network
locations.
2015-08-10 14:59:50 -03:00
Matthias Clasen
843a8791a6 Adwaita: Don't leak underlines
The .button:link .label selector matches any label "inside" a
link button. And a label inside the context menu counts as inside
for this purpose. This causes the text-decoration property to
leak into the context menu, even though the property is not
inherited. Avoid this by tightening the selector to
.button:link > .label.

https://bugzilla.gnome.org/show_bug.cgi?id=753451
2015-08-10 16:41:18 +02:00
Georges Basile Stavracas Neto
5e3d0b19b0 placesview: jumps to the default location
When we connect to a server, the default and expected
behavior is going to the default location, which usually
is the home directory or a writable directory.

GtkPlacesSidebar behaves properly, while GtkPlacesView
doesn't.

Fix that by jumping to the default locations instead of
the root location.
2015-08-10 10:42:43 -03:00
Matthias Clasen
b9bced693a Remove some unused data 2015-08-09 23:39:14 +02:00
Matthias Clasen
3eb0eaffe2 Remove an unused function 2015-08-09 23:39:00 +02:00
Matthias Clasen
62dce64a48 Remove a self-assignment
clang doesn't like those.
2015-08-09 23:38:40 +02:00
Matthias Clasen
0f851be368 Fix a doc comment typo 2015-08-09 23:32:04 +02:00
Matthias Clasen
9ecfffa830 Formatting fixes 2015-08-08 23:10:00 +02:00
Matthias Clasen
b54fab2b89 HighContrast: Fix undershoot in sidebars
This was just not implemented, and the sidebars solid white
background color was inherited by undershoot rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=753391
2015-08-08 23:10:00 +02:00
Kalev Lember
d6f51ef7b2 listbox: Avoid using show_all on rows
Don't use gtk_widget_show_all() on row widgets because that would
unconditionally show all of its children. This might be unwanted in case
the row implementation wants to keep some of its children hidden.

This commit changes it to use show() instead of show_all() and relies on
the row widget to control the visibility of its children itself as
appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=753392
2015-08-08 16:54:31 +02:00
Matthias Clasen
27afd624cd HighContrast: Improve GtkCalendar drawing
Make days gray that are not in the current month.

https://bugzilla.gnome.org/show_bug.cgi?id=753357
2015-08-08 10:02:49 +02:00
Matthias Clasen
defc0cf5df file chooser button: Fix some refcounting confusion
GtkFileSystem has a complicated way to handle cancellables.
You keep the cancellable pointer that is returned by
_gtk_file_system_get_info and similar methods so that you can
cancel the operation, but you do not own a reference to it.
The only place where it is ok to unref a cancellable is in
your callback, which gets handed a cancellable that you need
to unref at the end. You are expected to compare it to the
pointer you stashed away to find out if the operation has
already been superseded by a newer call, in which case you
disregard the results.

GtkFileChooserButton was following these rules for most of
the cancellables it keeps around, but it was sometimes unreffing
the cancellables that are stored in the model, which could lead
to refcount confusion and crashes. This commit makes it follow
the rules for that case too, which fixes the crash in the bug
below, and does not show up any leaks in valgrind under light
testing.

https://bugzilla.gnome.org/show_bug.cgi?id=737804
2015-08-06 14:51:25 +02:00
Chun-wei Fan
f0a1a0c0a4 gtk/gtkcsstypesprivate.h: Fix Build
The recent change to the enum declaration for GtkCssChange actually
relied on compiler-dependent behavior, which also breaks the build on
some non-GCC compilers, such as Visual Studio.  As noted in the
G_STATIC_ASSERT line just beneath this declaration, we need to change
this enum declaration to #define's, in order to fix the build in such
situations.

https://bugzilla.gnome.org/show_bug.cgi?id=752814
2015-08-06 05:48:22 +08:00
Matthias Clasen
9711608ba3 Fix a doc comment 2015-08-05 14:20:12 -04:00
Ting-Wei Lan
68e00e9e5d placesview: Fix wrong property type when creating a GtkLabel
The type of xalign property of GtkLabel is float, not int. Using wrong type
crashes GtkFileChooser on x86_64 when compiling with clang.

https://bugzilla.gnome.org/show_bug.cgi?id=753284
2015-08-05 23:31:13 +08:00
Marek Kasik
359534ee59 GtkScrolledWindow: Don't handle key event when can't scroll
Don't return that a key event was handled when the corresponding
scrollbar can not scroll.

https://bugzilla.gnome.org/show_bug.cgi?id=753256
2015-08-05 17:15:52 +02:00
Jakub Steiner
01371085ee Adwaita: calendar button fix
- provide insensitive button state for GtkCalendar buttons

https://bugzilla.gnome.org/show_bug.cgi?id=753230
2015-08-05 14:05:57 +02:00
Matthias Clasen
e34ab3561f color chooser: Use a popover for the context menu
It works just as well here as it does in the file chooser, and
this lets us unify the right-click and long-press behavior a bit.
We used to switch directly to the editor on long-press, now we
can show the popover, just as we do on right-click.
2015-08-04 22:59:58 -04:00
Carlos Garnacho
69c9cb85e2 gtkwindow: bail out on WM operations in the presence of grabs
These operations will require a grab on the WM side, so we can spare the
attempt from the WM to take a grab when we're certain it won't suceed.

https://bugzilla.gnome.org/show_bug.cgi?id=752327
2015-08-04 17:59:01 +02:00
Carlos Garnacho
a6ca56969e gtkmain: Don't process WM events if there's a grab on another toplevel
This is implicitly done for us in the case of grabs on windows from other
groups, but we must perform this check explicitly for grabs with
owner_events=True on windows from the same group, in that case the window
would handle the events as if there was no grab.

https://bugzilla.gnome.org/show_bug.cgi?id=752327
2015-08-04 17:58:39 +02:00
Matthias Clasen
56d39241a9 inspector: Fix a typo
Blocking a signal should be paired with unblocking.
Spotted by Krzesimir Nowak
2015-08-04 07:11:34 -04:00
Matthias Clasen
b10bfe128f GtkButton: Pick up images that are set early
We were failing to construct the child if an image was set
before constructed (e.g. in the init() function of a button
subclass).

https://bugzilla.gnome.org/show_bug.cgi?id=753048
2015-08-03 22:35:36 -04:00
Matthias Clasen
ba45fa09b4 HighContrast: Avoid resizing treeview headers
https://bugzilla.gnome.org/show_bug.cgi?id=753060
2015-08-03 22:16:34 -04:00
Matthias Clasen
198d99d680 Whitespace fixes 2015-08-03 22:02:22 -04:00
Timm Bäder
61ba7adfc8 GtkLabel: Show erroneous text if parsing markup failed
https://bugzilla.gnome.org/show_bug.cgi?id=752920
2015-08-03 11:31:00 +02:00
Matthias Clasen
14de03cedf file chooser: Don't leave out icons by accident
We only load thumbnails when we find that the row is in the visible
range of the treeview. It seems that animated scrolling makes it so
that the bottommost row stays out of the visible range until it is
too late. To work around this, extend the range by one row in each
direction.

http://bugzilla.gnome.org/show_bug.cgi?id=753142
2015-08-02 20:51:12 -04:00
Jasper St. Pierre
9cbd9c4187 Adwaita: Remove non-working selector
This was suppsed to be ".list-row.button", I'd imagine, but the missing
dot meant it never worked in the first place. Just clean it up.
2015-08-02 12:57:32 -07:00
Jasper St. Pierre
03ae86d9f6 Don't trigger extraneous redraws on font / text-attr changes
Any time that these change, we shouldn't need to force a redraw on
the widget either.
2015-08-02 12:57:31 -07:00
Jasper St. Pierre
4da945dc4b widget: Don't queue redraws for properties that don't affect anything
Properties like transition-property might change when hovering over
something, even if the property itself does not change. These properties
don't affect drawing, so don't queue redraws for them.
2015-08-02 12:57:31 -07:00
Jasper St. Pierre
36c0c9d0b8 listbox: Don't queue draws on the entire widget
The set_state_flags code should already queue redraws when needed.
2015-08-02 12:57:31 -07:00
Jasper St. Pierre
ce75c835e1 cssimage: Don't start a transition if the start and end are the same
Since a lot of Adwaita sets transition: all, it's easy to end up in a
state where we're making dummy transitions for all of the icons, most of
which we'll never be showing.
2015-08-02 12:57:31 -07:00
Matthias Clasen
142efd186d Inspector: Preserve selection when rescanning
We are semiregularly repopulating the object tree. Whenever
we do, we loose the selection, needlessly. Do the extra work
to preserve it.

http://bugzilla.gnome.org/show_bug.cgi?id=753130
2015-08-02 15:20:17 -04:00
Paolo Borelli
ca8f6dd7f6 cleanup: do not set members to null in finalize 2015-08-01 21:31:49 +02:00
Paolo Borelli
3fec677da0 cleanup: no need to set members to null when freeing the struct 2015-08-01 21:30:53 +02:00
Paolo Borelli
7921ac510e cleanup: one more g_slist_free_full 2015-08-01 21:30:16 +02:00
Benjamin Otte
186e94bafb searchenginetracker: Ignore NULL directories 2015-08-01 05:50:20 +02:00
Jasper St. Pierre
93171cf4f3 gtkoverlay: Optimize size allocations
Doing raises / lowers here will invalidate the entire child widget
almost every time, since raising each widget causes it to invalidate
that area.
2015-07-31 20:39:02 -07:00
Matthias Clasen
9f24b54786 Code cleanup
Use g_slist_free_full more consistently. This commit just converts
the obvious cases where g_slist_forall is directly followed by
g_slist_free.
2015-07-31 22:23:35 -04:00
Jakub Steiner
9dd2645c4a HC: shade spinbuttons as entries
https://bugzilla.gnome.org/show_bug.cgi?id=746491
2015-08-01 02:22:34 +02:00
Matthias Clasen
fb0a13b7f0 file chooser: Allow activating without double-click
Interpret a unmodified primary click on the selection like a double
click. This makes it possible to activate a file or open a folder
without using double-click.
2015-07-31 13:46:35 -04:00
Matthias Clasen
28b4599f9b gesture single: Use gtk_simulate_touchscreen
Instead of manual tests.
2015-07-31 13:46:35 -04:00
Matthias Clasen
72d0b4d2c2 text view: Use gtk_simulate_touchscreen
Instead of repeated manual tests.
2015-07-31 13:46:34 -04:00
Matthias Clasen
5aa1f0923c entry: Use gtk_simulate_touchscreen
Instead of repeated manual checks.
2015-07-31 13:46:34 -04:00
Matthias Clasen
98121aa302 Add a private function to determine if we simulate
These same two or three tests are currently duplicated
in several places, with separate static variables. Lets
do this in one place.
2015-07-31 13:46:34 -04:00
Jakub Steiner
230c248326 HC: custom color button fixes
https://bugzilla.gnome.org/show_bug.cgi?id=753051
2015-07-31 15:43:44 +02:00
Christian Dywan
18dddddbab entry completion: Clarify index in documentation
https://bugzilla.gnome.org/show_bug.cgi?id=579466
2015-07-31 09:11:57 -04:00
Matthias Clasen
6f194564ff Use pango_fc_font_map_config_changed
Use pango_fc_font_map_confit_changed() instead of
pango_fc_font_map_cache_clear().

https://bugzilla.gnome.org/show_bug.cgi?id=748772
2015-07-31 00:50:47 -04:00
Carlos Garnacho
65f7fb04ad GtkMenuButton: explicitly protect against recursion
The visibility toggling happening on ::click() relied implicitly
on the popover animation, but breaks on disabled animations. The
recursion happening within gtk_toggle_button_set_active() (which
triggers ::clicked when changing state) makes this vfunc to run
again, inverting the visibility of the popover in result.

Fix this by explicitly checking about recursion, we want the
button to be toggled to the right state, but we don't want the
callback running again.

https://bugzilla.gnome.org/show_bug.cgi?id=752577
2015-07-30 22:37:53 -04:00
Benjamin Otte
2550c6a4db combobox: Refactor cell view treatment
Instead of putting it inside the button manually, put it there properly
by adding a box containing the cell view and the arrow.

Do the same thing in list mode, instead of creating an event box that
tries to behave as a button.
2015-07-31 04:03:44 +02:00
Benjamin Otte
bbd9c59832 combobox: Handle NULLing the cellview on remove simpler 2015-07-31 04:03:44 +02:00
Benjamin Otte
1261ec985b combobox: Remove unused variables 2015-07-31 04:03:44 +02:00
Benjamin Otte
62c43aac43 combobox: Create cell view identically
... in the two places it can be created.
2015-07-31 04:03:44 +02:00
Matthias Clasen
ec338b0ab6 file chooser: Don't crawl recent://
This is unnecessary - all the recent files are in the model already.
It also leads to duplicates, since our duplicate filtering is based
on g_file_equal, which does not consider recent:///blabla with
target-uri=/my/example to be the same as file:///my/example.
2015-07-30 14:29:10 -04:00
Jakub Steiner
ffec25b015 HC: no need for green in scales 2015-07-30 14:02:58 +02:00
Jakub Steiner
cd08b427c9 HC: fix typo 2015-07-30 13:54:29 +02:00
Matthias Clasen
ce3ebaf6f9 Expand builder menu documentation
List the supported attributes.
2015-07-29 23:17:43 -04:00
Matthias Clasen
c6838fbff0 GtkTextView: Support font features
Add a ::font-features attribute to GtkTextTag, and support
font features when inserting Pango markup into a text buffer.
2015-07-29 21:42:58 -04:00
Georges Basile Stavracas Neto
98f9532a22 placesview: don't show mount for Computer row
The "Computer" row from places view is an abstract volume
that represents the root of the current partition. As such,
it cannot be mounted or unmounted.

Remove the related item on context menu for Computer row.
2015-07-29 19:39:03 -03:00
Christian Hergert
08addd9859 fontchooserwidget: use appropriate model for GtkTreeIter
We were previously mixing the model used when filtering with an iter that
has been resolved to the backing model.

This results in both an invalid row index as well as an invalid
iter->stamp.
2015-07-29 12:57:43 -07:00
Matthias Clasen
8695cf3c5a Fix oversights in templates
Some of our templates were not setting the domain attribute
on the <interface> element.
2015-07-29 15:15:10 -04:00
Jakub Steiner
b5a684de68 HC: make progressbar labels more visible
- use the same colro as regular labels, no
need to be more subtle

https://bugzilla.gnome.org/show_bug.cgi?id=752978
2015-07-29 13:32:34 +02:00
Jakub Steiner
a0ee054bb1 HC: make pushed columns visible
https://bugzilla.gnome.org/show_bug.cgi?id=752977
2015-07-29 13:27:17 +02:00
Jakub Steiner
66cacaf725 HC: provide explicit treeview styling
deals with some details like:

- DND stuff
- progressbar
- expanders
- separators

https://bugzilla.gnome.org/show_bug.cgi?id=752975
2015-07-29 13:24:11 +02:00
Jakub Steiner
2cd86139fa HC: :checked:hover color fix for menuitems
https://bugzilla.gnome.org/show_bug.cgi?id=752969
2015-07-29 12:40:16 +02:00
Jakub Steiner
9dabc4efd5 HC: make link buttons distinct
https://bugzilla.gnome.org/show_bug.cgi?id=752965
2015-07-29 12:34:44 +02:00
Jakub Steiner
3cf28a835f HC: whitespace for sidebar
- make some room around the sidebar icons

https://bugzilla.gnome.org/show_bug.cgi?id=752960
2015-07-29 12:20:28 +02:00
Georges Basile Stavracas Neto
e51946270a placesview: simplify code
Since we started adding a persistent Computer item,
all the code related to the view modes became obsolete,
since the view is never empty anymore. So, drop this
dead code and use the plain stack to manage the empty
search results view.

Also, this patch fixed a very annoying keyboard navigation
issue where we couldn't go from the On This Computer to Networks
lists, because they were two separate widgets. Merge the two
lists into a single one, and update headers accordingly.
2015-07-28 11:46:25 -03:00
Georges Basile Stavracas Neto
da11404719 placesviewrow: hook up finalize
It is needed to hook up the finalize method, since
it's overriden manually.
2015-07-28 07:41:32 -03:00
Georges Basile Stavracas Neto
c3b6345377 placessidebar: fix ellipsizing glitch
The places sidebar rows' labels were missing a proper
xalign, which caused the labels to keep shaking while
the sidebar was resized.

Fix that by setting the label's xalign to 0.
2015-07-28 07:08:03 -03:00
Georges Basile Stavracas Neto
317ba620e2 placesview: plug some memory leaks
The GFile containing the Computer item was not
properly dereferenced, so plug that leak by both
dereferencing it and adding some reference management
on GtkPlacesViewRow.
2015-07-28 07:03:09 -03:00
Georges Basile Stavracas Neto
a5e762e6a7 placesview: show Computer item
GtkPlacesView widget manages persistent locations,
factoring out GtkPlacesSidebar functionality.

It, however, does not completely shows all sidebar
locations, since Computer is still missing.

Add a Computer item, adjusting some internal behavior
to make that possible.
2015-07-28 07:03:09 -03:00
Georges Basile Stavracas Neto
5134e4b3bd placesview: don't show network addresses
It is distracting, not relevant and too space
consuming.

Remove the network addresses label.
2015-07-28 07:03:09 -03:00
Georges Basile Stavracas Neto
c00f216d92 placesview: fix documentation
The doc for gtk_places_view_get_search_query was being
set twice, while gtk_places_view_set_search_query was
never set.

Fix that by correcting the wrong getter documentation.
2015-07-28 07:03:09 -03:00
Georges Basile Stavracas Neto
ea3a80c19f placessidebar: fix documentation
Use the same explanation of why GtkPlacesSidebar::show-connect-server
was deprecated and its replacements on getter and setter.

Also, fix a mistakenly deprecated function.
2015-07-28 07:03:09 -03:00
Matthias Clasen
df50858dfd inspector: Show monitor information
This is useful to verify the monitor information returned by
other backends.
2015-07-28 01:14:49 -04:00
Matthias Clasen
bc68600cb0 inspector: Show wayland display information
Don't call it "X display" when we show useful information under
Wayland as well.
2015-07-28 00:46:34 -04:00
Matthias Clasen
4050abe2fa Plug a memory leak
GtkCssProvider was using the wrong unref function for GtkCssKeyframe
objects. Funnily, this didn't crash at all, the refcount was at the
same place in the struct - it just didn't free all the memory, causing
valgrind to complain.
2015-07-27 14:54:13 -04:00
Christoph Reiter
048d710d67 quartz app menu: add hidpi support for menu icons
Use the new cairo to NSImage converter function
to set the device scale.

Remove the pixbuf converter function as this was
the last user.
2015-07-27 17:28:36 +02:00
Christoph Reiter
4b23ba53c5 quartz dnd: add hidpi support for gtk_drag_set_icon_surface()
Instead of storing the dnd icon as a pixbuf store it
as a cairo surface and transfer the device scale
when converting it to a NSImage. In the pixbuf/stock/named
setters convert to a surface instead (no hidpi support yet)
2015-07-27 17:28:14 +02:00
Christoph Reiter
5003b5873a quartz dnd: fix drag icon position relative to cursor position
The y axis is reversed on osx
2015-07-27 17:27:51 +02:00
Georges Basile Stavracas Neto
e0339c5244 placessidebar: show Computer item when not in Other Locations
Previous commits removed from places sidebar the code related
to displaying the Computer item, which should be shown when
the sidebar is not displaying the Other Locations item.

Add back the item when the sidebar is not in Other Locations'
mode.
2015-07-27 12:21:36 -03:00
Patrick Griffis
ee73e27fd7 quartz: Fix building
Broken by 6d04183c5d and 6ac07a2e85
2015-07-27 09:33:32 -04:00
Matthias Clasen
49a596aa52 file chooser: Note when searching remote locations
Inform the user that we won't search recursively when searching
in remote locations.
2015-07-27 08:07:39 -04:00
Matthias Clasen
eee85d39e5 Avoid more GFile<>uri roundtrips
Make GtkSearchHit carry a GFile instead of an uri. Most of the
search engines already have the object around, and converting
to an uri and back is unnecessary extra work.
2015-07-27 08:07:39 -04:00
Matthias Clasen
f7bba525fc search engine: Don't crawl remote locations
This is slow, and causes too much network I/O.
So skip locations that look like they are remote.
2015-07-27 08:07:39 -04:00
Matthias Clasen
93bfec3ac5 Add a helper function for remote locations
Add a helper function that says whether a location should be
considered remote. To determine this, we look at the filesystem
type reported by gvfs, and say 'remote' for sftp, webdav, ftp,
nfs and cifs.
2015-07-27 08:07:39 -04:00
Matthias Clasen
30de4cc7bb Actually use search results from the model
We didn't connect to the signals, so we never picked up
any search results from the model engine. Good thing, since
it was returning the wrong thing.
2015-07-27 08:07:39 -04:00
Matthias Clasen
1069e2b9cc Port to GtkSearchHit
GtkSearchEngineModel was still trying to return uris as hits.
This is not working anymore, we are expected to return GtkSearchHit
structs.
2015-07-27 08:07:38 -04:00
Matthias Clasen
48c172f4e0 Always pass a location into the query
Failure to do so was causing search to start from the home dir
when the current folder is not represented on the sidebar.
2015-07-27 08:07:38 -04:00
Matthias Clasen
71b3e0b66b Store locations as GFile
It is a bit pointless to have the file chooser get a uri from an
existing GFile to put in the query, only to have some of the search
engines reconstruct a GFile from it.
2015-07-27 08:07:38 -04:00
Matthias Clasen
859db92183 Remove a redundant assignment 2015-07-27 08:07:27 -04:00
Benjamin Otte
5e2ab6db7f combobox: Use ui file to construct internal button child 2015-07-26 17:18:42 +02:00
Benjamin Otte
5ad5431cb7 combobox: Create button on init() and destroy in destroy()
The button is the same in both menu and list mode, so there's no need to
destroy and recreate it.
2015-07-26 17:18:42 +02:00
Benjamin Otte
e0572212bc combobox: Add scroll support in list mode 2015-07-26 17:18:42 +02:00
Benjamin Otte
8243140731 combobox: Remove unused argument
The visible check is always FALSE, so no need to keep the code around.
2015-07-26 17:18:42 +02:00
Benjamin Otte
63c219b8e7 combobox: Remove the box from the button
... when in menu mode.

Now that we don't have a separator anymore, the box is not needed
anymore.
2015-07-26 17:18:42 +02:00
Benjamin Otte
fcb26376df combobox: Remove the separator
It was a special case and it's not used by themes anymore.

Plus, in the CSS world, if a theme wants a separator, it can just
style the button's border to create one.
2015-07-26 17:18:42 +02:00
Matthias Clasen
93a4030c45 Remove a duplicate string
dialog-information was twice in the list of accessible labels
for icon names.
2015-07-26 02:57:39 -04:00
Matthias Clasen
58fa3d96a8 listbox: Fix shift-selection
Selecting a range of rows with Shift-click was accidentally broken
in e6e511eb46. Make it work again.
2015-07-26 02:40:26 -04:00
Matthias Clasen
6ac07a2e85 quartz: Implement NO_TARGET drag result
This is necessary to make notebook tab DND work.

https://bugzilla.gnome.org/show_bug.cgi?id=752638
2015-07-26 02:10:47 -04:00
Jonas Ådahl
955c1c7734 GtkMenu: Properly detach menu when the window is detached
Without properly cleaning up GtkMenu private attach state
(GtkMenuAttachData) when the attached widget is freed, we would end up
with an invalid pointer to a freed widget. Trying to detach from that
widget would cause a segmentation fault.

https://bugzilla.gnome.org/show_bug.cgi?id=752761
2015-07-26 01:57:26 -04:00
Matthias Clasen
b2b4a3bb0a Fix a warning 2015-07-26 01:49:19 -04:00
Matthias Clasen
5c2759af3c Use standard cursor names
This changes GTK+ to use gdk_cursor_new_from_name() with the
'standard' css names, instead of GdkCursorType.

https://bugzilla.gnome.org/show_bug.cgi?id=652085
2015-07-26 01:45:06 -04:00
Matthias Clasen
69d90d4f50 places view: Documentation fixups
Rewrite gtk_places_sidebar_set_show_enter_location docs, add
references to the relevant signals, remove mentions of
GtkPlacesView from the docs, since it is not public at this point.

https://bugzilla.gnome.org/show_bug.cgi?id=752633
2015-07-25 12:11:05 -04:00
Jeremy Whiting
f9d903995d Added api to set a window to fullscreen on a given monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=752677
2015-07-25 07:08:59 -06:00
Matthias Clasen
a8512e097a Fix a typo
https://bugzilla.gnome.org/show_bug.cgi?id=752810
2015-07-24 11:28:59 -04:00
Carlos Garnacho
862cac7fe6 GtkGesture: minor cleanup
We're not really using the coordinates in that function, we just
double check it's not an unrelated event.
2015-07-24 13:44:22 +02:00
Chun-wei Fan
d9985dad5b gtk/gtkplacessidebar.c: Fix Build on C89
Ensure variables are declared at the top of the block, and remove a ';;',
which C89 compilers don't like.
2015-07-24 16:25:01 +08:00
Matthias Clasen
dc82949fbe file chooser dialog: Better spacing
When the dialog is as narrow as possible, we still want some
space between the entry and the search button, so use margins
around the entry and label instead of box spacing.
2015-07-23 22:15:32 -04:00
Matthias Clasen
e2b9caf26a file chooser: Fix gtk_file_chooser_set_show_hidden
We should not override an explicitly set show-hidden value
when loading the setting.

https://bugzilla.gnome.org/show_bug.cgi?id=610925
2015-07-23 21:54:47 -04:00
Matthias Clasen
3fec234c22 inspector: Rescan toplevels when they change
This ensures that windows appear in the inspectors tree when
they are created, and it prevents GTK_DEBUG=interactive from
coming up with an empty object tree.

https://bugzilla.gnome.org/show_bug.cgi?id=752664
2015-07-23 21:28:28 -04:00
Matthias Clasen
9a44f18940 inspector: Add a function to rescan
Currently, we only ever scanned the toplevel list and
widget tree once. That is not enough.
2015-07-23 21:27:37 -04:00
Matthias Clasen
1138d4f489 Another fix for unmapped window states
The previous fix was falling into the crack between
realized and mapped - we would apply the state when a window
is just realized, then unset the _initially flag, and then
when the window gets mapped, we'd undo the state. To fix
this, go back to the way things were when these flags were
first introduced.

https://bugzilla.gnome.org/show_bug.cgi?id=752765
2015-07-23 17:54:50 -04:00
Timm Bäder
56051b0bd8 GtkWidget: Fix set_font_map docs
A typo and non-matching parameter names.
2015-07-23 17:59:17 +02:00
Matthias Clasen
707459fe4e file chooser: Make keynav in save mode smoother
When using the location popup to complete to a directory name
(with a trailing /), we should not punish the user by making the
Open button insensitive and preventing the Enter key from doing
the expected thing (switching to that directory).

https://bugzilla.gnome.org/show_bug.cgi?id=752708
2015-07-23 01:04:15 -04:00
Matthias Clasen
3f18e76a34 Remove debug spew 2015-07-23 00:45:32 -04:00
Matthias Clasen
91c05f6f6b file chooser entry: Special-case ., .. and ~
Make sure entering the three special strings ".", ".." or "~" in
the location entry works as expected. They already worked correctly
if you append a '/' to force them to be recognized as the 'folder'
part, but that should not be necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=752707
2015-07-23 00:42:19 -04:00
Matthias Clasen
f30637bbae GtkWindow: Rework the _initially variables
Go back to use these variables only for pre-mapped state changes.
Their use got muddied over the years, and it was hard to keep track
of what is acutal state, and what just a queued request.
2015-07-22 23:28:39 -04:00
Matthias Clasen
8b695cc727 Revert "window: fix initial shadow width for maximized/fullscreen windows"
This reverts commit 740bcf5fe0.
2015-07-22 23:16:52 -04:00
Matthias Clasen
de2ea1ebaa Revert "gtkwindow: Reset maximize / fullscreen_initially on state changes"
This reverts commit 862e0dab03.
2015-07-22 23:16:44 -04:00
Matthias Clasen
167734c153 file chooser: Fix a crash
The save_widgets_create function was not safe against
being called multiple times in save mode, calling
gtk_file_chooser_set_create_folders was a way to trigger
this crash.
2015-07-22 19:16:23 -04:00
Stefan Sauer
0076b943ad toolbutton: linkify properties 2015-07-22 21:48:06 +02:00
Stefan Sauer
71b278fb4d toolbutton: fix misleading docs
First only label-widget clashes with icon-name and not the label property. In
addtion fix the propertyname to use '-' instead of '_'.
2015-07-22 19:13:07 +02:00
Benjamin Otte
31191d5566 fontchooserwidget: Refactor code so we actually optimize
Previously, we would pango_font_describe() every time the code ran and
we wouldn't ever hit the optimized quick exit.

The code now is a lot more complex because the
compute-actual-value-when-required-the-first-time approach is not
supported out of the box in GtkTreeModel (or GValue).
2015-07-22 16:01:21 +02:00
Matthias Clasen
a56bd1c490 GtkImage: Plug a memory leak 2015-07-21 23:04:30 -04:00
Matthias Clasen
3243ae6e08 places sidebar: Don't leak shortcuts
Poined out by valgrind.
2015-07-21 21:00:12 -04:00
Matthias Clasen
fbee8c5ba3 GtkSearchEngine: Be more robust in cancellation cases
When the search is cancelled, we may end up with a tracker
dbus reply coming in after the GtkSearchEngine object is
already gone, and bad things happen. Prevent this by
using g_signal_connect_object instead of g_signal_connect.
2015-07-21 20:40:46 -04:00
Matthias Clasen
38a5db8f83 GtkQuery: Make API follow GTK+ conversions
We generally have const getters for strings, and the two users
of this API were promptly leaking the (unexpected) copy they
got from gtk_query_get_location and gtk_query_get_text.
2015-07-21 20:39:29 -04:00
Matthias Clasen
9418712782 places sidebar: Always chain up in finalize
The GtkSidebarRow class was forgetting to do this. The visible
symptom of this in valgrind is that you notice GObject data
being leaked.
2015-07-21 19:52:54 -04:00
Matthias Clasen
3e6177d2dd places sidebar: Plug a memory leak 2015-07-21 19:52:54 -04:00
Matthias Clasen
1e981790de places sidebar: Improve docs
Clarify the deprecation note for ::show-connect-to-server.
https://bugzilla.gnome.org/show_bug.cgi?id=752633
2015-07-21 15:07:37 -04:00
Matthias Clasen
7a84c26d0b places sidebar: Improve the docs
Reword the docs of gtk_places_sidebar_set_drop_targets_visible().
2015-07-21 15:07:37 -04:00
Matthias Clasen
b4b46b74e5 places sidebar: Fix a copy-paste leftover
The ::populate-all nick and blurb where not referrering to this
property at all.
https://bugzilla.gnome.org/show_bug.cgi?id=752633
2015-07-21 15:07:37 -04:00
Stefan Sauer
658a1ef069 toolbutton: improve docs wrt stock deprecation
Docuemnt where to get the images from.
2015-07-21 20:17:16 +02:00
Matthias Clasen
8102425f03 places view: Disconnect from volume monitor
Just unreffing the volume monitor object won't stop it from emitting
signals that we are connected to. Disconnect from the signals in
finalize.
2015-07-20 21:23:06 -04:00
Benjamin Otte
ceab99ff2f treeview: Don't underallocate editing widgets that are too big 2015-07-21 02:28:53 +02:00
Benjamin Otte
3402363684 combobox: Unconditionally draw background and border 2015-07-21 02:28:53 +02:00
Benjamin Otte
5f6db9a182 combobox: Remove autoscroll timer on popdown 2015-07-21 02:28:53 +02:00
Benjamin Otte
19726a5a0e combobox: Remove cell_view_frame
Cell views can draw their own frames now.
2015-07-21 02:28:53 +02:00
Benjamin Otte
7b57221522 cellview: Implement border and background drawing 2015-07-21 02:28:52 +02:00
Stefan Sauer
6f4518ab4b gtkimagemenuitem: improve the replacement docs even more
Since the stock strings usually have menmosics suggest
gtk_menu_item_new_with_mnemonic().
2015-07-20 21:04:28 +02:00
Stefan Sauer
8a6bad7faf gtkimagemenuitem: fix suggestion for replacement
gtk_menu_item_new(9 would create an empty menu item. While the stock deprecation
aims to unclutter the menus, I feel this goes too far.
2015-07-20 20:54:52 +02:00
Cosimo Cecchi
62af1cbb1d drawingarea: use same background approach as GtkLayout
Call gtk_style_context_set_background() every time the style is updated
and add a comment as to why we still need to do it here.

https://bugzilla.gnome.org/show_bug.cgi?id=752599
2015-07-20 08:43:08 -07:00
Cosimo Cecchi
90d237ced4 Revert "drawingarea: don't call gtk_style_context_set_background()"
This reverts commit 6786c9d724.

https://bugzilla.gnome.org/show_bug.cgi?id=752599
2015-07-20 08:43:08 -07:00
Cosimo Cecchi
11ce41d9c4 Revert "drawingarea: checks parent's draw() before call it"
This reverts commit b3166b745f.

https://bugzilla.gnome.org/show_bug.cgi?id=752599
2015-07-20 08:43:08 -07:00
Matthias Clasen
2dfad2b0d1 file chooser: Memory handling fixes
I forgot to clean up the long press gesture, and in additon, creating
the rename popover from the ui template was causing the tree view
to not be disposed when the file chooser goes away. Work around this
by manually unsetting the relative-to widget of the popover in dispose.
2015-07-20 11:12:49 -04:00
Ting-Wei Lan
50a2428739 Fix return value error in gtk_stack_get_interpolate_size 2015-07-20 21:55:40 +08:00
Timm Bäder
ddcb309b5b GtkPopover: Set interpolate-size on the stack...
... in gtk_popover_bind_model
and gtk_popover_menu_init
2015-07-20 10:26:06 +02:00
Timm Bäder
469db13b81 GtkStack: Add interpolate-size property
And use it to determine whether we should actually interpolate between
stack sizes or not.
2015-07-20 10:26:06 +02:00
Matthias Clasen
1da92c2800 GtkListBox: Improve focus scrolling
We are trying to scroll the header in view together with the
focus row. The way this is implemented works fine when scrolling
up, but falls short when scrolling down. Fix this by making sure
that both the row and the header bar visible.
2015-07-19 22:18:58 -04:00
Matthias Clasen
52c4955d21 GtkListBox: Listen for adjustment changes
We automatically pick up an adjustment from our parent
scrollable, but we failed to update it when it changes.
This is happening in the places sidebar, and it was causing
the focus-tracking to fail there, letting the focus move
out of view. With this change, the focus remains visible.
2015-07-19 22:08:36 -04:00
Matthias Clasen
55652b6b09 places sidebar: Improve keynav
Remove the code in the sidebar keypress handler that imperfectly
reproduces what GtkListBox already does: moving selection and
focus in response to arrow keys.
2015-07-19 22:07:21 -04:00
Matthias Clasen
bd41c92b28 trivial: Some reformatting 2015-07-19 17:39:23 -04:00
Matthias Clasen
5b5b4de495 places sidebar: Remove pointless code
No need to set or unset adjustments explicitly.
2015-07-19 17:37:39 -04:00
Matthias Clasen
f263c11ce8 spin button: Add Home and End as key bindings
Make these go to the lower/upper boundary of the adjustment, like
Ctrl-PageUp/PageDown already do.
https://bugzilla.gnome.org/show_bug.cgi?id=309300
2015-07-19 17:17:53 -04:00
Matthias Clasen
e7fe194b2d GtkWidget: Add custom font map support
This allows to use a custom font map for parts of the widget
hierarchy - this can be used for application-specific fonts.

https://bugzilla.gnome.org/show_bug.cgi?id=751812
2015-07-19 16:58:43 -04:00
Matthias Clasen
c9a2e4c0a3 font chooser: Add placeholder text to preview entry
This will make things more understandable if an application
sets an empty preview text.
https://bugzilla.gnome.org/show_bug.cgi?id=725551
2015-07-19 16:52:03 -04:00
Matthias Clasen
defc3d8cbc builder-tool: Don't strip border-width
Strictly speaking, this would only have to be special-cased inside
GtkDialog, but lets just skip it altogether.
2015-07-19 13:18:30 -04:00
Matthias Clasen
f881f37789 Fix csd decorations
By accident, commit b9b17c3c2a removed one line
that wasn't unused, but important for hiding close buttons on
dialogs. Bring it back.
2015-07-19 09:59:18 -04:00
Benjamin Otte
04883e72fa window: Set the type hint when it changes, not just on map()
There is no reason to wait until map() to reset a type hint on the GDK
window. Just set it when it changes.
2015-07-19 04:45:25 +02:00
Benjamin Otte
b0ac837271 window: g_object_notify() on type-hint change 2015-07-19 04:45:25 +02:00
Benjamin Otte
38a07cde75 window: Don't update type hint when it didn't change 2015-07-19 04:45:25 +02:00
Benjamin Otte
7a16039c2d window: Allow setting type hint on mapped windows 2015-07-19 04:45:25 +02:00
Benjamin Otte
8a238c7886 window: Don't keep 2 type hints
1. This confuses the code as it's using the old type hint with the new
type hint on GDK window creation

2. It only existed as a workaround for old code that directly accessed
window->type_hint which hasn't been possible since 3.0.
2015-07-19 04:45:25 +02:00
Benjamin Otte
8d3bcb6ef8 combobox: Simplify code
We don't add new children to the child's parent, we add them to ourself.
Because guess who a child's parent is?
2015-07-18 05:39:01 +02:00
Benjamin Otte
d071415d56 combobox: Remove unused header function functionality 2015-07-18 05:18:19 +02:00
Benjamin Otte
1ec7f435d8 combobox: Remove unused argument from private function 2015-07-18 05:18:19 +02:00
Matthias Clasen
c27b90cc79 Fix the build 2015-07-17 20:45:28 -04:00
Matthias Clasen
7fd307f881 Revert "GtkGrid: Add a few NULL checks"
This reverts commit e215db6da2.

We are actually requiring non-NULL out arguments here now.
2015-07-17 20:18:34 -04:00
Matthias Clasen
d8a40c4587 inspector: Avoid a NULL deref
Coverity pointed out that getting a class name requires
dereferencing the pointer, so only don't do it if it is NULL.
2015-07-17 19:52:52 -04:00
Matthias Clasen
0bb2567ff5 GtkWindow: Fix a use-after-free
We were printing a string in a warning after freeing it.
Also, fix an x/y typo that might cause popovers to be
mispositioned.
2015-07-17 19:19:24 -04:00
Matthias Clasen
a9ee745dc1 file chooser: remove an unused GError variable
Pointed out by coverity
2015-07-17 19:19:03 -04:00
Matthias Clasen
2eb39a3b7a inspector: Remove some dead code
Not sure what I was thinking here. Coverity pointed this out.
2015-07-17 18:47:39 -04:00
Matthias Clasen
ff86433ea1 inspector: Avoid a NULL deref 2015-07-17 18:42:24 -04:00
Matthias Clasen
ee43462d74 treeview: Add an explicit return for clarity
I believe that first_column can only ever be NULL here if
last_column is NULL too, in which case we'd exited already.
But coverity doesn't see that, so add an explicit exit.
2015-07-17 18:41:14 -04:00
Matthias Clasen
0ebcc56a77 tooltip: Remove unnecessary checks
Coverity uses these as clues to complain.
2015-07-17 18:40:37 -04:00
Matthias Clasen
361915628d list box: Remove unnecessary checks
Again, coverity takes these as clues to complain.
2015-07-17 18:40:11 -04:00
Matthias Clasen
6a9944cbc5 GtkLabel: Remove an unnecessary check
Coverity has the annoying habit of guessing backwards that
if we check the value here, it might be NULL earlier.
2015-07-17 18:39:14 -04:00
Matthias Clasen
e215db6da2 GtkGrid: Add a few NULL checks
Coverity complained about these.
2015-07-17 18:38:59 -04:00