Граф коммитов

97 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez e4b1b9e37b Bug 1716462 - Minor WidgetStyleCache cleanup. r=stransky
We always support these functions, so no need to use dlsym. The csd type
technically depends on the theme I think, so caching it globally is
wrong. Instead compute it once and pass it down to the two callers that
care about it.

Differential Revision: https://phabricator.services.mozilla.com/D117722
2021-06-16 17:02:08 +00:00
Dorel Luca b5d072edbd Backed out 2 changesets (bug 1716462) for Build bustages. CLOSED TREE
Backed out changeset da9c8170a934 (bug 1716462)
Backed out changeset 42abdfd99cb4 (bug 1716462)
2021-06-16 18:50:02 +03:00
Emilio Cobos Álvarez cbe629b48c Bug 1716462 - Minor WidgetStyleCache cleanup. r=stransky
We always support these functions, so no need to use dlsym. The csd type
technically depends on the theme I think, so caching it globally is
wrong. Instead compute it once and pass it down to the two callers that
care about it.

Differential Revision: https://phabricator.services.mozilla.com/D117722
2021-06-16 14:35:28 +00:00
Emilio Cobos Álvarez e2075d6bdd Bug 1710643 - Remove support for unused gtk infobar widget and colors. r=stransky
Presumably they were for notifications and now we use native notifications?

Differential Revision: https://phabricator.services.mozilla.com/D114874
2021-05-12 19:13:21 +00:00
Emilio Cobos Álvarez 6a5a33b978 Bug 1705877 - Add support for scaled cursors on GTK. r=stransky
I had overlooked the way to achieve this. This is possible using cairo
surfaces, but they only support integer scale factors, so we ceil and
potentially rasterize the image to a bigger size if needed.

Differential Revision: https://phabricator.services.mozilla.com/D112477
2021-04-21 09:28:55 +00:00
Martin Stransky 3fd5700719 Bug 1652220 [Linux] Create titlebar style from actual widget, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D98597
2020-12-04 15:47:30 +00:00
Emilio Cobos Álvarez 2d4dbdf603 Bug 1654323 - Use GtkTextView.text.selection to get selection colors in GTK. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D84814
2020-09-15 06:59:14 +00:00
Martin Stransky 9267c87394 Bug 1651748 [Linux] Add CSD decoration size to size constraints, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D86833
2020-08-19 06:14:01 +00:00
Simon Giesecke 1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00
Robert Mader 0d74f2d95f Bug 1617002 - Remove checks for unsupported GTK3 versions. r=stransky
Cleans up the code a bit to make actually used fallback code easier to spot
and update the required GTK version so deprecation warnings are more accurate.

Also make `gdk_window_set_opaque_region` always available - we can now assume
it to be present in all supported versions.

Differential Revision: https://phabricator.services.mozilla.com/D82804
2020-07-20 15:43:30 +00:00
Emilio Cobos Álvarez 3979b00e89 Bug 1645996 - Add explicit namespace qualification for MakeSpan in WidgetStyleCache.
Differential Revision: https://phabricator.services.mozilla.com/D79801
2020-06-16 10:25:18 +00:00
Emilio Cobos Álvarez 57880152d6 Bug 1643474 - Cleanup and validate input in button layout placement code. r=stransky,smurfd
It is not clear whether this is the cause of the crash, but it seems
plausible as it is both recent code and it clearly doesn't validate the
length of the stack-allocated buffer, so a bad gconf could plausibly
cause this.

Clean stuff up a bit and validate the buffer length.

Differential Revision: https://phabricator.services.mozilla.com/D78405
2020-06-05 10:02:58 +00:00
Nicklas Boman c6d034eba4 Bug 1432090 - [CSD] Button layout not according to settings - Widget background work r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73453
2020-05-24 09:22:58 +00:00
Jonathan Watt 5039526672 Bug 1634154. Make `widget/gtk` buildable outside of `unified-build` environment. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D73123
2020-05-01 03:02:13 +00:00
Martin Stransky 9f5f941f67 Bug 1621258 [Wayland] Don't print 'Missing GtkWidget' warning, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D66221

--HG--
extra : moz-landing-system : lando
2020-03-10 16:39:24 +00:00
Martin Stransky f0afedd24a Bug 1617858 [Linux/Gtk] Don't use a fallback widget when it's missing, r=jhorak
With Bug 1613130 fixed we may not need a fallback widget so let's remove this workaround.

Differential Revision: https://phabricator.services.mozilla.com/D64052

--HG--
extra : moz-landing-system : lando
2020-02-25 13:32:47 +00:00
Martin Stransky a61d164b44 Bug 1613130 [Linux] Check that we have gtk_style_context_set_scale() and style, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D63390

--HG--
extra : moz-landing-system : lando
2020-02-24 08:48:35 +00:00
Martin Stransky 272e06b7b9 Bug 1614421 [Linux] Use GtkInvisible as a fallback widget, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D62412

--HG--
extra : moz-landing-system : lando
2020-02-11 11:10:14 +00:00
Martin Stransky 7e1d1d675d Bug 1613130 [Linux] Use GtkWindow as a fallback if a particular GtkWidget is missing, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D61633

--HG--
extra : moz-landing-system : lando
2020-02-05 15:29:23 +00:00
Martin Stransky 076504629d Bug 1600414 [Wayland] Use GTK_WINDOW_TOPLEVEL and actual header bar to create Gtk titlebar css style, r=jhorak
- Create header bar at GTK_WINDOW_TOPLEVEL
- Use actual header bar widget as window titlebar because gtk_window_set_titlebar() sets "csd" and "solid-csd" styles.
  We need to read the styles to get correct decoration type.

Differential Revision: https://phabricator.services.mozilla.com/D59850

--HG--
extra : moz-landing-system : lando
2020-01-14 14:21:22 +00:00
Martin Stransky 84047030d3 Bug 1546658 - Clean up MOZ_GTK_DROPDOWN_ENTRY at widget style cache, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D29252

--HG--
extra : moz-landing-system : lando
2019-04-30 08:25:24 +00:00
Sylvestre Ledru 96da5036ad Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D28948

--HG--
extra : moz-landing-system : lando
2019-04-28 09:30:05 +00:00
Martin Stransky a8d915f450 Bug 1319838 - [Linux/HiDPI] Set scale factor on styles created at WidgetStyleCache, r=jhorak
Call gtk_style_context_set_scale() on styles created by WidgetStyleCache module on Gtk 3.20+
Also modify moz_gtk_widget_paint_* routines to pass the scale info to CreateStyleContext()
from WidgetStyleCache.

Differential Revision: https://phabricator.services.mozilla.com/D28466

--HG--
extra : moz-landing-system : lando
2019-04-25 13:18:49 +00:00
Martin Stransky 8ddc948f81 Bug 1433667 - Honour system titlebar button left/right placement, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D16466

--HG--
extra : moz-landing-system : lando
2019-01-18 13:52:29 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jonathan Watt b5bfd3a7ea Bug 1505316 p2. Rename aWidgetType to aAppearance in widget code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D11156

--HG--
extra : rebase_source : c908a6d6419c6462453cb8b745effc583d767902
extra : source : 07e12bc71a8d96b52b1a1bbc8dc7545ae4454a4f
2018-10-24 16:24:57 +01:00
Jonathan Watt 3922f1cb96 Bug 1500423. Make '-webkit-appearance: menulist-textfield' behave like Chrome. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D9339

--HG--
extra : rebase_source : afa3c037857838be2e18d4b47eaf64d318747de7
2018-10-19 18:12:15 +01:00
Martin Stransky 7e77a65a6b Bug 1492764 - Set .left class to headerbar box element as Gtk+ does, r=jhorak
Gtk+ sets .left/.right classes to GtkBox element at GtkHeaderBar according to button placement (left/right).
We don't support that now so set .left at least to be compatible with themes - BlueMenta for instance.

Differential Revision: https://phabricator.services.mozilla.com/D6657

--HG--
extra : moz-landing-system : lando
2018-09-25 08:51:40 +00:00
Martin Stransky 7aca24afe9 Bug 1489499 - Don't call gtk_header_bar_get_decoration_layout() to get titlebar layout, r=jhorak
We don't set gtk_header_bar_set_decoration_layout() so we don't need to query the layout
by gtk_header_bar_get_decoration_layout(). That means we don't need to create the GtkHeaderBar
at startup when titlebar rendering is disabled.

Also unify window/header bar construction at CreateHeaderBarWidget() and assert when the widgets
are already created.

Differential Revision: https://phabricator.services.mozilla.com/D5417

--HG--
extra : moz-landing-system : lando
2018-09-11 08:56:13 +00:00
Martin Stransky 30b73cfa58 Bug 1408360 - Create GtkHeaderBar widget at once, r=jhorak
To get correct style of GtkHeaderBar widget we need to get style of fully
occupied widget with child buttons.

When GtkHeaderBar Gtk+ style is requested create also all child elements
and then return the style.

Differential Revision: https://phabricator.services.mozilla.com/D4663

--HG--
extra : moz-landing-system : lando
2018-09-06 11:52:19 +00:00
Martin Stransky 81b1272512 Bug 1456898 - Implement and use solid-csd decoration style to get window offset when solid-csd is used by mShell toplevel window, r=jhorak
Implement and use solid-csd decoration style to get window offset when solid-csd is used by mShell toplevel window.
Also does not apply margin (resize handler sizes) on popup window as well as Gtk+ do in get_shadow_width().

MozReview-Commit-ID: 9xozp9CCVJj

--HG--
extra : rebase_source : 687993d60b8f2063ed31f07ba2d7ab9f1faa09c8
2018-04-26 13:55:41 +02:00
Martin Stransky efb19d9d96 Bug 1441665 - [Gtk] Update window offset explicitly when titlebar is disabled in CSD mode, r=jhorak
When system titlebar rendering is disabled and we're in CSD window mode, the window decorations are
rendered by client (application/Gtk) and we don't get _NET_FRAME_EXTENTS property (decoration size) update
for our toplevel window.

So we need to calculate the decoration/shadow size as Gtk+ does, we emulate get_shadow_width()
which is not exported by Gtk+.

MozReview-Commit-ID: K7o2rUPt6Yc

--HG--
extra : rebase_source : 86a3f12e760194b5828afed784f6aa02c352e017
2018-04-24 10:10:16 +02:00
Martin Stransky a1bb7c1c32 Bug 1355143 - Implement CreateStyleContextWithStates to style with fully stated css path, r=jhorak
MozReview-Commit-ID: ENWBekzq4Oq

--HG--
extra : rebase_source : 6c6c63af840629d5454166dba9e074d9c72b0371
2018-04-18 11:03:39 +02:00
Martin Stransky 0a0c720a69 Bug 1443481 - [Linux/Titlebar] Construct widget tree to get correct titlebar icon style before we render the actual icon, r=jhorak
MozReview-Commit-ID: DEb2pU31os9

--HG--
extra : rebase_source : f68034829b16c9def34436dc6e33b393865348bc
2018-03-06 16:45:19 +01:00
Martin Stransky 066945c7bc Bug 1434646 - Titlebar rendering - Place titlebar buttons in GtkBox, r=jhorak
Some themes (Ambiance for instance) uses first-child/last-child css selectors
to style titlebar buttons. Ubuntu Ambiance theme places titlebar buttons closer
by negative margin applied to them.

We put titlebar buttons to GtkBox as well as Gtk+ does and also keep
the button order here to match first-child/last-child selectors. It also means
we must have maximize/restore as one button to keep the correct order.

MozReview-Commit-ID: 9mqljOa4Vu7

--HG--
extra : rebase_source : 9c31a2073d1bb247ce9d0240333143661b8ae4b8
2018-02-23 21:28:37 +01:00
Martin Stransky fb13e4d63d Bug 1433068 - Titlebar/Linux - load and draw HiDPI titlebar icons on HiDPI screens, r=jhorak
MozReview-Commit-ID: KxbBvf6mgo1

--HG--
extra : rebase_source : f1c3b083d4e83684b1046a3c439d802de6547c21
2018-02-20 16:16:23 +01:00
Martin Stransky afa356a144 Bug 1408335 - Render titlebar icons as themed ones, r=jhorak
Render titlebar button icons as a part of -moz-window-button-* appearence. It allows us to
theme the icons accordingly. We add a GtkImage widget to header bar buttons as Gtk+ does and
store icon pixel data there and render it at moz_gtk_header_bar_button_paint() as a part
of the buttons. It means that the toolbar buttons are not containers and
moz_gtk_get_widget_border() returns zero border for them.

Also implement GetToolbarButtonMetrics() per button.

MozReview-Commit-ID: gkAu3VmE3q

--HG--
extra : rebase_source : d1df34537901342969d1e33524b414a2786df541
2018-01-25 11:13:12 +01:00
Martin Stransky 0594ae2db5 Bug 1427999 - Use GetToolbarButtonMetrics() to get correct titlebar button size at nsNativeThemeGTK::GetMinimumWidgetSize, r=jhorak
MozReview-Commit-ID: HfPUk30LaJn

--HG--
extra : rebase_source : ef406e78e686a6ae190a0fbdb9aa945e40503ac6
2018-01-22 12:09:09 +01:00
Sylvestre Ledru 2c6660f219 Bug 1278282 - Ride along Remove some trailing whitespaces r=lsalzman
MozReview-Commit-ID: 8W6VKIW8PQV

--HG--
extra : rebase_source : 23b5c300dd4bebe2b8808bdb03373073aab80b9f
2017-12-19 11:38:59 +01:00
Martin Stransky 2c1a8317ac Bug 1364843 - Allow MOZ_GTK_HEADER_BAR* widget creation, r=jhorak
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: 18U3GBrTyVW

--HG--
extra : rebase_source : 7a203d5c4d1856d24f08c2ea42ad4519d283ab73
2017-09-19 20:34:31 +02:00
Martin Stransky 089986546e Bug 1364843 - Implement GtkHeaderBar widgets at WidgetCache, r=jhorak
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: HzzXDqE0s5n

--HG--
extra : rebase_source : d929e03d7ab84229101b9c11cdb35396547860e4
2017-09-19 18:20:48 +02:00
Karl Tomlinson 00beb33110 bug 1396722 remove no-op ReleaseStyleContext() r=stransky+263117
MozReview-Commit-ID: DgKM0wrStrk

--HG--
extra : rebase_source : a26fdc5e5d6c63e21bb98a19ee7bf58042f9b3ba
2017-09-05 09:16:01 +12:00
Martin Stransky 9ed3f34e0f Bug 1389133 - don't invalidate style content for missing widgets, r=karlt
MozReview-Commit-ID: 2KfjYGvsiVv

--HG--
extra : rebase_source : 86984393bb22a7708089b5ed6da1201f9458e6e7
2017-08-10 18:07:41 +02:00
Karl Tomlinson 7f6c7692a4 bug 1365556 invalidate widget style contexts after their ancestors are set r=stransky+263117
Although this is only known to affect buttons with builtin child widgets, it
is difficult to audit all GTK widgets for similar situations, and so the same
defense is applied to all widgets.

MozReview-Commit-ID: LMVXX3UYqR9

--HG--
extra : rebase_source : d327addad8d2b0e070c6ca86c6e38271c8431a23
2017-08-01 09:17:46 +12:00
Karl Tomlinson fb0c2feb3e bug 1319650 mimic gtk_style_context_save() in WidgetStyleCache with a new context r=stransky+263117
This makes balancing with gtk_style_context_restore()/ReleaseStyleContext()
unnecessary, and the style resolution cached in the style contexts is not
invalidated so frequently.

MozReview-Commit-ID: BKwyqoQsjv2

--HG--
extra : rebase_source : 4733d66f8265007555cc17568033ece09e6cb2dc
2016-12-02 12:39:23 +13:00
Karl Tomlinson ff46e3c8cb bug 1362170 force a style resolution on context creation to set GTK 3.4 theming_engine r=stransky+263117
This works around a GTK bug that led to the default engine being used instead
for the first draw.

MozReview-Commit-ID: 4r48HNUgVBE

--HG--
extra : rebase_source : 83a964e02dba97cb0b52acde6b692d241c03ed57
2016-12-14 19:22:28 +13:00
Karl Tomlinson 9e1122a84a bug 1320860 adjust textarea style contexts for GTK 3.20 theming ABI changes r=stransky+263117+263117
MozReview-Commit-ID: JTQO5bK5Yvv

--HG--
extra : rebase_source : beb69dd204d7459eca52ad8f995f60651f3d6188
2016-12-30 13:44:55 +13:00
Karl Tomlinson 5f631b2b35 bug 1320860 introduce MOZ_GTK_TEXT_VIEW_TEXT and move MOZ_GTK_RESIZER to WidgetStyleCache r=stransky+263117+263117
The style context for MOZ_GTK_TEXT_VIEW is now created by copying from the
widget instead of caching a widget and using its context.

No rendering changes are expected, unless themes are animating GtkTextView
backgrounds.

MozReview-Commit-ID: 9aW61kMkKcb

--HG--
extra : rebase_source : 279c8b15e58c3f0fff51f41a4afacfebfbfa5739
2016-12-30 13:37:51 +13:00
Karl Tomlinson 2041039808 bug 1320860 Back out changeset a6aabcb07a6e for causing bug 1322120 or bug 1324262
--HG--
extra : rebase_source : c77a5627ebb851b3f70da2917c68b9ae3683247b
2016-12-29 18:05:42 +13:00
Karl Tomlinson 7aedf3100d bug 1323860 implement pre-3.20 MOZ_GTK_PROGRESS_CHUNK in WidgetStyleCache r=stransky
MozReview-Commit-ID: 1VOZKRw3gj4

--HG--
extra : amend_source : 4b1b21c8f0173b4968df7f2c46a7bd840f429ef0
2016-11-25 17:51:13 +13:00