Commit Graph

27906 Commits

Author SHA1 Message Date
Matthias Clasen
65bb238a3f Add an emoji completion popup
This widget provides entry completion-like functionality
for Emoji codes like 😁 or 💋.
2018-06-03 09:43:28 -04:00
Matthias Clasen
7e9ae85dd4 Export some entry functions privately
This will be used in the following commits.
2018-06-03 09:43:28 -04:00
Matthias Clasen
d0f7364260 emoji: Hide recent section when empty
This is part of https://gitlab.gnome.org/GNOME/gtk/merge_requests/143
by Julian Sperber.
2018-06-03 09:43:28 -04:00
Matthias Clasen
a628e03042 emoji: Improve section scrolling
Leave some space above the section heading when scrolling.

This is a part of https://gitlab.gnome.org/GNOME/gtk/merge_requests/143
by Julian Sperber.
2018-06-03 09:43:28 -04:00
Christian Hergert
d6a29e1b8c treeview: respect expander-size style property
Without enforcement to the expander-size, we can end up rendering icons
rather fuzzy. This uses the expander-size style property to determine
the square for the icon, centered on what was the calculated space for
the expander.
2018-06-01 11:04:45 -04:00
Mohammed Sadiq
1918fefbd4 widget: Fix example code in doc 2018-05-31 18:23:10 +05:30
Jason Zaman
866050d015 gtksocket: Adjust X sizes by scale-factor
X uses unscaled sizes, so they must be scaled properly. Otherwise
GtkSockets end up twice as big as they should be.

Closes: https://bugzilla.gnome.org/show_bug.cgi?id=765327
Signed-off-by: Jason Zaman <jason@perfinion.com>

Close !165
2018-05-30 11:37:12 +01:00
Matthias Clasen
7e0db63601 Merge branch 'gesture-docs' into 'master'
Gesture stuff

See merge request GNOME/gtk!169

(cherry picked from commit 8b24d59cde)

334c7911 gesture: Fix get_last_event() docs
e9765c04 gesture: Fix code snippet
4d2b39d9 gesturemultipress: Don’t fire ::released after ::cancel
2018-05-30 05:59:02 +00:00
Matthias Clasen
38b796d2c3 Merge branch 'gtk-3-24' into 'gtk-3-24'
icontheme: Keep dir_mtimes in order

See merge request GNOME/gtk!162
2018-05-27 15:50:45 +00:00
Daniel Boles
bd82962e21 SpinButton: Fix an obviously wrong arg description
:climb-rate is not about what you get when you single-click on a button,
as this implied: it's what happens if you hold down a button or a key.
Fix the description of @climb_rate to new(), and while here, mention the
key in the blurb of :climb-rate itself.
2018-05-26 01:07:19 +01:00
Daniel Boles
2d12660916 StyleContext: Add a missing apostrophe
(or rather, the right single quote dictated by the HIG, which is
semantically not an apostrophe at all! I will die on this hill.)
2018-05-25 21:10:58 +01:00
Jan Alexander Steffens (heftig)
3bb6670f9c
icontheme: Keep dir_mtimes in order
Don't reverse the order each time we insert a theme. Reverse it only
once, after all themes have been loaded.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1115
2018-05-23 20:09:42 +02:00
Daniel Boles
a7cd20823d StyleContext: Don't advise using invalidate()
It's deprecated. Also, set_screen() is not used/needed in the demo cited
2018-05-21 23:40:11 +01:00
Matthias Clasen
abcc477317 Remove the "without parent" warning
We've had it for a long time, and it hasn't really made
a difference. And I don't think we are prepared to turn
this into a hard error. So just drop it.
2018-05-21 17:17:21 -04:00
Daniel Boles
6b30de9487 Range: Up should only mean ++ if we are a GtkScale
The last round of patches to get the desired direction of value move in
response to scrolls/keypresses on scales had the inadvertent side effect
of giving the opposite direction on scrollbars. Seeing as gtkrange.c is
already a collection of hacks, add another so that fix only holds if the
instance is a GtkScale, since that is what those patches were aimed at.

Close https://gitlab.gnome.org/GNOME/gtk/issues/1065
2018-05-21 20:08:05 +01:00
Daniel Boles
f3fa34e850 ProgressBar: Fix typo in doc comment 2018-05-21 20:08:05 +01:00
Matthias Clasen
f30ecaa22f font chooser: Support font variations
Add sliders for the axes on the tweak page.
2018-05-18 09:31:15 +01:00
Matthias Clasen
6271326718 font chooser: Add properties for font features and language
These can't be returned as part of the font description,
so we need new api for them. For now, this is just readonly
properties. Maybe these should be writable too, eventually.
2018-05-18 09:31:15 +01:00
Matthias Clasen
d60cd1f49f font chooser: Add font features
Populate the tweak page with OpenType font features.
2018-05-18 09:31:15 +01:00
Matthias Clasen
b57e10ad60 font chooser: Add a tweak page 2018-05-18 09:31:15 +01:00
Matthias Clasen
cc35a35752 font chooser: introduce font chooser levels
This is a more systematic approach to reducing the
level of detail in the font chooser.
2018-05-18 09:31:15 +01:00
Matthias Clasen
08f31f8f4a Merge branch '1053-scroll-cursor-gets-left-behind-if-a-child-widget-steals-the-scroll' into 'gtk-3-22'
Resolve "Scroll cursor gets left behind if a child widget steals the scroll"

See merge request GNOME/gtk!134
2018-05-17 15:19:49 +00:00
Matthias Clasen
f2868f5cf3 textview: Don't scroll for pastes in another view
GtkTextView scrolls to the insertion point when the text
buffer signals a paste is done. This is wrong when there
are multiple views on the same buffer, and the paste
happened in another view.

To fix this, flip the handling of the scroll_after_paste
boolean to only be TRUE if we know that we want to scroll.
2018-05-17 11:06:46 +01:00
Benjamin Otte
0caa3dbccf Merge branch '1069-thread-1-glade-received-signal-sigfpe-arithmetic-exception' into 'gtk-3-22'
Resolve "Thread 1 "glade" received signal SIGFPE, Arithmetic exception."

See merge request GNOME/gtk!151
2018-05-16 12:48:46 +00:00
Mohammed Sadiq
d219596212 appchooserdialog: Fix memory leak 2018-05-13 14:51:00 +01:00
Mohammed Sadiq
26b6071db8 appchooserdialog: Don't fire notify::heading twice
The gtk_app_chooser_dialog_set_heading() function do emit
notify::heading. Since the setter simply calls the function,
the setter itself shouldn't emit a notify signal by itself.
2018-05-13 14:51:00 +01:00
Mohammed Sadiq
7886c645c4 textview: Always show select-all button in touch popup
"Select all" action is possible regardless of the text selection state
or if the text is editable or not.
2018-05-13 14:51:00 +01:00
Mohammed Sadiq
a8363a9887 textview: Simplify creating bubble action buttons
Buttons can be created simply with gtk_button_new_from_icon_name().
2018-05-13 14:51:00 +01:00
Juan Pablo Ugarte
87aed887be GtkBox: do not divide by zero on gtk_box_size_allocate_with_center()
https://gitlab.gnome.org/GNOME/gtk/issues/1069
2018-05-12 11:06:37 -03:00
Chun-wei Fan
95e6a0650b gtk/Makefile.am: Fix Visual Studio project generation
We now need the generated sources to be included explicitly in the list
so that they get listed in the project files to be built.
2018-05-11 18:05:46 +08:00
Benjamin Otte
85fa6ba631 gtk: Fix reserved pointers
So gcc stops complaining about unnecessary parenthesis.

Closes #1059
2018-05-07 22:02:56 +02:00
Björn Lindqvist
893fc1dec4 Range: Bin pointless check before emitting signal
In scroll_event(), there is no need to check whether we are realized
before emitting ::change-value, as we must be when receiving an event.

Git-formatted/rebased/cleaned up by Daniel Boles <dboles.src@gmail.com>

Close https://gitlab.gnome.org/GNOME/gtk/issues/292
2018-05-06 19:58:15 +01:00
Daniel Boles
96774e8b5c Menu: cleanups for previous commit and nearby
• #include <math.h> for the new uses of floor()
• Move the new ints and popdown_data into the scopes where they are used
• Don’t pointlessly init other ints to 0 as they always get reassigned
• Burninate gint
2018-05-06 11:49:11 +01:00
Sam Douglas
f443dbe8c1 Menu: Fix broken navigation triangle/hysteresis
This issue was caused when mouse coordinates were changed to floating
point values in commit e8b38fedbd.

This patch floors the event->x_root and event->y_root values when
setting the navigation region, so the previous behaviour is restored.

https://gitlab.gnome.org/GNOME/gtk/issues/450
2018-05-06 11:49:01 +01:00
Daniel Boles
133e8fc03f ScrolledWindow: Unset cursor if child takes scroll
https://gitlab.gnome.org/GNOME/gtk/issues/1053
2018-05-05 11:45:43 +01:00
Matthias Clasen
609cb85f3a emoji chooser: Match search terms better
Use g_str_match_string for better results.

cherry-pick of be2853e5de

https://gitlab.gnome.org/GNOME/gtk/issues/898
2018-05-04 09:45:44 +01:00
Benjamin Otte
33bec5a4fb Merge branch '169-gtktextview-accesses-already-disposed-object-3-22' into 'gtk-3-22'
Resolve "GtkTextView accesses already disposed object" in 3.22

See merge request GNOME/gtk!110
2018-04-30 11:57:14 +00:00
Руслан Ижбулатов
ff47cb0c51 gtkselection: ensure W32 functions used only for W32 displays (v2)
Another instance of a check needed for gdk_win32_selection_add_targets().
2018-04-26 19:46:24 +00:00
Руслан Ижбулатов
b9bb63b1ab gtkselection: ensure W32 functions used only for W32 displays
gdk_win32_selection_add_targets() is for W32 displays only.
2018-04-26 19:36:27 +00:00
Руслан Ижбулатов
9ca3bacddf imcontextsimple: ensure W32 code only runs on W32 displays
gdk_win32_keymap_check_compose() shouldn't be called for
non-W32 displays (i.e. when using broadway or other backends
that could be made to run on Windows).
2018-04-26 17:42:49 +00:00
Adrian Johnson
fff08fa319 Add _gtk_printer_get_hard_margins_for_paper_size()
to retreive paper size specific hard margins and use this
to set the hard margins in the print context.
(modified by Marek Kasik <mkasik@redhat.com>)

https://bugzilla.gnome.org/show_bug.cgi?id=686109
2018-04-25 16:28:07 +02:00
Emmanuele Bassi
dad773b129 build: Do not dist generated files
We expect these files to be regenerated even when building GTK+ from a
release tarball, so there's no point in distributing them if they are
going to be ignored.
2018-04-23 09:13:41 +01:00
Daniel Boles
d35ecbb5a4 themes: Fix a new comment
bah.
2018-04-22 22:21:22 +01:00
Daniel Boles
a3cb26cad7 themes: Fix swapped borders on RTL PathBar buttons
.linked assumes the container is a GtkBox, which is documented as never
flipping children in RTL, so :first-child is always the left child, etc.
GtkBox does that by reordering its CSS nodes when the direction changes.

But most widgets don’t do that, so :first|last-child are 1st/last ADDED
and swap sides in RTL. GtkPathBar is so, and ignoring that in our themes
meant that in RTL, its left/right buttons got each other’s borders. Yuk!

This patch adds the groundwork for supporting widgets like that, via the
%linked_flippable placeholder, and applies that to override buttons in
  filechooser .path-bar.linked > button
so that the correct borders get applied to those buttons when using RTL.

Note that I select only PathBars within a FileChooser because we also
have NautilusPathBar, which also uses widget.path-bar – but *does* flip
its nodes for RTL already, so letting that get affected broke it again!

https://bugzilla.gnome.org/show_bug.cgi?id=772817
2018-04-22 22:05:09 +01:00
Daniel Boles
1ee80fa4c6 MenuButton: popover connects to menu_deactivate_cb
This was missed (even before my recent patches).

https://gitlab.gnome.org/GNOME/gtk/issues/199
2018-04-22 16:29:22 +01:00
Daniel Boles
db85e888c7 MenuButton: Disconnect newly added signal handler
Otherwise, we do stuff we shouldn't, as the failing pipeline showed:
https://gitlab.gnome.org/GNOME/gtk/pipelines/9431

https://gitlab.gnome.org/GNOME/gtk/issues/199
2018-04-22 16:29:20 +01:00
Daniel Boles
2ba118c961 MenuButton: Clarify NULL popup/over/menu/model doc 2018-04-22 16:11:01 +01:00
Daniel Boles
476d3ea170 MenuButton: Drop ref to Popover on its ::destroy
Otherwise, if the Popover is destroyed before the MenuButton, the latter
still had a non-NULL but invalid instance and tried to use it in dispose

https://gitlab.gnome.org/GNOME/gtk/issues/199
2018-04-22 16:11:01 +01:00
Daniel Boles
2c2ea83333 Stock: Emphasise deprecation; explain alternatives
A user in #gtk+ was confused what to do instead of creating a Button via
gtk_button_new_from_stock(). Our docs could stand to be clearer on this
point; it only costs a few lines. So, link from that constructor* to the
GtkStock doc, and add a banner there telling folk they shouldn’t use it.

* not that most [of these][links] even work right now…
2018-04-22 16:11:01 +01:00
Daniel Boles
c2672b4f05 Entry: Show optional style classes in node diagram 2018-04-22 16:11:01 +01:00
Juan Pablo Ugarte
9ae6d09234 a11y/ScrolledWin|IconView: Connect signals safely
Use g_signal_connect_data() instead of g_signal_connect_object()
to make sure the callback gets disconnected when the data object
is destroyed. This avoids problems in garbage-collected bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=789215
2018-04-22 16:11:01 +01:00
Matthias Clasen
21fddc3994 printing: Be more careful when deserializing
The GVariant we are getting here might not be coming
from GTK+, but rather from some other source. Best to
be forgiving and deal with missing data without crashing.

This was causing the GTK+ portal backends to crash on
print requests from Qt.
2018-04-20 17:57:08 -04:00
Emmanuele Bassi
ecc612b1a2 Merge branch 'stack-set-name-guard' into 'gtk-3-22'
stack: protect set_visible_child_name from NULL stack

See merge request GNOME/gtk!117
2018-04-19 08:38:09 +00:00
Emmanuele Bassi
1945c7a1a8 Merge branch 'gtkplacesview-finalization-fixes-master' into 'master'
Gtkplacesview finalization fixes

See merge request GNOME/gtk!119

(cherry picked from commit e30176a522)

f9452957 gtkplacesview: unset entry_pulse_timeout_id before removing it
4900c3eb gtkplacesview: disconnect from server list monitor changes on destroy
2018-04-19 08:27:27 +00:00
Marco Trevisan (Treviño)
2ee5aee4a9 stack: protect set_visible_child_name from NULL stack
Return with error if gtk_stack_set_visible_child_name is called
with NULL parameter
2018-04-18 21:02:42 -05:00
Daniel Boles
cfbbcf5fc4 UIManager: Document deprecation; link replacements
Close https://gitlab.gnome.org/GNOME/gtk/issues/193
2018-04-18 23:31:47 +01:00
Daniel Boles
7ff9222600 Range: Use should_invert_move() to scroll value
This fixes RTL and/or :inverted Ranges responding to a horizontal scroll
by moving the value/slider button in the opposite direction... See prev.

https://bugzilla.gnome.org/show_bug.cgi?id=791802
2018-04-18 18:33:56 +01:00
Daniel Boles
9b011081c5 Range: Add should_invert_move() for scrolls & keys
This will be used in subsequent commits to fix the sign by which the
value is changed in response to directional scroll or keypress events.

The idea is: you have a movement to make – in the form of a delta that
follows widget directions, i.e. −1 means left or up, +1 means right or
down – and you want to know whether that delta needs to be inverted in
order to produce the intuitively expected directional change of :value.

The existing should_invert() is not sufficient: it just determines
whether to invert visually, but we need more nuance than that for input.

To answer that – while not doubling up the work for scrolls and keys – I
add a helper should_invert_move(), which considers other relevant state:

 • A parallel movement on priv->orientation should just use the existing
   should_invert(), which already worked OK for this case (not others).

 • Movements on the other orientation now depend on priv->orientation:

    ◦ For a horizontal Range, always invert, so up (i.e. −ve in terms of
      widget coords) always means increase value & vice-versa. This was
      done in get_wheel_delta(), but move it here for use with keys too.

    ◦ For a vertical Range, ignore :invert as it’s only relevant to the
      parallel orientation. Do not care about text direction here either
      as RTL locales do not invert number lines, Cartesian plots, etc.

This returns TRUE if the delta should be inverted before applying to the
value, and we can now use this function in both scroll and key handlers.

https://bugzilla.gnome.org/show_bug.cgi?id=407242
https://bugzilla.gnome.org/show_bug.cgi?id=791802
2018-04-17 21:44:16 +01:00
Daniel Boles
0c46d94ec3 Menu|Item: Fix FIXME re non-const interned strings
These are members of the private struct, so it hurts no one to fix this.
2018-04-17 21:07:18 +01:00
Daniel Boles
a7a4a459ea Menu: Sanitise @torn_off gboolean in public API 2018-04-17 21:07:18 +01:00
Daniel Boles
30405ee68c Menu: Remove redundant typecheck in private func
Everything that calls this already ensured we are a valid GtkMenu.
2018-04-17 21:07:18 +01:00
Daniel Boles
b5cc0d8fcd Menu: Document/annotate nullability of 2 API args
.set_accel_path(): Use (nullable) instead of (allow-none), and explain
                   what a NULL means (albeit very briefly)

.set_title(): Annotate @title as (nullable), and explain NULL’s meaning
2018-04-17 21:07:18 +01:00
Daniel Boles
a53bdcd222 Menu: Typecheck AccelGroup passed via public API 2018-04-17 21:07:18 +01:00
Daniel Boles
1d1405edd8 Menu: Typecheck before dereferencing to get ->priv 2018-04-17 21:07:18 +01:00
Daniel Boles
8e24626c49 MenuShell: Sanitise take_focus bool via public API
We store in priv then compare it later, so better make sure it’s 0 or 1.
2018-04-17 21:07:18 +01:00
Daniel Boles
bcc539ca07 MenuShell: Typecheck the instance @ select_first()
since this is public API and therefore might get junk passed to it.
2018-04-17 21:07:18 +01:00
Daniel Boles
7f846ce7d8 CellRenderer: Link to CellEditable.start_editing()
...from CellRenderer::start-editing, to point people in the direction of
info about the lifecycle of the Editable and how to do generic setup.

https://gitlab.gnome.org/GNOME/gtk/issues/154
2018-04-17 18:28:43 +01:00
Daniel Boles
2e21a2256e CellRenderer: Clarify doc of .start_editing()
Drop the line copied from .activate(), replace it with a description of
what this method actually does, and explain what a NULL result means.

https://gitlab.gnome.org/GNOME/gtk/issues/154
2018-04-17 18:28:43 +01:00
Daniel Boles
bbcfc261e0 CellRenderer: Entry is not the only CellEditable
so link to GtkCellEditable and note that GtkEntry is just one example.
2018-04-17 18:28:43 +01:00
Daniel Boles
4ccbe10571 CellRenderer|Editable: Don't @See_also subclasses
The documentation knows that from the inheritance hierarchy, without us
having to manually duplicate that info here. Link to each other instead.
2018-04-17 18:28:43 +01:00
Daniel Boles
b48fbcbb7c CellEditable: Clarify doc on lifecycle of editable
* Note in the intro that we're really thinking about temporary widgets
* Mention a gotcha regarding GtkEntry and how ::focus-out stops editing
* Give some examples of what you'd want to do in ::editing-done
* Be a bit more precise about what ::remove-widget represents
* Summarise the lifecycle between Renderer/Editable in .start_editing()
* Emphasise again there that this should be viewed as a temporary widget

https://gitlab.gnome.org/GNOME/gtk/issues/154
2018-04-17 18:28:43 +01:00
Daniel Boles
c2da6fc299 CellEditable: Move arg description to right place
Move it from the body to the argument line, and while there, update
the deprecated (allow-none) to (nullable).
2018-04-17 18:28:43 +01:00
Daniel Boles
2ba6dcbce5 CellEditable: Fix grammar error in doc synopsis 2018-04-17 18:28:43 +01:00
Marek Kasik
8da5111edd TextView: Don't access already disposed text mark
Instead of asking of TextMark for its buffer,
let's reference also the buffer in the SelectionData.

Closes #169
2018-04-17 16:07:05 +02:00
Benjamin Otte
b47bdda271 widget: Add a frameclock_connected boolean
... and use it to not connect anything to the frameclock if it isn't
set.

This gets around the problem that the frame clock is disconnected before
GtkWidgetClass.unrealize() is called but the widget is still marked as
realized and the frame clock is available during the vfunc, which makes
calls like gtk_widget_queue_resize() reconnect to the frame clock.

Closes #168
2018-04-11 18:11:39 +02:00
Benjamin Otte
5a0759bc1b colorutils: Remove unused macro 2018-04-11 03:11:22 +02:00
Daniel Boles
5ee381a596 AccelGroup: Remove @See_also of deleted function
gtk_item_factory_new() is not a thing that exists.

Also, maybe the lack of space after the colon was what stopped the link
from rendering.
2018-04-09 19:43:45 +01:00
Daniel Boles
b2caaaa3f9 Revert "ModelButton: Properly update indicator on set_role"
This reverts commit ba307aa35e.

This is not needed; see the previous commit for the explanation.

https://gitlab.gnome.org/GNOME/gtk/issues/163#note_94842
2018-04-08 18:49:22 +01:00
Daniel Boles
e52aa73b36 ModelButton: Use WARN_INVALID_PROPERTY, not assert
Do the same thing we do everywhere else for invalid properties.
2018-04-08 18:39:53 +01:00
Daniel Boles
2d415d9354 ModelButton: Fix type Wether => Whether 2018-04-08 17:13:33 +01:00
Mohammed Sadiq
79d8c9dff0 listbox: Fix signal name in documentation 2018-04-08 13:46:33 +01:00
Daniel Boles
ba307aa35e ModelButton: Properly update indicator on set_role
Redrawing is insufficient: when :role changes to/from NORMAL, the
indicator gadget reallocates, but we didn't reflect that in the widget.

https://gitlab.gnome.org/GNOME/gtk/issues/163
2018-04-08 13:16:30 +01:00
Daniel Boles
fa520c5769 ModelButton: Protect against nonsensical gbooleans
the same way we do normally.
2018-04-08 13:16:30 +01:00
Benjamin Otte
b0b2992165 Merge branch 'textview-delete' into 'gtk-3-22'
gtktextviewaccessible: update cursor position after text suppression

See merge request GNOME/gtk!101
2018-04-04 18:19:05 +00:00
Samuel Thibault
fa6994d033 gtktextviewaccessible: update cursor position after text suppression
delete_range_cb is set to be called before the text suppression done by
the gtktextlayout (otherwise it does not work properly). But at that
point the cursor position is not yet up to date.  We thus need to move
the accessibility cursor notification to after the actual text
suppression, by using another callback.

This fixes cursor position in brltty screen reading.
2018-04-04 18:22:16 +02:00
Samuel Thibault
209f908a03 gtkentryaccessible: Fix text-changed::delete length
The second parameter of the text-changed::delete event is to be the length,
not the end position.  This fixes spurious text removals in brltty
screen reading.
2018-04-04 17:56:38 +02:00
Daniel Boles
46dac1aba4 GLArea: Remove wrong transfer annotation on new()
Like other widgets, this returns a floating reference, so
(transfer full) is wrong. Just omit the annotation as others do,
thus implying (transfer none).

Close https://gitlab.gnome.org/GNOME/gtk/issues/156
2018-04-04 12:04:35 +01:00
Daniel Boles
e42d8598ca ProgressBar: Drop leftover "superimposed" mention
This was missed from the commit that dropped other mentions to the
previous ability to superimpose text.

https://bugzilla.gnome.org/show_bug.cgi?id=748784
2018-03-31 12:27:21 +01:00
Nelson Benítez León
7a11fcf054 appchooserwidget: search text using g_str_match_string()
so we match on diacritics (eg. accented letters) and also
search on text tokens. As a plus we also reduce code size.

https://bugzilla.gnome.org/show_bug.cgi?id=745128
2018-03-31 13:32:42 +05:00
Daniel Boles
154fa9817d themes: Make disabled Expander arrow look disabled
If GtkExpander:sensitive was FALSE, the arrow still got the normal fg
colour, which made it look clickable, in contrast to the adjacent label.
Fix this by adding selectors to catch the applicable :disabled states.

Note: Needing these may indicate an oops in generic styles elsewhere,
but I couldn’t see any, so let’s just get it looking right for now.

https://gitlab.gnome.org/GNOME/gtk/issues/146
2018-03-29 21:00:00 +01:00
Daniel Boles
6e8cc589f2 emojichooser.ui: Reuse headings as button tooltips
https://bugzilla.gnome.org/show_bug.cgi?id=792632
2018-03-29 18:42:39 +01:00
Tomasz Miąsko
56d44fd10c Widget: Fix doc of default ::keynav-failed handler
https://bugzilla.gnome.org/show_bug.cgi?id=793089
2018-03-29 18:29:51 +01:00
Daniel Boles
0102e0f914 HighContrast: Honour .monospace set by GtkTextView
Copy the line that sets a monospace family from Adwaita (same place too)

noticed at https://gitlab.gnome.org/GNOME/gtk/issues/141#note_91610
2018-03-29 18:16:57 +01:00
Daniel Boles
dbaaa701ad HighContrast: Regenerate CSS missing from !50
https://gitlab.gnome.org/GNOME/gtk/merge_requests/50 forgot this.
2018-03-22 21:01:08 +00:00
Nikita Churaev
ef3fe9ead3 theme: Be more selective when adding margins to toolbar items
Only add margins to direct children of toolbar items, this fixes the
gaps between linked buttons inside custom toolbar items.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/66
2018-03-22 20:59:15 +00:00
Matthias Clasen
b88bffac23 Merge branch 'wip/carlosg/fix-issue-114' into 'gtk-3-22'
Fix issue #114

See merge request GNOME/gtk!73
2018-03-20 15:31:49 +00:00
Peter Bloomfield
6e2d14037c gtkimmodule: make match_backend() query
…the wayland registry.

Wnen _gtk_im_module_get_default_context_id calls
match_backend (context_id) and the default GdkDisplay
is wayland, match_backend() should return TRUE only if
gdk_wayland_display_query_registry (display, "gtk_text_input_manager")
returns TRUE.
2018-03-20 15:56:53 +01:00
Christoph Reiter
d65a4c2e0a gtkstylecontext: guard against gtk_css_widget_node_get_widget() returning NULL in more places
When the widget gets finalized it clears the widgetnode and gtk_css_widget_node_get_widget
returns NULL. Guard against gtk_css_widget_node_get_widget() returning NULL like in other
places.

See https://gitlab.gnome.org/GNOME/pygobject/issues/28#note_82862
2018-03-19 18:21:25 +01:00
Daniel Boles
f4bb394d60 _common.scss: Use : for properties in new comments
This is cosmetic and unlikely to have confused anyone, but still
2018-03-19 14:27:28 +00:00
Daniel Boles
e0befe02fa Merge branch 'searchbar-double-border-fix' into 'gtk-3-22'
Fix the double border in windows with a search bar.

See merge request GNOME/gtk!50
2018-03-19 14:26:11 +00:00
Timm Bäder
eb01ba8573 widget: Only print allocation warnings with --enable-debug
i.e. if G_ENABLE_CONSISTENCY_CHECKS is defined. This makes sense,
considering that this warning is about consistency of internal widget
state.
2018-03-17 13:15:33 +01:00
Daniel Boles
7fd9f2d31e Notebook: Don’t show raw underline/markup in popup
If @menu_label == NULL, we create a default page->menu_label. This took
@tab_label.get_label() and passed that to page->menu_label.set_text().
This is wrong because we set the plain text of the menu_label from the
rich text of @tab_label. So, if @tab_label used mnemonics or markup, our
menu_label got the raw underline or markup tags shown in it as raw text.

As we call set_text() on the menu Label, the fix is to be symmetric: use
@tab_label’s get_text() as source, as that strips underlines and markup.

It’s not worth making the default Label ‘inherit’ :use-underline/markup;
that’s a slippery slope, and users wanting such things can just create a
fully fledged GtkLabel to pass as @menu_label to suppress the default.

https://bugzilla.gnome.org/show_bug.cgi?id=705509
2018-03-16 22:32:50 +00:00
Matthias Clasen
cac2845bd6 Merge branch 'wip/filechooser-non-default-display-gtk3' into 'gtk-3-22'
Fix filechooser dialog using non default display (gtk3)

See merge request GNOME/gtk!59
2018-03-15 17:47:15 +00:00
Daniel Boles
0a0323813e SpinButton: Redraw +/- buttons after :wrap changes
Otherwise, the + or - button might change sensitivity based on whether
it can be used to wrap, but without ensuring we update its state, the
ability to :wrap isn't reflected until something else triggers a draw.

https://gitlab.gnome.org/GNOME/gtk/issues/88
2018-03-14 23:09:48 +00:00
Jonas Ådahl
ba83a2c46b entrycompletion: Realize popup after setting screen
Realization is done as a side effect of calling
_gtk_entry_completion_resize_popup(), but if this is done before the
GdkScreen of the GtkWindow is set up correctly, it may result in the
widget being unrealized when the screen is updated. This may happen
when the file dialog parent window is not using the default GdkDisplay.

To avoid this issue, realize the popup after the screen has been
properly set up.

Fixes #83 in gtk3
2018-03-14 11:57:00 +08:00
Daniel Boles
0f3396d742 FileChooserWidget: Fix leaks in .get_subtitle()
Now that subtitle's default value "Searching" for OPERATION_MODE_SEARCH
is duplicated as it should be, we cannot reassign other strings to it
anymore, as that resulted in the original dupe of "Searching" leaking.

Fix this by only assigning the dup'd "Searching" after trying to get
more specific values, not before. We therefore need to set it to NULL
during its declaration, and that means we needn't in the final else.
2018-03-13 00:19:51 +00:00
Daniel Boles
9d8fadee97 FileChooserWidget: Avoid crash freeing static str
Having a FileChooserDialog in location-entry mode then pressing
<primary>f to move to search mode would crash with an invalid free().

In that case, FileChooserWidget.get_subtitle() returned a static string
straight from gettext. This crashed when the GBinding from :subtitle to
FileChooserDialog’s HeaderBar:subtitle shortly tried to free the string.

Fix by duplicating the string before returning it, like all other paths.

https://bugzilla.gnome.org/show_bug.cgi?id=791004
2018-03-12 23:06:21 +00:00
Daniel Boles
f08eeecae6 ListBox: Avoid ::row-activated/Row::activate ambig
…uity, by adding a doc comment to Row::activate explaining what it does
and why it is probably not what the user reading that is looking for.

https://bugzilla.gnome.org/show_bug.cgi?id=794008
2018-03-12 16:12:13 +00:00
Daniel Boles
f7a47a632c InfoBar: Be most specific in new Since annotations 2018-03-12 16:12:13 +00:00
Timm Bäder
e9d84e2653 infobar: Add :revealed property
https://bugzilla.gnome.org/show_bug.cgi?id=710888
2018-03-12 15:17:24 +00:00
Timm Bäder
45aa018839 infobar: Keep GParamSpecs around
So we can use them in notify_by_pspec

https://bugzilla.gnome.org/show_bug.cgi?id=710888
2018-03-12 15:17:18 +00:00
Timm Bäder
04ff9b58f1 emojichooser: Only measure reference emoji once
Doing that once for every emoji is pretty slow and unnecessary as the
width does not change.
2018-03-12 14:40:02 +00:00
Nikita Churaev
4e2f59ad23 Tidy up the search bar double border fix
Match "box" instead of "*", as already done for the search bar GTK4 and
for the action box in GTK3. Also clarify which widget property is
causing the margin which needs to be undone.
2018-03-09 22:13:01 +03:00
Nikita Churaev
b202c44fd8 Fix double borders in windows with a search bar in HighContrast 2018-03-08 00:57:59 +03:00
Nikita Churaev
d465d790f0 Fix the double border in windows with a search bar.
Includes applications like GNOME Software and GNOME Documents. The
search bar is a composite widget with a revealer inside it, and when the
content of the revealer is hidden, the border lingers. Changed the CSS
to add style to the content of the revealer instead of the search bar
widget itself.
2018-03-07 08:54:11 +03:00
Timm Bäder
46828f8e0a expander: fix sizes in resize_toplevel
We can't use gtk_widget_get_allocation for either non-anchored widgets
(which happens with the child widget when the expander is unexpanded)
nor toplevel windows since that will include the window decorations.

Fixes #70 in gtk3
2018-03-06 18:11:34 +01:00
Juan Pablo Ugarte
e36b629c36 GtkCssImageSurface: set device scale for cache surface
Closes #63
2018-03-05 14:47:00 -03:00
Tomasz Miąsko
91498c7db3 Include C headers in introspection file.
Include gtk/gtk.h and gtk/gtk-a11y.h unconditionally,
and gtk/gtkx.h when building with X11. Ensures that
introspection data contains complete set required
headers, which is useful when generating C code based
on introspection data.

Diff for generated gir (when using X11):

```diff
   <include name="xlib" version="2.0"/>
   <package name="gtk+-3.0"/>
+  <c:include name="gtk/gtk-a11y.h"/>
+  <c:include name="gtk/gtk.h"/>
+  <c:include name="gtk/gtkx.h"/>
   <namespace name="Gtk"
              version="3.0"
```

Fixes issue #56.
2018-03-04 15:36:24 +01:00
Tomasz Miąsko
3000384b90 a11y: Include gtkstackaccessible.h in gtk-a11y.h 2018-03-03 20:11:14 +01:00
Timm Bäder
f0d5b9561b Revert "file chooser: Allow activating without double-click"
This reverts commit fb0a13b7f0.

It's already reverted in master via
c8a6a1138b, so let's not leave subtle
behavior changes that would make a gtk3->gtk4 migration. And just like
the commit message of the revert already mentions: it didn't really make
anybody happy anyway.
2018-03-01 19:47:11 +01:00
Timm Bäder
b13362b369 separatormenuitem: Don't create label widget in get_label
Calling gtk_menu_item_get_label on a GtkSeparatorMenuItem would
otherwise create a GtkLabel child, increasing the vertical size request
to that of the child label.
2018-03-01 19:33:25 +01:00
Christoph Reiter
342aee304a macos: export gdk_quartz_drag_source_context()
It's used in the gtk dnd code but not exported in gdk.
Append a "_libgtk_only" suffix as with other internal exports and
export the symbol.

See #32
2018-03-01 14:35:05 +01:00
Matthias Clasen
92711d7f79 Merge branch 'gtk-debug-flags-with-open-display' into 'gtk-3-22'
gtk_init: Fix debug flags handling when a display is already open

See merge request GNOME/gtk!26
2018-02-19 17:55:12 +00:00
Christoph Reiter
49e3c10575 Merge branch 'gtk-3-22' into 'gtk-3-22'
Fix annotation for gtk_tree_view_is_blank_at_pos()

See merge request GNOME/gtk!12
2018-02-18 10:45:52 +00:00
Christoph Reiter
8e540f2f62 gtk_init: Fix debug flags handling when a display is already open
In PyGObject gdk_init() is called before gtk_init() and thus there is
already a default display open when gtk_init() is called.
The code assigning the display to the debug_flags struct gets only
called when the default display changes, which never happens
when there already is one. As a result GTK_DEBUG=interactive
doesn't do anyting with Python apps.

This makes it call the change callback in case a display is already
there.

See https://gitlab.gnome.org/GNOME/pygobject/issues/166
2018-02-18 10:34:52 +01:00
John Lindgren
5aa939dc93 Fix incorrect optimization in find_builtin_icon().
When we found an icon with exactly the requested size, we'd stop
searching immediately (good), but we'd neglect to set the returned
min_difference to 0 (bad).  This caused theme_lookup_icon() to
prefer other, potentially much worse, matches over the exact one.
2018-02-17 22:03:27 -05:00
Emmanuele Bassi
bd13a5a5ce docs: Add proper deprecation text for GtkStatusIcon
We link to the HowDoI for GNotification in the class description, but we
should be more verbose in the deprecation notices for each function of
the GtkStatusIcon class.

https://bugzilla.gnome.org/show_bug.cgi?id=743975
2018-02-17 17:30:54 -05:00
Carlos Soriano
fb79115314 gtkplacessidebar: Rename favorites to starred
To have more consistency in the name. The same was done in Nautilus in
commit 27b039b37c.
2018-02-15 10:16:10 +01:00
Carlos Garnacho
e8bffe0c56 modules: Add wayland IM implementation
This IM context implementation goes through the gtk-text-input protocol,
leaving up to the compositor the actual interaction with IM engines. If
the protocol is not offered by the compositor, GTK+ will fallback to the
IMs as specified through GtkSettings.
2018-02-14 14:58:06 +01:00
Gniourf
3274f3a6cc Fix annotation for gtk_tree_view_is_blank_at_pos()
The annotation (allow-none) is wrong. Since
gtk_tree_view_is_blank_at_pos() also calls
gtk_tree_view_get_path_at_pos(), the same fields should have the same
annotations.
2018-02-14 13:51:22 +01:00
Emmanuele Bassi
f82a6421f4 Add missing private header to the build
Closes: #26

        https://bugzilla.gnome.org/show_bug.cgi?id=793442
2018-02-14 10:36:24 +00:00
Rafal Luzynski
cbf118c285 calendar: Use the new "%OB" format if supported
Due to the recent changes introduced in glibc 2.27 "%OB" is the
correct format to obtain a month name as used in the calendar
header.  The same rule has been working in BSD family (including
OS X) since 1990s.  This simple hack checks whether "%OB" is supported
at runtime and uses it if it is, falls back to the old "%B" otherwise.

Closes: #9
2018-02-12 22:09:28 +01:00
Emmanuele Bassi
12913d1a35 docs: Use the appropriate deprecation for properties
The GtkFontButton:font-name property has been deprecated, but it's using
a non-standard annotation in its documentation.
2018-02-11 23:32:42 +00:00
Emmanuele Bassi
ade22d00f2 gtk: Cast g_object_ref() to the right type
In GLib 2.56, g_object_ref() will check that you're assigning the return
value to a variable of the same type you're passing in.
2018-02-11 23:32:42 +00:00
Emmanuele Bassi
c03ce68c38 Do not use deprecated error trap API
Use the X11-specific API instead.
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
4e5ef1a377 toolbar: Use gdk_display_flush()
Instead of the deprecated gdk_flush().
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
81c0e7af0e selection: Disable deprecation warnings
We are using a lot of deprecated API, and we know it.

Since the selection code is going to be replaced in GTK 4.0, there's no
real point in keeping the warnings enabled in 3.22.
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
3067fb8c24 placessidebar: Move declaration inside conditional block
The `sidebar` variable is only used by the conditional block for
libcloudprovider.
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
382d6c1bcb Ignore deprecations for gdk_flush()
When terminating the main loop, we're really trying to flush all
GdkDisplay connections, so it's actually a legitimate internal use
case.
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
9c6ae95ece accelgroup: Do not use deprecated API
Use gdk_keymap_get_for_display() with the default display, instead of
the deprecated gdk_keymap_get_default().
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
855e4cb88e deprecated: Cast g_object_ref() to the right type
In GLib 2.56, g_object_ref() will check that you're assigning the return
value to a variable of the same type you're passing in.
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
c229716796 a11y: Cast g_object_ref() to the right type
In GLib 2.56, g_object_ref() will check that you're assigning the return
value to a variable of the same type you're passing in.
2018-02-11 23:28:50 +00:00
Alban Browaeys
255e2dd704 Fix overzalous method annotations for drag and drop
Functional revert of commit 9c4892f291.

Fixes introspection scanner warnings like:

  Warning: Gtk: gtk_drag_finish: Methods must belong to the same
  namespace as the class they belong to

That is, the gtk_drag_* functions cannot be methods as they have a
"GdkDragContext" as the instance parameter, and that is not a valid
type for the Gtk namespace.

This is not an introspected ABI change, as the generated introspection
data ignores the annotation.

Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=692152
2018-02-11 23:28:50 +00:00
Emmanuele Bassi
4f962c6dbf Add AGPL3-only licence to GtkAboutDialog
https://bugzilla.gnome.org/show_bug.cgi?id=792793
2018-02-11 14:22:09 +00:00
Benjamin Otte
63f534f4b3 cssprovider: Only free bytes when they exist 2018-02-05 18:58:54 +01:00
Benjamin Otte
6ff326a82f css: Add a workaround for gtk_widget_override_font()
The problem here is that the CSS machinery expects font sizes to be in
pixels, but gtk_widget_override_font() provides a value in point and the
CSS machinery has no ability to query the DPI and convert.

This patch changes the dconversion DPI we use from a hardcoded 96 to the
default screen's DPI, which should work better than before.
This will of course not listen to changes in the default screen's DPI,
but that shouldn't be a problem.

People who want to workaround this should use gtk_widget_override_font()
with a font that has an absolute size set via
pango_font_description_set_absolute_size (size * PANGO_SCALE *
                                          gdk_screen_get_resolution (screen));

https://bugzilla.gnome.org/show_bug.cgi?id=774248
2018-02-05 18:49:10 +01:00
Matthias Clasen
9b69fe7a7e iconview: Fix a problem with the previous change
After commit ffef28a7e8,
gtk-icon-browser was spewing critical warnings when
changing sections. Avoid that by respecting the return
value of gtk_tree_model_get_iter.
2018-01-31 18:37:19 +01:00
Timm Bäder
136b88534c menu: Guard against NULL toplevel
This can happen, as indicated by GtkMenu explicitly connecting to
::destroy of its toplevel window. Do the same thing in GtkComboBox.
2018-01-26 11:37:31 +01:00
Daniel Boles
b8e2430486 Widget: Don’t call reset() on NULL EventController
GtkGesture is a GtkEventController. gtk_event_controller_dispose() calls
_gtk_widget_remove_controller(). That NULLs the pointer-to-Controller in
our EventControllerData but does not delete said ECData from our GList.

Subsequently, if that same Widget gets unparent()ed, that method calls
unset_state_flags(), which leads to doing reset_controllers() if we are
insensitive. Now, unlike most most other loops over the GList of ECData,
reset_controllers() does not skip nodes whose pointer-to-Controller is
NULL. So, we call gtk_event_controller_reset(NULL) and get a CRITICAL.

This surfaced in a gtkmm program. The Gesture is destroyed before the
Widget. The Widget then gets dispose()d, which calls unparent()… boom.
I didn’t find an MCVE yet but would hope this logic is correct anyway:

The simplest fix is to make the loop in gtk_widget_reset_controllers()
skip GList nodes with a NULL Controller pointer, like most other such
loops, so we avoid passing the NULL to gtk_event_controller_reset().

In other, live cases, _gtk_widget_run_controllers() loops over the GList
and removes/frees nodes having NULL Controllers, so that should suffice.
But this clearly was not getting a chance to happen in the failing case.

https://bugzilla.gnome.org/show_bug.cgi?id=792624
2018-01-22 19:09:50 +00:00
Juan Pablo Ugarte
beed1f660e GtkGestureMultiPress: check event state before emiting released signal
Fix bug 771986 "Inconsistent 'row-activated' signal emission before \
drag'n'drop, 'activate-on-single-click'=TRUE, 'reorderable'=TRUE"
2018-01-22 15:42:54 +01:00
Matthias Clasen
5ab5a5166e iconview: Fix updates with filter models
Filter models rely on views taking a ref on every node
they care about. GtkIconView was not doing that. Amazingly,
this has never shown up in a bug so far, until I spotted
the fallout in gnome-font-viewer.
2018-01-19 16:06:01 +01:00
Matthias Clasen
ef72f3cbce font chooser: Fix property notification
We must notify the font and font-desc properties when the
list selection changes, and return NULL values for them
when there is no selection in the list.
2018-01-18 19:58:27 -05:00
Matthias Clasen
5f675181ce font chooser dialog: Improve sensitivity handling
Enable the select button when a font is selected, as it should be.
2018-01-18 19:48:12 -05:00
Matthias Clasen
e10f616065 font chooser: Small revision of the UI
Show only the font names in the list, in their own
font, in order to make the list less noisy.
2018-01-18 19:36:56 -05:00
Chris Lamb
6b85162f43 gtk/queryimmodules.c: Make the output deterministic.
Whilst working on the Reproducible Builds effort [0], we noticed that
queryimmodules generates non-reproducible output as it iterates over the
filesystem without sorting.

Patch attached.

 [0] https://reproducible-builds.org/

Signed-off-by: Chris Lamb <lamby@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=786528
2018-01-16 22:39:03 -05:00
Matthias Clasen
53bc2566b3 tree model sort: Fix set_sort_column
We were failing to change the sort order for the
default sort column in some cases. Fix that, and
add a testcase for this issue.

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

Add a testcase for the previous fix
2018-01-16 18:19:10 -05:00
Matthias Clasen
e1aeb73a62 tree model sort: Fix initial default sort func
gtk_tree_sortable_has_default_sort_func should return
FALSE initially.
2018-01-16 18:19:01 -05:00
Matthias Clasen
9e3b814580 emoji: Skip overly wide fallback rendering
Some emoji fonts (such as Emoji One), render Emoji sequences
such as some of the family variations using multiple individual
glyphs. This rendering is too wide and breaks our grid layout.
Therefore, we will just skip any sequence whose rendering is
more than twice as wide as a simple smiley.
2018-01-15 08:21:52 -05:00
Daniel Boles
b5e4a9d716 HeaderBar: Explain use in conjunction w/ GtkWindow
After hinting how good GtkHeaderBar is for GtkWindow, let’s link to
the latter and indicate how users can make the two work together.
2018-01-12 23:12:19 +00:00
Daniel Boles
fe220402cb Window: Mention GtkHeaderBar in set_titlebar() doc
This is the typical thing passed here and what most users want, so we
should mention it here, rather than requiring users to figure it out.
2018-01-12 23:12:19 +00:00
Daniel Boles
e75d91e7b1 Window: Clarify resize() doc about titlebar widget
Clarify the reference to HeaderBar, as it applies to any custom title
widget; HeaderBar is only the most common one used. Also, fix a typo.
2018-01-12 23:03:44 +00:00
Juan Pablo Ugarte
2a8e1745cf GtkCssImageSurface: add cache for the last drawn size.
Keep a copy of the scaled image to speed up rendering multiple times
the image at the same size.
2018-01-09 11:29:10 -03:00
Daniel Boles
8ed4b48b4c Adwaita: Fix typo lenght => length in SASS 2018-01-09 09:49:24 +00:00
Daniel Boles
a9499dbe48 ScrolledWindow: add() before remove() in snippet
We can't remove() a child widget that wasn't already add()ed, of course.
2018-01-07 16:47:41 +00:00
Matthias Clasen
081488f8f2 file button: Don't leak rows
The file chooser button manually manages the memory of
data in its model, so it needs to explicitly free the
rows.
2018-01-07 16:38:42 +00:00
Timm Bäder
d15fbee353 Make a few more code samples compile 2018-01-07 16:38:42 +00:00
Timm Bäder
fda98ba562 entry: Remove some questionable code examples 2018-01-07 16:38:41 +00:00
Timm Bäder
c006c2fdbc widget: Make all code snippets compile 2018-01-07 16:38:41 +00:00
Timm Bäder
6e197ffac9 liststore: Make a code snippet compile 2018-01-07 16:38:41 +00:00
Timm Bäder
e00de3814e searchbar: Make a code snippet compile 2018-01-07 16:38:41 +00:00
Timm Bäder
a443b525c3 menuitem: Make a code snippet compile 2018-01-07 16:38:41 +00:00
Timm Bäder
456ca1062b expander: Make a code snippet compile 2018-01-07 16:38:41 +00:00
Timm Bäder
e5240de5bc treeviewcolumn: Make a code snippet compile 2018-01-07 16:38:41 +00:00
Timm Bäder
a65ae5fb40 notebook: Make a code snippet compile 2018-01-07 16:38:41 +00:00
Timm Bäder
af1d5362ab scrolledwindow: Fix code sample compilation 2018-01-07 16:38:41 +00:00
Matthias Clasen
9cf48ec3f8 Drop an unused enum value
We haven't had a GtkWindow::frame-event since the
linux-fb backends demise.
2018-01-07 16:38:41 +00:00
Rico Tzschichholz
6f26d0dc0c filechooser: Add missing array annotations to add_choice() 2018-01-06 09:40:39 +01:00
Rico Tzschichholz
43433f3ccd iconview: Prevent ownership transfer of cell out-param in get_item_at_pos() 2018-01-06 09:40:26 +01:00
Arnaud Bonatti
cb935d947c Make GtkListBoxRow GtkActionable.
https://bugzilla.gnome.org/show_bug.cgi?id=741633
2018-01-02 17:53:20 -08:00
Arnaud Rebillout
1e7982212f gtk: remove non-breaking space, probably there by mistake
Signed-off-by: Arnaud Rebillout <elboulangero@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=791710
2018-01-02 15:42:18 +00:00
Timm Bäder
ad536f333b window: Avoid redundantly getting the GDK window
meta-pick of commit c1573a1fda: the
variable gdk_window is used in a check, but we may as well use it again
to avoid calling _gtk_widget_get_window() again unnecessarily.
2018-01-02 15:26:46 +00:00
Daniel Boles
bdb3a4d505 themes: Regenerate CSS to reflect recent commits 2018-01-01 19:52:47 +00:00
Daniel Boles
7dfb99c2ca HighContrast: Avoid expander↔combobox interference
as per commit b4b9aa1e5f
2018-01-01 19:46:58 +00:00
Matthias Clasen
b4b9aa1e5f Adwaita: Avoid expander<>combobox interference
Putting a combobox in an expander was causing the combo arrow
to go sideways. Increase the specificity with which we address
the expander arrow to avoid that.
2018-01-01 18:48:08 +00:00
Matthias Clasen
bd9ed01839 fontchooser: Add global keynav
Starting to type should focus the search entry and start
a search.
2017-12-27 17:32:16 -05:00
Matthias Clasen
6fa63bd92c font button: Some followup cleanups
Don't refer to the font-name property in docs either, and
don't use deprecated API internally.
2017-12-21 11:42:23 -05:00
Matthias Clasen
87e1615610 font button: Deprecate the font-name property
It has long been redundant with the GtkFontChooser::font
property.
2017-12-21 11:13:08 -05:00
Daniel Boles
0e338d31a4 Range: Fix inverted vert scrolling on vert Ranges…
The change in the previous patch should only be applied when the Range
is oriented horizontally.

https://bugzilla.gnome.org/show_bug.cgi?id=737175
2017-12-19 21:18:41 +00:00
Daniel Boles
4d18a346c1 Range: Fix inverted vert scrolling on horiz Ranges
Users expect, & previous patches have tried to assure, that scrolling up
over a horizontal Range will cause the value to increase & vice-versa.
But the path using directions was still negating the delta & decreasing
the value on scrolling up. This could be seen on Win32 or X without XI2.

So, only negate the delta when scrolling down (or left), not up, so that
scrolling up (or right) will make the value increase for any event type.

https://bugzilla.gnome.org/show_bug.cgi?id=737175#c5
2017-12-19 18:40:51 +00:00
Matthias Clasen
09c94c27e1 font chooser: Stop listening to style-updated
The only time a style-updated indicates we need
to reload fonts is when it is synthesized by GtkSettings
in response to a fontconfig timestamp change, but
we are listening to those already, anyway.
2017-12-19 12:13:32 -05:00
Matthias Clasen
5f022cbc12 Avoid calling unsetenv too late
Stash the DESKTOP_AUTOSTART_ID env var in a constructor,
before any threads have been created.

https://bugzilla.gnome.org/show_bug.cgi?id=790963
2017-12-17 17:33:02 -05:00
Matthias Clasen
b49502c167 inspector: Allow to bump scale to 3
Might as well allow this, for 'large scale testing'.
2017-12-17 17:17:02 -05:00
Matthias Clasen
32332b3a03 Revert "css: Replace _AFFECTS_TEXT with _TEXT_SIZE and _TEXT_CLIP"
This reverts commit 492469a94a.

People have been reporting missing invalidations with this change.
2017-12-17 11:20:50 -05:00
Matthias Clasen
f44af2e6ae Revert "css: Fix segfault when GtkCssStyleChange is NULL on gtk_widget_real_style_updated()"
This reverts commit 7e253f4bd3.
2017-12-17 11:20:15 -05:00
Matthias Clasen
7d23b33ac5 Don't place dnd cursor in placeholder text
That is just misleading - the entire placeholder text is going
to be replaced by the drop.
2017-12-17 10:54:21 -05:00
Matthias Clasen
11bfce3f36 listbox: Fix a crash during keynav
The code was asserting something that was not always holding
true. We can hit row == NULL here on page-up too. Handle that
case by moving to the first row.

https://bugzilla.gnome.org/show_bug.cgi?id=791549
2017-12-15 18:46:21 -05:00
Juan Pablo Ugarte
7e253f4bd3 css: Fix segfault when GtkCssStyleChange is NULL on gtk_widget_real_style_updated()
https://bugzilla.gnome.org/show_bug.cgi?id=791281
2017-12-14 16:40:40 -05:00
Matthias Clasen
05e4e7fe87 placesview: Make middle click work
This does not cost us much, and improves consistency.
2017-12-12 13:57:06 -05:00
Matthias Clasen
c4ff07025b link button: Set a drag icon
It is a bit odd to drag nothing around, so set an icon.
2017-12-10 13:58:27 -05:00
Colomban Wendling
75768a4d00 Fix updating the widget accessible description when using its tooltip
We need to notify ATK the description changed when the tooltip text associated
with the widget changes and gtk_widget_accessible_get_description() would use
it as the description.

https://bugzilla.gnome.org/show_bug.cgi?id=779009
2017-12-09 21:28:47 -05:00
Timm Bäder
492469a94a css: Replace _AFFECTS_TEXT with _TEXT_SIZE and _TEXT_CLIP
It was used to mark css properties that affect widgets with text, but it
caused unnecessary invalidations. E.g. 'color' was marked as
AFFECTS_TEXT but changing just the color of a label should not
automatically queue a resize, which is what the code in
gtk_widget_real_style_updated does.

Replace this flag with GTK_CSS_AFFECTS_TEXT_SIZE and
GTK_CSS_AFFECTS_TEXT_CLIP, which GtkWidget can use only if the widget
actually has text.

https://bugzilla.gnome.org/show_bug.cgi?id=791281
2017-12-09 20:16:02 -05:00
Marco Trevisan (Treviño)
ecc9946566 cssshadowvalue: don't apply the y_scale offset twice to the shadow
As per commit 942e904 this changed causing a regression that
seems to be visible only when scale > 2.

https://bugzilla.gnome.org/show_bug.cgi?id=791363
2017-12-09 20:13:20 -05:00
Colin Leroy
279b81d202 placesview: Present FUSE-reachable network shares in Other Locations
The documentation about gtk_file_chooser_set_local_only() states
that "non-native files may still be available using the native
filesystem via a userspace filesystem (FUSE)."
The code that made this possible in GTK+2 was missing from GTK+3 and
that represented a regression for Linux users in numerous applications
(Firefox, Thunderbird, Chromium, ...)

https://bugzilla.gnome.org/show_bug.cgi?id=787128
2017-12-07 21:41:44 -05:00
Christian Hergert
86dd1e37a7 autocleanups: allow g_autoptr() usage with GtkTreePath
As the summary says, this allows using g_autoptr(GtkTreePath). This is
useful for API that uses out parameters for GtkTreePath that need to be
freed.

https://bugzilla.gnome.org/show_bug.cgi?id=791234
2017-12-04 19:34:05 -08:00
Руслан Ижбулатов
3fd23fcfd1 GDK W32: Special handling for DELETE requests
1) Ensure that any DELETE requests from the target are sent to GDK, even if
   both the source and the target are in the same process and it
   is therefore possible to use a shortcut and call the handler directly
   in GTK layer
2) Ensure that target GDK doesn't do anything when GTK asks it to send
   a DELETE request, just report back immediately (the code up the stack
   does not check for successfullness when request is DELETE, so not giving
   it any data is OK).

The source code already synthesizes a DELETE request, so that side is
also taken care of.

https://bugzilla.gnome.org/show_bug.cgi?id=786509
2017-11-30 04:17:27 +00:00
Matthias Clasen
91ef88f77f Improve the docs
Document that gtk_application_is_inhibited can't
be guaranteed to work.
2017-11-28 22:56:11 -05:00
Jan Alexander Steffens (heftig)
b0fb67eabc entry: Undo ABI breakage from addition of insert_emoji
https://bugzilla.gnome.org/show_bug.cgi?id=790862
2017-11-26 18:24:51 -05:00
Руслан Ижбулатов
8caba9536c W32: Massive W32 DnD fix
Massive changes to OLE2 DnD protocol, which was completely broken before:
* Keep GdkDragContext and OLE2 objects separate (don't ref/unref them
  together, don't necessarily create them together).
* Keep IDataObject formats in the object itself, not in a global variable.
* Fix getdata() to look up the request target in its format list, not in the
  global hash table
* Create target GdkDragContext on each drag_enter, destroy it on drag_leave,
  whereas IDropTarget is created when a window becomes a drag destination
  and is re-used indefinitely.
* Query the source IDataObject for its supported types, cache them in the
  target (!) context. This is how GTK+ works, honestly.
* Remember current_src_object when we initiate a drag, to be able
  to detect later on that the data object is ours and use a
  shortcut when querying targets
* Make sure GDK_DRAG_MOTION is only sent when something changes
* Support GTK drag cursors
* Ensure that exotic GTK clipboard formats are registered
  (but try to avoid registering formats that can't be used between applications).
* Don't enumerate internal formats
* Ensure that DnD indicator window can't accept drags or receive any kind of input
  (use WS_EX_TRANSPARENT).
* Remove unneeded indentation in _gdk_win32_dnd_do_dragdrop()
* Fix indentation in gdk_win32_drag_context_drop_finish()
* Remove obsolete comments in _gdk_win32_window_register_dnd()
* Check for DnD in progress when processing WM_KILLFOCUS, don't emit a grab
  break event in such cases (this allows alt-tabbing while DnD is in progress,
  though there may be lingering issues with focus after dropping...)
* Support Shell ID List -> text/uri-list conversion, now it's possible
  to drop files (dragged from Explorer) on GTK+ applications
* Explicitly use RegisterClipboardFormatA() when we know that the string
  is not in unicode. Otherwise explicitly use RegisterClipboardFormatW()
  with a UTF8->UTF16 converted string
* Fix _gdk_win32_display_get_selection_owner() to correctly bail
  when selection owner HWND is NULL (looking up GdkWindow for NULL
  HWND always succeeds and returns the root window - not the intended
  effect)
* More logging
* Send DROP_FINISHED event after DnD loop ends
* Send STATUS event on feedback
* Move GetKeyboardState() and related code into _gdk_win32_window_drag_begin(),
  so that it's closer to the point where last_pt and start_pt are set
* Use & 0x80 to check for the key being pressed. Windows will set low-order bit
  to 1 for all mouse buttons to indicate that they are toggled, so simply
  checking for the value not being 0 is not enough anymore.
  This is probably a new thing in modern W32 that didn't exist before
  (OLE2 DnD code is old).
* Fixed (hopefully) and simplified HiDPI parts of the code.

Also adds managed DnD implementation for W32 GDK backend (for both
OLE2 and LOCAL protocols). Mostly a copy of the X11 backend code, but
there are some minor differences:
* doesn't use drag_window field in GdkDragContext,
  uses the one in GdkWin32DragContext exclusively
* subtracts hotspot offset from the window coordinates when showing
  the dragback animation
* tries to consistently support scaling and caches the scale
  in the context
* Some keynav code is removed (places where grabbing/ungrabbing should
  happen is marked with TODOs), and the rest is probably inert.

Also significantly changes the way selection (and clipboard) is handled
(as MSDN rightly notes, the handling for DnD and Clipboard
 formats is virtually the same, so it makes sense to handle
 both with the same code):
* Don't spam GDK_OWNER_CHANGE, send them only when owner
  actually changes
* Open clipboard when our process becomes the clipboard owner
  (we are doing it anyway, to empty the clipboard and *become* the owner),
  and then don't close it until a scheduled selection request event
  (with TARGETS target) is received. Process that event by announcing
  all of our supported formats (by that time add_targets() should have
  been called up the stack, thus the formats are known; just in case,
  add_targets() will also schedule a selection request, if one isn't
  scheduled already, so that late-coming formats can still be announced).
* Allow clipboard opening for selection_convert() to be delayed if it
  fails initially.
* The last two points above should fix all the bugs about GTK+ rising
  too much ruckus over OpenClipboard() failures, as owner change
  *is allowed* to fail (though not all callers currently handle
  that case), and selection_convert() is asynchronous to begin with.
  Still, this is somewhat risky, as there's a possibility that the
  code will work in unexpected ways and the clipboard will remain open.
  There's now logging to track the clipboard being opened and closed,
  and a number of failsafes that try to ensure that it isn't kept open
  for no reason.
* Added copious notes on the way clipboard works on X11, Windows and GDK-W32,
  also removed old comments in DnD implementation, replaced some of them
  with the new ones
* A lot of crufty module-global variables are stuffed into a singleton
  object, GdkWin32Selection. It's technically possible to make it a
  sub-object of the Display object (the way Wayland backend does),
  but since Display object on W32 is a singleton anyway... why bother?
* Fixed the send_change_events() a bit (was slightly broken in one of the
  previous iterations)
* Ensure that there's no confusion between selection conversion (an artifact
  term from X11) and selection transmutation (changing the data to be W32-compatible)
* Put all the transmutation code and format-target-matching code into gdkselection-win32.c,
  now this code isn't spread across multiple files.
* Consequently, moved some code away from gdkproperty-win32.c and gdkdnd-win32.c
* Extensive format transmutation checks for OLE2 DnD and clipboard.
  We now keep track of which format mappings are for transmutations,
  and which aren't (for example, when formats are passed as-is, or when
  a registered name is just an alias)
* Put transmutation code into separate functions

* Ensure that drop target keeps a format->target map for supported formats,
  this is useful when selection_convert() is called, as it only receives a
  single target and no hints on the format from which the data should
  be transmuted into this target.
* Add clear_targets() on W32, to de called by GTK
* Use g_set_object() instead of g_ref_object() where it is allowed.
* Fix indentation (and convert tabs to spaces), remove unused variables

https://bugzilla.gnome.org/show_bug.cgi?id=786509
2017-11-25 15:44:40 +00:00
Руслан Ижбулатов
2cc7a9c034 Only register application/x-rootwindow-drop on X11
application/x-rootwindow-drop is not useful anywhere else,
so put it under #ifdef GDK_WINDOWING_X11

On W32 this prevents toplevels from automatically becoming valid
drop targets with a useless drop type.

https://bugzilla.gnome.org/show_bug.cgi?id=786509
2017-11-25 15:44:37 +00:00
Daniel Boles
87673af98c Be more specific in ::insert-emoji Since tag
I had been unsure whether to include the minor version, but
:show-emoji-icon already did, so do the same here to match.
2017-11-23 17:17:47 +00:00
Daniel Boles
2c9072314a Add Since to ::insert-emoji, and some trivialities
Document when these keybinding signals were added.
2017-11-22 22:35:25 +00:00
Matthias Clasen
f922aee5e2 text view: Support the Emoji chooser
Similar to GtkEntry, add an "Insert Emoji" context
menu item, and add the same keybindings. We don't
add the icon here, since it is not clear where it
would go.

https://bugzilla.gnome.org/show_bug.cgi?id=790029
2017-11-22 22:20:34 +00:00
Matthias Clasen
bd56e0d918 Fix indentation mishap 2017-11-22 22:20:28 +00:00
Daniel Boles
42c3b91fa7 SpinButton: Explain meaning of nullable Adjustment
configure() marked the @adj argument as (allow-none) but did not explain
what passing NULL would do. Fix that, and move it to (nullable) as well.
2017-11-22 20:58:00 +00:00
Daniel Boles
c490ac4ed8 doc: Replace uses of #NULL with %NULL 2017-11-22 20:58:00 +00:00
Daniel Boles
f1b812731d CellRendererPixbuf: Improve property docs
Add Since annotations for the stock-* properties.
Add a doc comment for :stock-size in order to link to GtkIconSize.
Document :stock-detail as deprecated. It does nothing & is gone in GTK+4
2017-11-22 20:48:02 +00:00
Daniel Boles
260a6aaa71 doc: TextLayout: Add missing (out) annotations
and move from (allow-none) to (optional)
2017-11-22 20:48:02 +00:00
Matthias Clasen
55e8736613 emoji chooser: break out a helper function
This is just a small cleanup.
2017-11-22 19:11:31 +00:00
Matthias Clasen
d3eacaf840 entry: Add a key binding for the emoji chooser
Make Ctrl-. and Ctrl-; bring up the emoji chooser.

https://bugzilla.gnome.org/show_bug.cgi?id=789160
2017-11-22 19:11:31 +00:00
Matthias Clasen
6b126a70e2 emoji chooser: Make menu key work as expected
Whenever we have a right-click action, we should make
the menu key work as a keyboard-accessible alternative.
2017-11-22 19:11:31 +00:00
Matthias Clasen
f301b7874e emoji chooser: handle right-click
Whereever we handle long-press for touch, it makes sense to handle
right-click as a faster alternative for mouse-based interaction.

This commit makes right-click work to bring up the variation
selector for Emojis.
2017-11-22 19:11:31 +00:00
Matthias Clasen
19670f9fe6 Trivial cleanup
Better to use G_SOURCE_REMOVE than FALSE, for clarity.
2017-11-22 19:11:31 +00:00
Matthias Clasen
65457e6d12 emoji chooser: Don't leak gestures
We were not freeing these gestures as we should.
2017-11-22 19:11:31 +00:00
Benjamin Otte
f8cb3fc3a8 emojichooser: animate the adjustment
... instead of doing a dance with the scrolled window to get it to scroll
the adjustment.
2017-11-22 19:11:31 +00:00
Matthias Clasen
4ffdf917bb icontheme: Add a trailing / when enumerating resources
This avoids extra string copies in GResource.
2017-11-16 08:44:36 -05:00
Matthias Clasen
e3f84e9bf4 application: Append a / to the icon resource path
g_resources_enumerate_children expects the path to end
in a '/' (even though thats not stated in the docs), and
will copy it if that isn't the case. Avoid the copy
by putting  a '/' there to begin with.
2017-11-16 08:24:55 -05:00
Matthias Clasen
20c2d6c992 icontheme: Append a / to the resource path
g_resources_enumerate_children expects the path to end
in a '/' (even though thats not stated in the docs), and
will copy it if that isn't the case. Avoid the copy
by putting  a '/' there to begin with.
2017-11-16 08:24:41 -05:00
Carlos Soriano
7e49a02acf gtkplacessidebar: Fix new tab/window handling for cloud accounts
It wasn't taking into account whether the sidebar had support for them
or not, resulting in a file chooser with open in new tab/window menu
items when it's not supported.

To fix it, do as with the other menus and check for the availability of
new tab/window flags.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-11-13 15:38:26 +01:00
Carlos Soriano
e672c02441 gtkplacessidebar: Adapt to libcloudproviders 0.2.0
And a few improvements on the way.

https://bugzilla.gnome.org/show_bug.cgi?id=786123
2017-11-13 15:38:26 +01:00
Christian Hergert
b654130bd7 css: avoid copying resource data
To avoid copying data from gresources to the heap, we can use
the newly added gtk_file_load_bytes(). That function will check
for resource:// URIs and access their internal data directly.

Other URI schemes will read the contents into memory and return
a GBytes as normal.

https://bugzilla.gnome.org/show_bug.cgi?id=790270
2017-11-12 20:04:06 -08:00
Christian Hergert
d46c072c4d utils: add gtk_file_load_bytes() helper
This helper will load GBytes for a GFile, but try to reuse the
embedded data for a gresource to reduce the chances of copying
data to the heap.

https://bugzilla.gnome.org/show_bug.cgi?id=790270
2017-11-12 20:04:06 -08:00
Benjamin Otte
15acb4c340 a11y: Handle a treeview with no columns
Code was spewing criticals to stderr because of nonexisting columns. So
check that there's actually an existing column first.
2017-11-13 03:55:03 +01:00
Benjamin Otte
efaa6524ac progresstracker: Don't hand out NaN
When the duration is set to 0, clamp it to 1us. This way we're almost
correct: We should really instantly finish, but we don't. But we do
respect the delay.

Doing this properly would require some refactoring of how the progress
tracker actually maintains progress, and this is just a quick fix.
2017-11-12 06:30:57 +01:00
Daniel Boles
e09c103187 Window: Document get_icon() return as nullable 2017-11-09 09:44:49 +00:00
Daniel Boles
5835cb2bc2 CssProvider: Use consistent theme name placeholder
commit 475d916eb9 added various paths that
use theme-name for this, but the existing path already used THEME, with
a subsequent description referring to the latter. So use that everywhere
2017-11-08 09:23:11 +00:00
Piotr Drąg
f7f4ecf006 placessidebar: correct quotation marks in a new string 2017-11-05 21:16:59 +01:00
Alexandru Pandelea
7f6365cf9f placessidebar: add starred location item
Add an item for showing all files marked as favorite. This item will
open all files that have the nao:predefined-tag-favorite tag

https://bugzilla.gnome.org/show_bug.cgi?id=785176
2017-11-05 20:17:22 +01:00
Daniel Boles
40302a5268 Adwaita: Fix Entry:has-frame if backdrop/disabled
by explicitly including these in the selector removing the border, to
avoid other rules on these pseudoclasses overriding the .flat class.

https://bugzilla.gnome.org/show_bug.cgi?id=789733
2017-11-01 19:57:35 +00:00
Daniel Boles
a03a3c3af9 HighContrast: Fix GtkEntry:has-frame not working
• Remove the box-shadow at the top when the entry is in the foreground
• Bump precedence so that :disabled entries do not have .flat overridden
• Also add :backdrop to stop HCInverse getting a lighter BG in :backdrop

https://bugzilla.gnome.org/show_bug.cgi?id=789733
2017-11-01 19:57:34 +00:00
Daniel Boles
55210ae464 Inspector: better default split of CSS nodes/props
Move the default pos of the Paned handle to 400px from the left, i.e.
50% of the default width of the window. The previous position at 300px
from left meant the node treeview was too narrow & could easily result
in the (useful) State column not being visible in the case of many
apps. The properties pane doesn't need to be as big as it was anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=788898
2017-11-01 19:57:34 +00:00
Julian Sparber
f3408d89d5 AboutDialog: Fix accepting GTK_LICENSE_AGPL_3_0
Add the new GTK_LICENSE_AGPL_3_0 to the allowed enum range checked in
gtk_about_dialog_set_license_type(), so this value is not rejected.

https://bugzilla.gnome.org/show_bug.cgi?id=789678
2017-10-31 18:57:02 +00:00
Daniel Boles
2b509a34d4 SpinButton: Fix typo 2017-10-31 18:26:50 +00:00
Andrea Azzarone
81d1aaa062 widget: Typecheck before deref in translate_coords
https://bugzilla.gnome.org/show_bug.cgi?id=771279
2017-10-27 21:01:52 -05:00
Federico Mena Quintero
3509918e39 GtkPathBar: Centralize handling of outstanding cancellables
The path bar would crash if we disposed it before all pending I/O
operations had finished.  Now we remember all the outstanding
operations directly in the GtkPathBarPrivate, and deal with them
consistently.
2017-10-27 17:07:30 -05:00
Simon McVittie
72045a1a2d GtkWindow: Set tiled class on windows that have any tiled edge
This has no practical effect on Adwaita, but might fix some
third-party themes that were broken by GTK+ 3.22.23.

Signed-off-by: Simon McVittie <smcv@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=789357
2017-10-27 10:58:35 -02:00
Simon McVittie
8ad40a49ee GtkHeaderBar: Reconsider buttons if any tiling state changes
Looking at the 1-bit "tiled or not?" state is not necessarily
enough.

Signed-off-by: Simon McVittie <smcv@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=789357
2017-10-27 10:58:35 -02:00
Drew DeVault
f2adaba237 Wayland: Implement KDE's SSD protocol
If the compositor prefers server-side decorations and the client doesn't
customize the title bar, we disable client-side decorations and let the
compositor know. Otherwise, we continue to use client-side decorations.

Signed-off-by: Drew DeVault <sir@cmpwn.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781909
2017-10-26 16:34:42 -04:00
Florian Müllner
5ad9ecaff0 appchooserwidget: Don't limit application list unconditionally
As documented, GtkAppChooser is "typically [used] for the purpose of
opening a file". However given that applications that support neither
opening files nor URLs are filtered out, the chooser is not actual
useful for any other (atypical) usage. Change that by only applying
the filtering if a content-type was set, and use the full unfiltered
list otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=789327
2017-10-26 06:18:32 -04:00
Christian Persch
5ee34ec72a actionable: Allow all detailed action name formats
Use g_action_parse_detailed_name() to enable use of this API
for actions with non-string parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=788841
2017-10-26 06:17:28 -04:00
Carlos Garnacho
9b874a40ac gtkwidget: Emulate motion before button press on fallback touch handler
The code has been shuffled so GDK_TOUCH_BEGIN results in a
GDK_MOTION_NOTIFY to the new position and a GDK_BUTTON_PRESS on that same
place. This makes pointer emulation consistent with what X11 does. Even
though button presses have x/y arguments, there's code out there relying
on getting prior motion events.
2017-10-19 14:25:55 +02:00
Debarshi Ray
29c4d0a3ee GtkGestureZoom: Don't leak the list of sequences
https://bugzilla.gnome.org/show_bug.cgi?id=789149
2017-10-19 09:29:37 +02:00
Timm Bäder
45198d2312 emojichooser: Plug memory leak 2017-10-18 10:04:48 +01:00
Daniel Boles
6018f9098e a11y/entry: Fixups for previous commit
We still declare all variables at the start of the block.

Also, we can use the fast private _gtk_widget_get_allocation().

https://bugzilla.gnome.org/show_bug.cgi?id=784509
2017-10-15 12:57:41 +01:00
Samuel Thibault
a2d78a2de7 a11y/entry: Fix text coords not adjusted for alloc
What is missing is the "allocation" part of x/y coordinates. Since
gtk_entry_realize doesn't call gtk_widget_set_window(priv->text_area),
the coordinates returned by gdk_window_get_origin don't include it.

This patch fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=784509
2017-10-15 12:33:38 +01:00
Timm Bäder
8db9776875 scalebutton: Fix comparison for empty icon list
https://bugzilla.gnome.org/show_bug.cgi?id=786220
2017-10-15 12:31:54 +01:00
Daniel Boles
9106436003 Range: Fix inverted horizontal scroll wheel events
Bug 737175 aimed to ensure that scrolling up on a horizontal range would
result in its value increasing, as that’s what users intuitively expect.
However, its commit 416c370da1 meant that,
if the event gives scroll deltas, we inverted our delta unconditionally.

So it broke horizontal scrolling: scrolling left moved the slider right…

We must only invert if using dy as delta. dx already has the right sign,
so inverting it was wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=788905
2017-10-14 18:48:45 +01:00
Emmanuele Bassi
7fe07ea906 Fix previous commit
The _gtk_widget_get_parent() private accessor is defined inside
gtkwidgetprivate.h.
2017-10-13 10:55:00 +01:00
Daniel Boles
81b7f76cb8 Fixed: If can’t add child, don’t add to child info
If the call to set_parent() failed, we were still adding the child to
the internal list of children, despite that it was not really added.
That meant we could later try to do invalid stuff with that non-child.

Fix that by asserting and giving up if the child that the user is
attempting to add is already parented.

https://bugzilla.gnome.org/show_bug.cgi?id=701296
2017-10-13 09:49:48 +01:00
Daniel Boles
567ef528e5 Fixed: Don’t dereference before typechecking 2017-10-13 09:49:34 +01:00
Daniel Boles
491eea5680 StyleContext: Fix CSS snippet language, node names
The language is useful for parsing tools, such as that of gtkmm, which
otherwise assumes these are C snippets and elides them from its
generated documentation.

The old GtkBlah node names are just plain obsolete.
2017-10-12 19:40:19 +01:00
Daniel Boles
b1cb34cbbb Settings: Mention Shift+primary click on Range too
This already existed, and since this doc blurb is already inflating
dramatically, what’s another half a line?
2017-10-11 22:36:54 +01:00
Daniel Boles
694686d2ed Settings: Reflect resurrected middleclick in Range
and while here, make the explanation more explicit as to which values do
what, & use general Range terminology instead of focussing on scrollbars

https://bugzilla.gnome.org/show_bug.cgi?id=787669
2017-10-11 22:11:27 +01:00
Matthias Clasen
5b2cae6703 range: Bring back middle clicks
It does not hurt us to keep middle clicks doing the same
as shift-primary clicks. This makes the transition from gtk2
less painful in terms of muscle memory.

https://bugzilla.gnome.org/show_bug.cgi?id=787669
2017-10-11 22:11:27 +01:00
Timm Bäder
ca4efb0080 bindings: Fix code snippet
Just use a more realistic example, adapted from gtklistbox.c
2017-10-11 22:11:27 +01:00
Timm Bäder
7525a11a30 accellabel: Fix code snippet 2017-10-11 22:11:27 +01:00
Timm Bäder
8169d6703a aboutdialog: Fix code snippets
Define all variables and fix a missing comma in the first
gtk_show_about_dialog call.
2017-10-11 22:11:27 +01:00
Timm Bäder
413d548edd applicationwindow: Fix code sample
Declare all variables, use proper GtkApplication constructor and the
right GTK_APPLICATION() cast for gtk_application* API.
2017-10-11 22:11:27 +01:00
Daniel Boles
a54550db7b ToggleButton: Actually show buttons in new snippet
Also, create a Window, instead of a Dialog without a transient parent,
which is (noisily) discouraged. Then s/content_area/box/g to match.
2017-10-11 22:11:27 +01:00
Timm Bäder
b0fe89d85f togglebutton: Fix code snippet
Remove gtk_box_pack_start usage, gtk_dialog_get_content_area, fix wrong
gtk_dialog_new parameters and actually add a output_state callback.
2017-10-11 22:11:27 +01:00
Timm Bäder
3973da4c65 label: Make all code snippets properly compile 2017-10-11 22:11:27 +01:00
Robert Ancell
112a61a782 icon-theme: Show filename attempted when icon fails to load 2017-10-12 09:03:13 +13:00
Robert Ancell
b21bb316bd iconhelper: Show error if fail to load placeholder icon 2017-10-12 09:03:13 +13:00
Benjamin Otte
8439f06500 cssnode: Don't put wrong styles in the style cache
~Company ╡ so TL;DR: we put the static style in the cache, but then
       ⤷ ╡ compute a child style from the animated style in the cache
       ⤷ ╡ and we put the child style also in the cache (because
       ⤷ ╡ it's not animated)
       ⤷ ╡ then we run the animation, but reuse the cache every time
       ⤷ ╡ for both child and parent
       ⤷ ╡ so after the animation is done, we end up with a cache that
       ⤷ ╡ has the correct static style for the parent but an
       ⤷ ╡ incorrect static style for the child
       ⤷ ╡ because that static style was computed from the
       ⤷ ╡ initial animated style

This fixes https://bugzilla.gnome.org/show_bug.cgi?id=763517
2017-10-10 21:48:09 +02:00
Emmanuele Bassi
f50f3e2a90 docs: Clarify the visibility of buttons in GtkStackSwitcher
If a page in the GtkStack is not visible, then the GtkStackSwitcher
won't show a button for it.
2017-10-10 10:20:53 +01:00
Emmanuele Bassi
e06bce7631 docs: Update the deprecation annotation for gtk_paint_spinner()
Bring it in line with the deprecation warning in the header.

https://bugzilla.gnome.org/show_bug.cgi?id=782396
2017-10-10 10:20:53 +01:00
Daniel Boles
f29007c177 Popover: Complete depr docs of transitions-enabled
Its getter and setter are deprecated, so copy in the blurb from there.
2017-10-08 23:34:31 +01:00
Daniel Boles
cbe009fe90 Dialog: Clarify that response ID 0 is not reserved
I only got so far in math, but it looks to me like zero isn’t positive.
We don’t reserve it, so be clear about that.
2017-10-08 22:19:13 +01:00
Daniel Boles
0f805d1bd9 MenuButton: Document the correct no-direction icon
Document open-menu-symbolic, which we use, not view-context-menu, which
does not exist.
2017-10-08 21:10:24 +01:00
Daniel Boles
233f49ddcb Adwaita/README: Don’t bother mentioning parse-sass
Assume no one wants to make a change without testing it in GTK+…
If anyone has a reason to do this, they’ll be able to figure it out.
2017-10-08 14:08:34 +01:00
Daniel Boles
4515c72706 Adwaita/README: Update to reflect we use sassc now
We moved from the Ruby compiler to sassc in
commit 67953e9cfb, so this copies across
the updated info about building from GTK+ 4.

Also, explain the purpose of parse-sass.sh, since while that is not
mentioned in GTK+ 4 – and perhaps does not need to be, thanks to Meson –
we are still on Autotools here, and rebuilding the entirety of GTK+ 3 if
you only edited the CSS is a lot of waiting for no good reason.
2017-10-08 14:01:38 +01:00
Daniel Boles
26046c2afd HC: Avoid inflated titlebar separator in GEdit etc
It was selecting paned separator, which means any separator at any level
of descent within a paned, including the toplevel container in GEdit.

We need to be more specific and only select the relevant separator that
is the direct child of the paned. This is what Adwaita does.

https://bugzilla.gnome.org/show_bug.cgi?id=788573
2017-10-07 01:29:51 +01:00
Daniel Boles
c0c23f7d44 TreeViewCol: Fix SEGV on remove/add, + memory leak
Nulling priv->button in _unset_tree_view() is asymmetrical: we create
it via init(), not _set_tree_view(), so we shouldn’t null in the latter.

Worse, doing so manifests in criticals + a SEGV easily with basic use of
testtreecolumns, removing the TVC from a TV then trying to add it to one

Finally, the wrong null-out meant dispose() failed to unref the button,
so it leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=728452
https://bugzilla.gnome.org/show_bug.cgi?id=788614
2017-10-07 00:41:10 +01:00
Daniel Boles
08187aeec5 TreeViewCol: Don’t try to disconnect null treeview
https://bugzilla.gnome.org/show_bug.cgi?id=788614
2017-10-06 21:34:52 +01:00
Timm Bäder
13c6310688 modelbutton: set_relative_to(NULL) the popover in dispose
We do set_relative_to(menu_button) when creating it so we should do this
here (or nothing).
2017-10-06 21:34:52 +01:00
Daniel Boles
b45aa63b75 FileChooserButton: Avoid unref()ing a null model
Otherwise simply closing the widget-factory would give a critical from
g_object_unref().
2017-10-06 21:34:52 +01:00
Timm Bäder
b94bfb1678 filechooserbutton: Don't leak priv->model 2017-10-06 18:18:04 +01:00
Timm Bäder
b3f4da0439 applicationwindw: Don't leak show-help-overlay action 2017-10-06 18:15:31 +01:00
Daniel Boles
fa04eb26d7 HC: Add border/hilight when hovering flat buttons
The border and icon highlight are useful feedback that was defeated by
CSS precedence. It worked for .titlebuttons due to their implementation,
but the same was not true for custom .flat buttons. This makes it so.

https://bugzilla.gnome.org/show_bug.cgi?id=788580
2017-10-06 02:37:07 +01:00
Daniel Boles
61137ae163 HC: Flat titlebuttons became non-flat in backdrop
When the window was backdropped, they suddenly regained their border.
This was clearly not intentional or of any practical use to anyone.

Shuffle around some selectors so that the backdrop ones do not override
the flat ones and make the borders magically reappear when backdropped.

Note that, whereas standard titlebuttons get the border on :hover, other
.flat buttons in the headerbar do not. That should probably be fixed too

https://bugzilla.gnome.org/show_bug.cgi?id=788580
2017-10-06 02:36:52 +01:00
Daniel Boles
7fc09f18a3 ComboBox: Don’t let modes disconnect each other
…from priv->button. My refactor to g_signal_disconnect_by_data()
included this widget, when I shouldn’t have as both modes use it.
This e.g. broke opening a CB by keyboard that was currently in menu
mode, if it had been in list mode initially (e.g. due to the theme).

Fix by moving to disconnect_by_func() and only removing in each mode’s
destroy() method the signals that it set on the button in its setup().

https://bugzilla.gnome.org/show_bug.cgi?id=788577
2017-10-06 01:40:42 +01:00
Daniel Boles
6c3d17b867 HighContrastInverse: Make window borders visible
They were hard-coded to a transparent black, but that is our bg colour
in HC Inverse, so windows stacked on top of each other or a dark
background blended together into a mush.

Fix this by making the $_wm_border* colours relative to the fg colour,
so that HighContrastInverse gets borders that are transparentised white.

https://bugzilla.gnome.org/show_bug.cgi?id=788575
2017-10-06 00:38:13 +01:00
Daniel Boles
3a0ea4e0d2 HC: Fix MessageDialog’s rounded bottom borders
A missing decoration selector meant that we got a solid black background
behind the rounded corners of the dialog.

Copy the equivalent code from Adwaita, including nicely rounding the
focus outline too (& sorry, but this needs more newlines to be readable)

https://bugzilla.gnome.org/show_bug.cgi?id=788574
2017-10-06 00:25:58 +01:00
Daniel Boles
d9df5dfa74 HighContrast: Fix titlebar containing >1 headerbar
by migrating the relevant code from Adwaita, to dodge unwanted doubling
up of the bottom border and such.

It also hopefully still encompasses whatever commit
b4371728de was trying to do; certainly, it
retains the resolution of the main bug/patch that one was attached with.

https://bugzilla.gnome.org/show_bug.cgi?id=769877
2017-10-05 21:49:11 +01:00
Daniel Boles
8abdbfee16 HC: Copy working tooltip code from Adwaita & tweak
There were various problems, like only selecting on .tooltip and not the
widget node tooltip, not being specific enough for tooltip.csd, etc. So,
specific theming was absent, and default popup window styles got applied

This commit copies in the better working tooltip CSS from Adwaita, but
applies a couple of changes to make it work better in the HC themes:
 • Reduce the transparency of the tooltip, so we achieve higher contrast
 • Drop the black text-shadow, as it is not useful on this more black bg

Note: we may then need to re-add some of this to the .tooltip class. But
it is unclear what needs done there. While Adwaita is not doing it, we
are better not to confuse by keeping it in HC only; we should try to be
as close as possible, to make it easier for HC to keep up with Adwaita.

https://bugzilla.gnome.org/show_bug.cgi?id=769879
2017-10-05 19:41:00 +01:00
Timm Bäder
acab79040a switch: Fix int/double comparison
We get a double coordinate.
2017-10-05 18:50:12 +01:00
Timm Bäder
070af44fc7 appchooserdialog: Remove unused macro 2017-10-05 18:50:12 +01:00
Timm Bäder
18b8b2b8e8 combobox: Remove unneeded queue_resize call
The remove/add/set_parent/unparent calls in there already do the
necessary work.
2017-10-05 18:50:12 +01:00
Daniel Boles
34cd1e3e5e ComboBox: list: Don’t leak path on expand/collapse
Determining that we clicked on the expander means that we had a valid
path, so we still need to free that, even though we’re not selecting it.

https://bugzilla.gnome.org/show_bug.cgi?id=788505
2017-10-05 01:33:22 +01:00
Daniel Boles
b0e18d676e HighContrast: Correctly select window decoration
We need

    .window-classes decoration

but within the decoration parent selector, we were doing
&.window-classes, which gave us

    decoration.window classes

We need to fix this by selecting on .window-classes &

https://bugzilla.gnome.org/show_bug.cgi?id=788496
2017-10-05 00:27:39 +01:00
Daniel Boles
512a33fee1 updateiconcache: Avoid confusing loop construct
n_attach_points is the result of g_strv_length(): the index at which the
string vector ends in NULL. So by definition, when i == n_attach_points,
string[i] == NULL, and there is no need to check for the latter. The
fact that we did appears to confuse static analysers, as the dereference
and index check were inverted from what would normally be safe. We could
reverse them, but we may as well just remove the unnecessary NULL check.

https://bugzilla.gnome.org/show_bug.cgi?id=788458
2017-10-04 22:55:54 +01:00