Commit Graph

28234 Commits

Author SHA1 Message Date
nana-4
ef32ba3d6a Adwaita: Fix check/radio styling in menu
The new check/radio style increased their specificity, but it was not
synchronized in the menu styling.

This commit increases the specificity to match the updated check/radio
styling.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2096
2019-11-15 23:59:36 +09:00
frederik.feichtmeier
5f5303f8fc Refresh check/radio styling
- use a dedicated mixin
- flatten check/radios
2019-11-15 14:26:47 +01:00
Benjamin Otte
b6528c9f91 Merge branch 'status-icons-hidpi' into 'gtk-3-24'
statusicon: Render as cairo surface

See merge request GNOME/gtk!1135
2019-11-13 17:39:32 +00:00
Emmanuele Bassi
21cd322df9 Do not crash when icon themes do not have a context
The Context key is not mandatory, so we need to handle its absence.

Fixes: #2111
2019-11-13 15:04:42 +00:00
Victor Kareh
4fc32b2751 statusicons: Improve code readability and remove dead code 2019-11-13 07:54:58 -05:00
Victor Kareh
1c09104dc6 statusicon: Render as cairo surface
On HiDPI displays, rendering Status Icons as pixbufs results in blurry
icons. By loading them at scale and rendering as a surface, we preserve
both their size and sharpness.
2019-11-13 07:47:50 -05:00
Emmanuele Bassi
d1936c1ae3 docs: Clarify when to replace old boxes with Grid
Mention that GtkGrid should only replace grid-like layouts achieved with
nested boxes.

Additionally, remove any mention of "future proofing": boxes are not
going away.
2019-11-08 18:02:13 +00:00
Emmanuele Bassi
b7dfb7836f Revert "Refresh checks and radios"
This reverts commit f261b41d47.

The commit broke the theme:

  Theme parsing error: gtk-contained.css:1176:74: Not a valid image
2019-11-04 22:47:00 +00:00
Jakub Steiner
4e346076f2 Merge branch 'adwaita-emoji-picker-adjustments' into 'gtk-3-24'
Adwaita: Emoji picker adjustments

See merge request GNOME/gtk!1159
2019-11-04 19:33:39 +00:00
frederik.feichtmeier
f261b41d47 Refresh checks and radios
- use a dedicated mixin to style checks and radios in _drawing.scss
- keep all special cases for checks and radios in _common.scss
- remove treeview disabled checks/radio styling because it seems no longer needed after testing with the new mixin
- add a fix for checked and indeterminate checks/radios in menus and slightly darken their borders similar to $selected_borders_color
- add a blank in front of a bracket

Fix backdrop

- remove backdrop-hover
- adapt the bg and fg look of checks/radios to other "blue" elements for example suggested action buttons
- fix selected treeview checks in backdrop being gray
2019-11-04 18:09:11 +01:00
Alex Monday
1051c1fcad Adwaita: Emoji picker adjustments
- Add margins for search entry;
- Increase side margins for emoji-section buttons box;
- Apply border-radius on hovered emoji;
- Adjust indication of hovered emoji-section button.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/2026
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1704
2019-11-03 13:03:58 +05:00
Emmanuele Bassi
ce5e97f720 Merge branch 'wip/carlosg/scroll-controller-fixes' into 'gtk-3-24'
Wip/carlosg/scroll controller fixes

See merge request GNOME/gtk!1141
2019-10-21 22:35:17 +00:00
Carlos Garnacho
65bb9c505a gtkwidget: Ensure to run key controllers in the bubble phase
We fall back on controllers in event handlers' default handler,
but we weren't doing so for GDK_KEY_PRESS/RELEASE.
2019-10-21 23:42:19 +02:00
Carlos Garnacho
85f86d1533 keycontroller: Fix ::key-released signal argument
It uses the same signature than ::key-pressed, but this signal
doesn't expose a boolean return value. Use a distinct marshaller
and fix this signal emission.
2019-10-21 23:40:52 +02:00
Matthias Clasen
ffaf56d1c6 key controller: Don't eat modifier events
The key controller was consuming key events
for modifier keys, for no entirely convincing
reason, which leads to problems when somebody
actually listens for those, such as the simple
input method does for C-S-u processing.

(cherry-picked from 91d6893f02)

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1884
2019-10-21 23:19:58 +02:00
Carlos Garnacho
c9a1adf2cc gtkwidget: Forward unhandled scroll events through controllers
Do just like button/motion/touch do, let the scroll events go first
through the event handler, and fallback on the current event controllers
afterwards.

Fixes handling of bubbled scroll events in the scroll controller.
2019-10-21 17:10:30 +02:00
Carlos Garnacho
ebd1840802 scrollcontroller: Set scroll event mask on scroll controller
This ensures adding the controller to a widget will end up with
the expected event masks in the widget default window.
2019-10-21 17:09:17 +02:00
Julian Sparber
ac39847187 GtkEntry: Make GtkEntry: gtk_entry_grab_focus_without_selecting () behave like gtk_widget_grab_focus ()
Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2204
2019-10-17 14:32:24 +02:00
nana-4
d250e51018 Adwaita: Fix rounding on menubar menus really
Prioritize the style by increasing specificity.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1976
2019-10-09 01:21:00 +09:00
Luca Bacci
5c6ca889de
Small syntax fix for win32 CSS theme 2019-10-07 16:27:32 +02:00
Daniel Boles
914558f971 Builder: Fix typos and unended sentence in docs 2019-10-06 20:49:47 +01:00
Philip Withnall
8ce68a5194 gtklistbox: Only unparent header rows if they haven’t been reused
It’s possible for code which uses a `GtkListBox` to reuse a single
header row, and move it around between rows. For example, this might
happen if the code has interactive widgets (like buttons) in the row,
and doesn’t want to continually recreate them and reattach signals to
them whenever the row headers change.

Unfortunately, this was broken, as the old header widget was
unconditionally unparented, even if it had just been set as the header
for a different row in the same `GtkListBox`. This left it assigned as
a child widget in the `GtkListBox` (so it was iterated over by
`forall`), but without its parent widget set.

Fix that by only unparenting the header if it hasn’t already been
assigned as the parent of a different row.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-04 14:30:33 -04:00
Christoph Reiter
e65c703741 Print a warning if GTK_DEBUG is set but gtk isn't built with G_ENABLE_DEBUG
G_ENABLE_DEBUG is tied to the meson builttype property, so building with "plain"
results in G_ENABLE_DEBUG not being defined and the GTK_DEBUG env var just gets ignored
for that build.

Since it can be confusing that GTK_DEBUG has no effect print a warning message instead.

Fixes #2020
2019-09-28 20:54:38 +02:00
Matthias Clasen
ca9fc93925 Merge branch 'BUG_popover_focus_from_another_window_GTK3' into 'gtk-3-24'
popover: fix focus when inside an unfocused window

See merge request GNOME/gtk!1073
2019-09-27 20:29:27 +00:00
Matthias Clasen
e58bb02acd Merge branch 'BUG_popover_focus_new_folder_issue_GTK3' into 'gtk-3-24'
Fix popovers not restablishing default widget

See merge request GNOME/gtk!1075
2019-09-27 20:17:57 +00:00
Matthias Clasen
7ff79452c1 Merge branch '362-gtk-fileopen-dialog-need-filetype-mime-sort-option' into 'gtk-3-24'
GtkFileChooser: add a sortable "Type" column

See merge request GNOME/gtk!858
2019-09-27 19:59:17 +00:00
Matthias Clasen
f9273a86bd Merge branch 'wip/carlosg/atk-util-checks' into 'gtk-3-24'
a11y: Avoid clobbering AtkUtilClass vmethods

See merge request GNOME/gtk!1108
2019-09-27 19:05:34 +00:00
Carlos Garnacho
054165d406 a11y: Avoid clobbering AtkUtilClass vmethods
In the unlikely case that GTK is "embedded" with other toolkits
(hi, Mutter), GTK will clobber the embedder's AtkUtil implementation,
leaving its own a11y in a broken state.

AtkUtil is not meant to be overridden by multiple toolkits within a
single client, so the most sensible thing to do is stay away from it
if that is the case. This helps the embedder's a11y to win.

Fixes Clutter a11y in Mutter after xwayland-on-demand, process
startup used to be in a fixed order so that Clutter's a11y would
eventually win, but x11/gtk startup is now asynchronous and able to
happen at a later point.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1687
2019-09-27 18:15:44 +02:00
Jonas Ådahl
c05f25d968 Merge branch 'dnd-coordinates2' into 'gtk-3-24'
gtk: Properly calculate device offset for DnD

See merge request GNOME/gtk!1104
2019-09-27 15:56:01 +00:00
Benjamin Otte
bdb96507bd CSS: Handle unknown resolution
gdk_screen_get_resolution() can return -1 when the resolution is
unknown. Catch that case and use the default resolution of 96, like in
every other case.

Fixes #2119
2019-09-24 22:39:38 +02:00
Robert Mader
77e0d83000 gtk: Properly calculate device offset for DnD
We need to take the device scale into account, like it is done in
gdkwindow.c.

This fixes wrongly placed DnD surfaces in scaled contexts on X11
as well as Wayland.
2019-09-23 11:50:05 +02:00
Matthias Clasen
ac53fed1f2 Merge branch 'BUG_tooltip_blocks_combo_GTK3' into 'gtk-3-24'
tooltips: hide tooltips before showing popups

See merge request GNOME/gtk!1084
2019-09-15 21:20:37 +00:00
Matthias Clasen
16d8ca8ad9 Merge branch 'builder-notify' into 'gtk-3-24'
Freeze notify queue when building objects

See merge request GNOME/gtk!1086
2019-09-15 15:55:43 +00:00
Matthias Clasen
f4cd637056 Merge branch 'drop-mir' into 'gtk-3-24'
Drop the mir backend

See merge request GNOME/gtk!1062
2019-09-09 20:02:02 +00:00
Emmanuele Bassi
001c0a35ce Freeze notify queue when building objects
We're potentially applying multiple properties during object
construction; we should avoid constantly notifying after setting each
one, and instead coalesce the notifications at the end. In most cases,
the calling code doesn't have access to the instance, so it won't be
able to connect to the "notify" signal anyway, but it avoids a lot of
busy work.
2019-09-04 11:14:01 +01:00
Nelson Benítez León
ce7e99ca5e tooltips: hide tooltips before showing popups
because if there's a tooltip visible then popups fail to show
with the following warning:
"Gdk-WARNING **: Tried to map a popup with a non-top most parent"

This bug affect popups of the form:
 1) popups from gtk_menu_popup_{at_widget|at_rect|for_device}()

    This can be reproduce with a normal GtkComboBox that has a
    tooltip attached (eg. via GtkBuilder 'tooltip_text' attribute).
    Also see GtkLabel reproducer from gtk3-demo mentioned in #1785

 2) custom popups created with gtk_window_new (GTK_WINDOW_POPUP)

    A reproducer that shows this case is a GtkComboBox with
    the property 'appears-as-list'[1] set to TRUE (default is FALSE).

Fixes issue #1785

[1] https://developer.gnome.org/gtk3/stable/GtkComboBox.html#GtkComboBox--s-appears-as-list
2019-09-03 20:01:20 -04:00
Matthias Clasen
3f63656630 css: Support PANGO_WEIGHT_ULTRAHEAVY
The CSS fonts spec allows values between 1 and 1000,
so we can support Pangos ultraheavy weight (= 1000).
2019-09-03 17:12:03 -04:00
Matthias Clasen
d2bd63e455 Merge branch 'mingw-iconcache-use-correct-fstat' into 'gtk-3-24'
gtkiconcache: use _fstat64 under 64bit mingw to match GStatBuf

See merge request GNOME/gtk!1067
2019-09-03 20:17:24 +00:00
Matthias Clasen
340c62ecd6 Merge branch 'issue1044' into 'gtk-3-24'
Fix resize requests being forgotten when maximizing a hidden window

See merge request GNOME/gtk!367
2019-09-03 15:43:07 +00:00
Nelson Benítez León
de99b2f0b8 Fix popovers not restablishing default widget
Popovers have special handling to restablish
the previous 'default' and 'focused' widget,
that code it's in the map() unmap() handlers
in gtk/popover.c .

But, at the same time, GtkWindow also does
automatic restablishing of previous 'default' and
'focused' widgets, that's in _gtk_window_unset_focus_and_default()
function in gtk/gtkwindow.c which is called from
gtk_widget_hide() in gtk/gtkwidget.c .

So, when a popover is closed, both code-paths are
executed, conflicting with each other and resulting
in the popover failing to properly restablish the
default widget.

The commit that introduced _gtk_window_unset_focus_and_default()
to gtkwindow.c is from 2002 (commit ff9c2c5669) so
it predates by far the popover.c implementation,
therefore the rationale thing to do here is to exempt
popovers from being handled in _gtk_window_unset_focus_and_default()
(as that function is oblivion to the fact that
popovers have their own handling).

So, this commit exempts popovers from being handled
in the aforementioned function, but only for
the 'default' widget part atm, because although
by the previous rationale we should exempt it
from the 'focused' widget part too, I could not
find a bug in the issue tracker about that, so
instead we just exempt the 'default' widget part
that we know for sure it fixes issue #2125

Fixes issue #2125
2019-09-01 13:50:39 -04:00
Nelson Benítez León
58f57aeb3b popover: fix focus when inside an unfocused window
Fix popovers to properly gain focus when clicked
inside an unfocused window.

We use the GTK_PHASE_CAPTURE of the 'pressed' event
to early detect that the popover is being clicked
inside an inactive window, this allow us to present
the window (and be focused) before the normal signal
handlers for the popover click/pressed events are run
which would ultimately give focus to popover widget.

This fix works for both modal and 'non modal' popovers
when being clicked inside unfocused windows.

Fixes issue #1871
2019-08-30 21:26:08 -04:00
Christoph Reiter
8809fab111 gtkiconcache: use _fstat64 under 64bit mingw to match GStatBuf
With the switch to meson we no longer built with _FILE_OFFSET_BITS which
results in fstat being the 32 bit variant, not matching GStatBuf, which is
_stat64 on 64bit mingw builds.

This makes things use _fstat64 in this case, to match GStatBuf.
2019-08-26 20:13:48 +02:00
Christoph Reiter
31a57fe389 Drop the mir backend
It depends on libcontent-hub-glib which was dropped from Ubuntu in mid 2017:
https://bugs.launchpad.net/ubuntu/+source/content-hub/+bug/1712874

It was patched downstream to still build until it was disabled at the beginning
of 2018: https://launchpad.net/ubuntu/+source/gtk+3.0/3.22.28-1ubuntu3

This likely means no one has built gtk with mir in 2 years, and there is no plan
to change that, so just remove it.
2019-08-25 22:46:28 +02:00
Matthias Clasen
8f955baf93 Merge branch 'gtk-3-24' into 'gtk-3-24'
gtkprintbackend:backend_create: avoid strdup+free (3.24)

See merge request GNOME/gtk!996
2019-08-25 12:03:03 +00:00
Benjamin Otte
bc1c0584b7 a11y: Include window management buttons in headerbar 2019-08-15 13:09:07 +02:00
Nelson Benítez León
aff5c7ede6 filechooser: keep file selected after being renamed
Because otherwise when the file list is sorted "by name"
and the new name causes the file to be re-sorted to another
row, the selection stays in the old row which is now
occupied by a different file.

Fixed by keeping track of the renamed file and revealing
it in the "row-changed" signal handler, which gets emitted
after a file is renamed.

Fixes issue #948
2019-08-12 16:24:35 -04:00
Jonas Ådahl
77bc2dc87c gtk/icon-theme: Handle lack of SVG loader gracefully
When loading a SVG icon from a gresource file only containing SVG icons,
but without having a SVG loader available in gdk-pixbuf, we would crash
when trying to eventually load the resource. Fix this by gracefully
handling this by simply failing to load the icon, while the first time
it happens, log a warning.

https://gitlab.gnome.org/GNOME/gtk/issues/2084
2019-08-08 09:05:17 +02:00
Benjamin Otte
1d1059550c menu: Modernize code
No functional changes, just don't call valist functions anymore.
2019-08-07 13:32:49 +03:00
Luca Bacci
6dc2f6f026 GtkStatusIcon/w32: Also set the tooltip on taskbar_created_msg
When explorer.exe creates a taskbar it broadcasts a "TaskbarCreated"
message to all toplevels. Applications, By handling that message,
are able to re-create the icons to be displayed in the taskbar.

Explorer creates a new taskbar in two circumstances:
A) when explorer starts up
B) when the DPI of the monitor changes

A) happens either when explorer.exe is started for the first time at
   logon, or when it is restarted after being terminated.
B) happens when the user changes the DPI preference of the active
   monitor where the desktop is displayed, or if the desktop is moved
   to a monitor with different DPI.

Currently, this message is handled in Gtk and icons are re-created.
However the current implementation has a small issue in that it
doesn't set the tooltip on the new icons, so tooltips get lost
after re-creation.

The tooltip is important because Windows uses it for identification
of taskbar icons and for storing and applying user preferences. For
an explanation of that see:
https://bugzilla.gnome.org/show_bug.cgi?id=609622

With this commit the tooltip is correctly applied to new taskbar
icons when handling taskbar_created_msg.

See Merge Request !1003
2019-08-02 16:58:25 +00:00
Matthias Clasen
f26b5c8d80 Merge branch 'wip/jimmac/osd-color' into 'gtk-3-24'
Adwaita: increase opacity for OSD bg

See merge request GNOME/gtk!1040
2019-08-02 12:30:10 +00:00