Commit Graph

1151 Commits

Author SHA1 Message Date
Martin Stransky
c2b677a91d Bug 1410894 - Load CSD config from nsLookAndFeel, r=jhorak
Make CSD setup and titlebar drawing available when users enable it by preference and also it's available on running system.

MozReview-Commit-ID: 4BLgzVWwX1R

--HG--
extra : rebase_source : 15293821b9962bd9d0ee22331e7fad9027a47a7a
2017-10-23 21:28:47 +02:00
Martin Stransky
6a4c5abeaf Bug 1410894 - Add decoration drawing setup to nsWindow, r=jhorak
MozReview-Commit-ID: BHtqoOdfRpS

--HG--
extra : rebase_source : 4baaebff7e86d79de833e14c9284adc22a787180
2017-10-27 11:19:08 +02:00
Martin Stransky
617b41cac0 Bug 1410885 - Implement border/padding helpers, r=jhorak
MozReview-Commit-ID: 24WU58W43n6

--HG--
extra : rebase_source : efcb94b91790cd3fb4924ffcee2f33baa2c00826
2017-10-23 15:16:02 +02:00
Botond Ballo
02ae35c9e1 Bug 1400238 - Notify TabParent when the GTK client offset changes. r=karlt
MozReview-Commit-ID: 1TacAhl6c2M

--HG--
extra : rebase_source : 5641d417a6245cc2f8027fd91032119f1b36d461
2017-10-18 13:29:47 -04:00
Sebastian Hengst
d341bac932 Backed out changeset 7636f668f84e (bug 1403690) 2017-10-23 22:05:05 +02:00
Brad Werth
6595065d11 Bug 1403690 Part 4: gtk rearrange header and implementation to keep init and refresh functions together. r=karlt
MozReview-Commit-ID: ERsI916e7zf

--HG--
extra : rebase_source : 6e01cb852a05db87ebe7961773703ead9aee8a57
2017-10-10 14:12:47 -07:00
Sebastian Hengst
a994da18d5 Backed out changeset 349f51081127 (bug 1403690) 2017-10-23 18:21:09 +02:00
Brad Werth
6c5f60148b Bug 1403690 Part 4: gtk rearrange header and implementation to keep init and refresh functions together. r=karlt
MozReview-Commit-ID: ERsI916e7zf

--HG--
extra : rebase_source : 580f72faf7b748644b7d2e25872eb57b929a6be1
2017-10-10 14:12:47 -07:00
Martin Stransky
798f390d6b Bug 1409493 - Load actual CSD config from Gtk+, r=jhorak
MozReview-Commit-ID: GVHGXEk4IN

--HG--
extra : rebase_source : 349fd047f87db10aa3a83404e49552336022d009
2017-10-17 21:19:48 +02:00
Martin Stransky
b8ceb20909 Bug 1409493 - Implement CSD entries for Gtk+ LookAndFeel module, r=jhorak
MozReview-Commit-ID: CXsy9dhgMB9

--HG--
extra : rebase_source : 09265a59b17c612652ac048328681a8098c86846
2017-10-17 21:17:32 +02:00
Martin Stransky
64bb4e051b Bug 1186967 - ignore double-click on WM without _NET_WM_MOVERESIZE support, r=jhorak
MozReview-Commit-ID: 2Vs6i5leero

--HG--
extra : rebase_source : d8f2bbaf9ef9b2025478f029a68ee7e87e07de79
2017-10-17 09:50:18 +02:00
Martin Stransky
bfa8fde631 Bug 1364843 - Implement MOZ_GTK_HEADER_BAR* theme entries, r=jhorak,karlt
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: DTVePe1R563

--HG--
extra : rebase_source : 23bea31b34ed95301f840726a1f70378764fdea4
2017-09-19 21:22:45 +02:00
Martin Stransky
984f2babc2 Bug 1364843 - Implement drawing and size query of MOZ_GTK_HEADER_BAR*, r=jhorak
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: 2d8BgLyOS5u

--HG--
extra : rebase_source : ff4aa230b22a3ae478211330b09f239f36705e12
2017-09-19 21:15:12 +02: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
Martin Stransky
3af9407ecc Bug 1364843 - Added WidgetNodeType entries for GtkHeaderBar implementation, r=jhorak,jimm,karlt
Based on patch by Andrew Comminos [:acomminos] <andrew@comminos.com>

MozReview-Commit-ID: GA3CDhCeqfD

--HG--
extra : rebase_source : 0bdccafcfbd84475442503abb6b2e11b6670c37d
2017-09-19 18:24:13 +02:00
Jan Horak
165fab2f85 Bug 1381815 - fixing dimensions of radio and checkbox for GTK 3.20+; r=karlt
In the GTK < 3.20 the size of radio and checkbox toggle is determined by indicator
spacing and indicator size. By  GTK 3.20+ it is replaced by standard box model
(padding, margin, border). The patch fixes that while keeping the functionality
for older GTK. The values are also cached by similar way as scrollbar metrics
are cached now.

The focus is no longer rendered by GTK but by Mozilla code, so the extra
size for toggles has been removed from GetExtraSizeForWidget and toggles
no longer render focus indicator.

MozReview-Commit-ID: 1Wg5AgHy1Vz

--HG--
extra : rebase_source : 81437f45b7d32555942d21fccc9de4a561d85111
2017-10-10 13:35:56 +02:00
Brendan Dahl
72ed58e8b8 Bug 1399956 - Add basic hard coded GTK theme in headless. r=jrmuizel
Many tests rely on the minimum size of widgets to
be set. Also, the precise size seems to matter for some
tests that have hard coded offsets.

MozReview-Commit-ID: BglZD1cKdY9
2017-10-16 16:15:45 -07:00
Mantaroh Yoshinaga
bea6d05b62 Bug 1185236 - Shorten print job name when GTK version is older than 3.18.2. r=karlt
Since GTK 3.18.2, GTK allows setting job name with more than 255 bytes.
As result, CUPS received the IPP error. (RFC 2911, Section 4.3.1)

This patch will shorten print job name, if runtime GTK version is older than 3.18.2.

MozReview-Commit-ID: EfB87Bvo6hX

--HG--
extra : rebase_source : a070e99c783c471a7bf7d00efb3cc997ff617a5e
2017-10-13 15:48:39 +09:00
Phil Ringnalda
bcec55eabf Backed out 4 changesets (bug 1185236) for Windows build bustage
CLOSED TREE

Backed out changeset eda76603d637 (bug 1185236)
Backed out changeset 2cbe403d5c16 (bug 1185236)
Backed out changeset 0466471b9f67 (bug 1185236)
Backed out changeset 445f1e6fc862 (bug 1185236)

MozReview-Commit-ID: 2nL4nUNNhcs
2017-10-12 19:50:07 -07:00
Mantaroh Yoshinaga
0c17c70a15 Bug 1185236 - Shorten print job name when GTK version is older than 3.18.2. r=karlt
Since GTK 3.18.2, GTK allows setting job name with more than 255 bytes.
As result, CUPS received the IPP error. (RFC 2911, Section 4.3.1)

This patch will shorten print job name, if runtime GTK version is older than 3.18.2.

MozReview-Commit-ID: EfB87Bvo6hX

--HG--
extra : rebase_source : f502cd49b128aecce4d8268783377c46a63ad669
2017-10-13 09:46:39 +09:00
Sebastian Hengst
f7efb5fc2c Merge mozilla-central to mozilla-inbound. r=merge a=merge on a CLOSED TREE 2017-10-12 12:03:15 +02:00
Nicholas Nethercote
c0a1cf9b49 Bug 1407103 - Convert wstring attributes to AString in widget/nsIPrint*.idl. r=bobowen.
This avoids a lot of mismatches between nsAString and char16_t*, thus removing
many getter_Copies() and ToNewUnicode() and get() calls, and generally making
things simpler.

Note: the patch removes GetDefaultPrinterNameFromGlobalPrinters() by simply
inlining it at its two callsites, which is easy with the changed types.

--HG--
extra : rebase_source : 9ab9b3694f093fc9b22c7f8e2394a98674d76c11
2017-10-09 10:08:09 +11:00
Emilio Cobos Álvarez
e808575ca4 Bug 1406631: Remove the color-picker-available system metric. r=xidorn
All our widgets support it with a constant true.

MozReview-Commit-ID: JMEItUsxYWq

--HG--
extra : rebase_source : e7e0a3f83001813239338bc5b3895252e1fb3ea6
2017-10-07 14:06:44 +02:00
Ryan Hunt
979b5671a6 Bug 1407001 - Don't reset compositors for composited changed callback when GPUProcessManager is null. r=lsalzman
MozReview-Commit-ID: 4E31bt3Rzkz

--HG--
extra : rebase_source : 84a18ffcc77f37220284679c1dbb916a25524d31
2017-10-09 12:49:53 -05:00
Sebastian Hengst
aa78440a09 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: EE6DcCgHufi
2017-10-09 11:19:20 +02:00
Nicholas Nethercote
8a68e6fb83 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Nicholas Nethercote
d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Sebastian Hengst
b29f365446 Backed out changeset f70d6fcdb760 (bug 1406631) for failing color related reftests like layout/reftests/writing-mode/ua-style-sheet-input-color-1.html on Android. r=backout 2017-10-07 20:08:12 +02:00
Emilio Cobos Álvarez
b7befbe6b5 Bug 1406631: Remove the color-picker-available system metric. r=xidorn
All our widgets support it with a constant true.

MozReview-Commit-ID: JMEItUsxYWq

--HG--
extra : rebase_source : a2661dce1ac191fdf098e631cd7878f0215643d5
2017-10-07 14:06:44 +02:00
Chris Coulson
4bb5b5c2f6 Bug 1405267 - Don't stub gdk_window_get_window_type in mozgtk2. r=karlt
--HG--
extra : amend_source : 3be7b98361af506cbf1fc0febd0c7c431a520cd0
2017-10-03 04:58:00 -04:00
Lee Salzman
83b1549723 Bug 1404323 - limit WindowSurfaceX11Image::Commit to clip bounds. r=gankro
MozReview-Commit-ID: 55GbZ2EHdbQ
2017-09-29 23:59:40 -04:00
Brad Werth
fb488ded4b Bug 1401063: Cache remaining gtk window and button colors to eliminate on-demand gtk calls in ::NativeGetColor. r=karlt
MozReview-Commit-ID: HbZqBUG0w7y

--HG--
extra : rebase_source : 0b26c22113c2cda49129006fe933f20719b7a679
2017-09-19 13:00:28 -07:00
Wes Kocher
519bb0922b Merge inbound to central, a=merge
MozReview-Commit-ID: EK8iFR1hSRp
2017-09-18 16:21:01 -07:00
Ryan Hunt
5823900855 Bug 1397083 - Don't use CopySurface when drawing theme with nsNativeThemeGTK. r=lsalzman
CopySurface doesn't respect any existing clips that are applied to the draw
target. It doesn't look like nsNativeThemeGTK uses CopySurface normally, but
when OMTP is enabled the draw target is a DrawTargetCapture which can't
LockBits() which causes us to use CopySurface. This can cause a reftest failure.

MozReview-Commit-ID: 1mYMhQB0r3M

--HG--
extra : rebase_source : d2683dee37ce32049d8daeee786cbb06ba624438
extra : amend_source : 59c48b66f733108636d52047a55889ee0c4e2746
2017-09-13 15:03:34 -04:00
Nicholas Nethercote
ebf1cb320b Bug 1400148 - Don't use -1 to represent an unset nsCursor. r=karlt.
Because UBSan complains about casting -1:

> runtime error: load of value 4294967295, which is not a valid value for type 'nsCursor'

--HG--
extra : rebase_source : 037a96700228ea0d427afa7c25c40490c701cdc4
2017-09-15 14:34:37 +10: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
Karl Tomlinson
648484651d bug 1384701 get system fonts in EnsureInit() which is on main thread even with servo r=manishearth
GTK should be used only from the main thread, but the specific symptom before
this change was that creating a GtkEntry causes
pango_cairo_font_map_get_default() to be called.  This function returns a
different font map on each thread.  The font map is leaked when StyleThreads
are leaked at exit.

Font caches are usually expensive and so using the existing font map on the
main thread is preferable.

A GtkEntry already exists on the main thread, as well as style contexts for
most other system fonts, and so it is more efficient to create these on the
main thread while the style contexts exist.

Doing this also avoids the need for Gecko_nsFont_InitSystem() to hold a global
lock to avoid concurrently calling into GTK through LookAndFeel::GetColor().

MozReview-Commit-ID: DSOwEUeYmtV

--HG--
extra : rebase_source : 971bc565e465b2d2482308006f68451ecaa6e264
2017-09-04 18:29:04 +12:00
Karl Tomlinson
645192c7d9 bug 1384701 get system font name and size from widget style context instead of GtkSettings r=manishearth
gtk_widget_get_settings() returns the same settings for all widgets [1] but
GTK actually uses specific fonts for each widget [2].

[1] https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?h=3.22.19#n11637
[2] https://git.gnome.org/browse/gtk+/tree/gtk/gtkwidget.c?h=3.22.19#n10334

Changing to GtkStyleContext* will also make this easier to use from code where
the GtkStyleContext exists but not the GtkWidget, such as EnsureInit() in a
future patch.

MozReview-Commit-ID: 3NuTL5wRzm5

--HG--
extra : rebase_source : 8ca2ae009bdf4b15a82106425c98b6be786ad27b
2017-09-04 21:33:21 +12:00
Karl Tomlinson
f800034d87 bug 1384701 remove MOZ_WIDGET_GTK == 2 code from nsLookAndFeel r=manishearth
This old code no longer builds and is superseded by the GTK3 port.
See also bug 1278282.

MozReview-Commit-ID: 9KyrPuNAluv

--HG--
extra : rebase_source : 8d5de061743e0281bf4ed03c68286512e7b492e9
2017-09-04 17:36:17 +12:00
Masayuki Nakano
1166607c92 Bug 1387357 - IMContextWrapper::DispatchCompositionStart() should stop dispatching eCompositionStart if dispatching preceding eKeyDown event causes changing active IM context r=m_kato
If a keydown event handler moves focus like Ctrl+PageDown handler, IM context
may be changed to DISABLED or something.  In such case, native IME would stop
current composition because focus moving in Gecko causes making IME blurred.
However, IMContextWrapper::DispatchCompositionStart() always dispatches
eCompositionStart even in such case.

So, it should stop dispatching eCompositionStart if IME enabled state is
changed during dispatching the preceding keydown event.

Note that this patch moves the setter of mComposingContext from
OnStartCompositionNative() which is a signal listener of "preedit_start" to
DispatchCompositionStart() because if IME starts composition without
"preedit_start" signal, DispatchCompositionStart() will be called but
OnStartCompositionNative() isn't called.  However, this fix needs
mComposingContext.

MozReview-Commit-ID: F3F6NuCOrkJ

--HG--
extra : rebase_source : 513528eba0f29eb9b6ce8c5f47e4badbde9cbdb8
2017-09-04 20:18:43 +09:00
Alastor Wu
6a6ee2a0d7 Bug 1373888 - part3 : rename the topic of the wake lock. r=cpearce
For knowing the wake lock usage more clearly, we should use more specific topic name.

In OSX, you can use "$ pmset -g assertions" to check all the wakelock.
In Windows, using "$ powser -energy" to generate the energy report.

MozReview-Commit-ID: rAXnkxTvLc

--HG--
extra : rebase_source : 42ebf204673d3c913739f64c71c24af20d37c95d
2017-08-29 10:54:28 +08:00
Martin Stransky
4cb65b6801 Bug 1314928 - get link text color by GTK_STATE_FLAG_LINK on Gtk3 >= 3.12, r=karlt
MozReview-Commit-ID: BPR2AgoUx5H

--HG--
extra : rebase_source : c4670cd6b7df84dd00a4d04c3bfc582f917795da
2017-08-25 10:30:28 +02:00
Sebastian Hengst
ef86d4676d Backed out changeset 1f349caf1814 (bug 1314928) for bustage at widget/gtk/nsLookAndFeel.cpp:47: invalid conversion from 'int' to 'GtkStateFlags'. r=backout on a CLOSED TREE 2017-08-25 10:51:20 +02:00
Martin Stransky
572cfb016f Bug 1314928 - get link text color by GTK_STATE_FLAG_LINK on Gtk3 >= 3.12, r=karlt
MozReview-Commit-ID: BPR2AgoUx5H

--HG--
extra : rebase_source : ad688e0f6cbabcc64ebb62f2386f8346b3860855
2017-08-25 10:30:28 +02:00
Nicholas Nethercote
f582d96b98 Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm.
This is straightforward, with only two notable things.

- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
  throughout, because all nsXPIDLString.h did was include nsString.h. The
  exception is for files which already include nsString.h, in which case the
  patch just removes the nsXPIDLString.h inclusion.

- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
  cover some of its ground, e.g. testing Adopt(nullptr).

--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
2017-08-17 15:29:03 +10:00
Nicholas Nethercote
8a72cf2251 Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm.
--HG--
extra : rebase_source : 69d58b0cfb56efc6b03d8e2d7be2ce3c3e6cd843
2017-08-21 20:01:27 +10:00
Ryan Hunt
95c23d28b7 Bug 1377950 - Reset all compositors when GdkScreen "composited-changed" fires. r=karlt
MozReview-Commit-ID: 3vva2XgSa60

--HG--
extra : rebase_source : 099a54f38695a7a88d5ca3a0dfc8cb948bfffb63
2017-08-11 02:52:08 -05:00
Masatoshi Kimura
5b97708fef Bug 1387800 - Remove [deprecated] nsIFilePicker.show(). r=qdot
MozReview-Commit-ID: 81ZkeYdSPVW

--HG--
extra : rebase_source : 2f30565b8d5986ef6265027562f9842d0db2688e
2017-08-06 13:15:31 +09: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