Commit Graph

1225 Commits

Author SHA1 Message Date
Jonathan Watt
53631ea19f Bug 1425190 - Stop checking for GTK >= 2.24 in the printing code. r=karlt
MozReview-Commit-ID: CEvccM9YzgC
2017-12-08 09:44:17 +00:00
Jonathan Watt
b0ddef10f5 Bug 1425188 - Remove the ability to save as Postscript from the print dialog on Linux. r=karlt
Saving to PDF will now be the only option.

MozReview-Commit-ID: 9WIDws6lByG
2017-12-07 14:52:25 +00:00
Jan Steffens
00146cbcf0 Bug 1427520 - Stub gtk_widget_get_preferred_width/height in mozgtk2; r=karlt
MozReview-Commit-ID: HUMEwgcwioX

--HG--
extra : rebase_source : 8647f8bd01ba774b3c57cab93af1733a069067b2
2018-01-01 06:34:23 +01:00
Emilio Cobos Álvarez
c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez
ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez
c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Martin Stransky
82e67b3967 Bug 1425841 - Set up nsWindow configuration for Wayland rendering, r=jhorak
nsWindow needs configuration change when rendering on Wayland:

- Always draw to mContainer on Wayland as we can't create custom subsurface for
  mShell GdkWindow and listen events on mContainer then.
- GTK_WINDOW_TOPLEVEL can't be positioned on Wayland so create popup windows
  as GTK_WINDOW_POPUP to control window position on Wayland.
- Create ePopupTypeMenu GdkWindow as GDK_WINDOW_TYPE_HINT_UTILITY instead of
  GDK_WINDOW_TYPE_HINT_POPUP_MENU to create it as subsurface (Bug 1423598).
- Don't do pointer grab on Wayland (see Bug 1377084 for reference).

MozReview-Commit-ID: 6InzhTONtrD

--HG--
extra : rebase_source : 356112c2e8f80569ca4b2e41fa0747d71da21d89
2017-12-18 16:41:28 +01:00
Martin Stransky
7b19c8a8bf Bug 1425841 - Don't install popup_take_focus_filter on Wayland as it's X11 only, r=jhorak
MozReview-Commit-ID: DSzcmjwwrgw

--HG--
extra : rebase_source : de8c24c27db75512adedde8be5ad3bc48be1cc6d
2017-12-18 16:08:28 +01:00
Martin Stransky
42c9e879ff Bug 1425841 - Handle NS_NATIVE_DISPLAY/NS_NATIVE_SHAREABLE_WINDOW request on Wayland, r=jhorak
MozReview-Commit-ID: JijzpSuqVj3

--HG--
extra : rebase_source : a30714f775fbe11d06cbb5f8eb890dc36a7127aa
2017-12-18 16:06:47 +01:00
Martin Stransky
c1435cf451 Bug 1425841 - Implement GetWaylandDisplay() and GetWaylandSurface() needed by WindowSurfaceWayland, r=jhorak
MozReview-Commit-ID: Hlo1ceAIrL2

--HG--
extra : rebase_source : 3c3a5f4dc1dd8360a19c8160a85da5a5f6de3cac
2017-12-18 15:53:50 +01:00
Martin Stransky
5536f6f4ab Bug 1425841 - don't call gdk_x11_window_get_xid() at LOG() on Wayland, r=jhorak
MozReview-Commit-ID: BzIzqE2I3Si

--HG--
extra : rebase_source : c50ea8434ba9755a84ca449e72b9286929129f4a
2017-12-18 15:50:57 +01:00
Martin Stransky
da41393bd7 Bug 1425842 - Rename X11CompositorWidget to GtkCompositorWidget and implement WindowSurfaceWayland support, r=jhorak
- Rename X11CompositorWidget to GtkCompositorWidget to handle both X11 and Wayland backends.
- Rename X11CompositorWidgetInitData to GtkCompositorWidgetInitData
- Implement Wayland support at WindowSurfaceProvider, WindowSurfaceProvider::CreateWindowSurface()
  is able to create WindowSurfaceWayland.
- Initialize Wayland surface provider at nsWindow::Create()

MozReview-Commit-ID: 1WvR9nWHa3L

--HG--
rename : widget/gtk/X11CompositorWidget.cpp => widget/gtk/GtkCompositorWidget.cpp
rename : widget/gtk/X11CompositorWidget.h => widget/gtk/GtkCompositorWidget.h
rename : widget/gtk/InProcessX11CompositorWidget.cpp => widget/gtk/InProcessGtkCompositorWidget.cpp
rename : widget/gtk/InProcessX11CompositorWidget.h => widget/gtk/InProcessGtkCompositorWidget.h
extra : rebase_source : d54186515b066b957d8ad05bb5540db55f2e9415
2017-12-18 20:20:02 +01:00
Martin Stransky
72aad592e6 Bug 1426351 - WindowSurfaceWayland - delete WaylandDisplay owned by compositor thread at compositor thread, r=jhorak
MozReview-Commit-ID: 6jtdXuiTj1F

--HG--
extra : rebase_source : cc072ac276956e2f8299dcfef3934dc16dbfbeda
2017-12-20 14:18:18 +01:00
Martin Stransky
d64000898e Bug 1426377 - Assert when aImageDataSize is bigger than allocated pool size, r=jhorak
MozReview-Commit-ID: DSMb5W2bGd0

--HG--
extra : rebase_source : fa61d69b9ba0c8b353e4bc339460c163e194f9bc
2017-12-20 15:47:08 +01:00
Martin Stransky
3510d3872f Bug 1426384 - Don't use CSD_SUPPORT_FULL on Wayland unless it's overriden by MOZ_GTK_TITLEBAR_DECORATION, r=jhorak
Wayland compositors do not support GDK_DECOR_BORDER so use CSD decorations exclusively.

MozReview-Commit-ID: 8gzDcw2AumI

--HG--
extra : rebase_source : 4d319155d220420a768de619e7043dd56f6ee667
2017-12-20 16:32:51 +01:00
Martin Stransky
3f9d6ff25b Bug 1426384 - call gdk_window_set_decorations() on mShell GdkWindow only, r=jhorak
To have any effect we need to call gdk_window_set_decorations() on top-level GdkWindow only.
When rendering to mContainer the mGdkWindow belongs to mContainer so we need to get the window
from mShell explicitly.

MozReview-Commit-ID: KLKlVJbgg3

--HG--
extra : rebase_source : c17310949e067dca540bf269f12db135e6582ebc
2017-12-20 16:31:13 +01:00
Martin Stransky
b07ea64a0d Bug 1424974 - Honor mShell as top-level window, r=jhorak
When drawing to mContainer we still need to honor mShell as top-level window.
It means we have to listen property-notify-event there (as it's window specific),
get _NET_FRAME_EXTENTS here and use at nsWindow::SetWindowClass().

MozReview-Commit-ID: HYbNS0Lfyjy

--HG--
extra : rebase_source : f03cb4657a36238fd93b47b94ace48a325648296
2017-12-20 11:10:36 +01:00
Martin Stransky
ed49bfcfee Bug 1425820 - build fix of SetImageDataFromBackBuffer definition/call, r=jhorak
MozReview-Commit-ID: 7NJMCdhd400

--HG--
extra : rebase_source : bd72e00090af03c285cdd16b0a05106c3fd7e6c6
2017-12-18 11:53:30 +01:00
Martin Stransky
d3bcca0b14 Bug 1422966 - Implement SurfaceWayland for Wayland, r=jhorak
WindowSurfaceWayland is Wayland implementation of WindowSurface class.
One WindowSurfaceWayland object manages drawing of one nsWindow so
those are tied 1:1. It implements base Lock() and Commit() interfaces
from WindowSurface. At Wayland side it represents one wl_surface object.

To perform visualiation of nsWindow, WindowSurfaceWayland contains
one wl_surface and two wl_buffer (by WindowBackBuffer) objects
(as we use double buffering). When nsWindow drawing is finished to
wl_buffer, the wl_buffer is attached to wl_surface and it's sent to
Wayland compositor.

MozReview-Commit-ID: 9NoamtF87e6

--HG--
extra : rebase_source : e942b28f1eaa4b1c24c6c4df6894db8d3d789e7e
2017-12-04 22:29:08 +01:00
Martin Stransky
8ca9561e71 Bug 1422966 - implemented WindowBackBuffer to encapsulate wl_buffer, r=jhorak
wl_buffer is a main Wayland object with graphics data. wl_buffer basically represent one complete window screen.
When double buffering is involved every window (GdkWindow in our case) utilises two wl_buffers which are cycled.
One is filed with data by application and one is rendered by compositor.

WindowBackBuffer class manages one wl_buffer. It owns wl_buffer object, owns WaylandShmPool (which provides shared memory)
and ties them together.

MozReview-Commit-ID: v8Hlezo7oD

--HG--
extra : rebase_source : 40bffbbae2ee0c8f67d442ee2c5a62be43fafb44
2017-12-04 22:25:26 +01:00
Martin Stransky
b12d4609e7 Bug 1422966 - implement WaylandShmPool to manage shared memory for wl_buffer, r=jhorak
We allocate shared memory (shm) by mmap(..., MAP_SHARED,...) as an interface between wayland based application
and wayland compositor. We draw our graphics data to the shm and handle to wayland compositor by wl_buffer/wl_surface.

WaylandShmPool acts as a manager of the allocated memory. Allocates it, holds reference to it and releases it.

MozReview-Commit-ID: CY6oEIl4Vxa

--HG--
extra : rebase_source : c43da8728e11e133cb021b1832382c1a39695a1a
2017-12-04 22:22:04 +01:00
Martin Stransky
8431e12fba Bug 1422966 - Update mDisplay attribute initialization at nsWaylandDisplay::nsWaylandDisplay(), r=jhorak
MozReview-Commit-ID: GQrCtvKDjfF

--HG--
extra : rebase_source : 99ba7a2b843dc3600e046ddbb34c1d6446abcb57
2017-12-04 22:31:23 +01:00
Martin Stransky
ee30a32467 Bug 1422966 - Comment Wayland rendering scheme, r=jhorak
MozReview-Commit-ID: 7ZV97xcRskV

--HG--
extra : rebase_source : c559433f18e60e782966660336576e7974da73a6
2017-12-05 10:12:37 +01:00
Martin Stransky
2a63de4110 Bug 1424661 - refactor ncClipboard::GetData(), allocate all memory by moz_xmalloc() and release by free(), r=jhorak
Refactor ncClipboard::GetData() for better readability, add nsClipboard::SetTransferableData()
to send clipboard data to nsITransferable.

According to Gtk people [1] we can't mix free()/g_free() and malloc()/g_malloc() calls.
Existing nsClipboard code mixes that on some places which can lead to issued on glib built
with specific flags (ENABLE_MEM_PROFILE or ENABLE_MEM_CHECK).

[1] https://mail.gnome.org/archives/gtk-list/2000-July/msg00002.html

MozReview-Commit-ID: GvkUGSttVGO

--HG--
extra : rebase_source : 99801e1dc97e24a8d68fe7f3585562bb541c6628
2017-12-11 11:59:57 +01:00
Martin Stransky
8e9792e4d7 Bug 1424926 - does not apply CSS padding to header bar buttons, r=dao
MozReview-Commit-ID: Hq86waEx1sg

--HG--
extra : rebase_source : 13b5c32d153603edd66082a9c298485cf119ddc9
2017-12-13 11:02:51 +01:00
Martin Stransky
3c3f7c4ce9 Bug 1423810 - Temporary disable CSD decoration as it breaks popup windows, r=jhorak
MozReview-Commit-ID: DCdbxvnfV9B

--HG--
extra : rebase_source : acd8f632d9a9e3a21f777d1520037497dff3bc54
2017-12-11 22:26:55 +01:00
Martin Stransky
5824a507e6 Bug 1423869 - don't draw to mContainer when decorations are rendered by window manager, r=jhorak
Bug 1421974 introduced new mechanism to hide system titlebar by enabling client-side decorations for main Firefox window. It also causes a regression when the CSD window setup is enabled when system titlebar is hidden by window manager.

This patch fixes that and enables the CSD window setup only for case when it's actualy used.

MozReview-Commit-ID: AqfHR2bGr3K

--HG--
extra : rebase_source : 625366530922872af82e182db10f5069ebfa7dc4
2017-12-11 11:07:48 +01:00
Martin Stransky
e17f64f2b6 Bug 1423869 - force CSD_SUPPORT_NONE when XDG_CURRENT_DESKTOP is not set, r=jhorak
MozReview-Commit-ID: A4dz6ywrCsf

--HG--
extra : rebase_source : 3f3d99e9741e33e7fdd6bb69c2bc82f9b469c897
2017-12-11 11:05:27 +01:00
Martin Stransky
b3c7669367 Bug 1417874 - Split clipboard implementation to shared (nsClipboard) and backend specific (nsClipboardX11) parts, r=jhorak
MozReview-Commit-ID: 5IebGayJl1

--HG--
extra : rebase_source : 7009a0f5a668895930280fc4426baa22abdc499c
2017-11-16 14:00:00 +01:00
Bogdan Tara
e15c276db2 Backed out 1 changesets (bug 1423869)for causing frequent Linux chrome failure in toolkit/content/tests/chrome/test_chromemargin.xul r=backout on a CLOSED TREE
Backed out changeset 4960f30d91b2 (bug 1423869)
2017-12-07 19:58:24 +02:00
Bogdan Tara
9cee3dc42a Backed out 1 changesets (bug 1417874) for causing frequent Linux chrome failure in toolkit/content/tests/chrome/test_chromemargin.xul r=backout on a CLOSED TREE
Backed out changeset b35e86822732 (bug 1417874)
2017-12-07 19:55:49 +02:00
Martin Stransky
1c02893dc9 Bug 1423869 - don't draw to mContainer when decorations are rendered by window manager, r=jhorak
Bug 1421974 introduced new mechanism to hide system titlebar by enabling client-side decorations for main Firefox window. It also causes a regression when the CSD window setup is enabled when system titlebar is hidden by window manager.

This patch fixes that and enables the CSD window setup only for case when it's actualy used.

MozReview-Commit-ID: 6OzoPyxlhCp

--HG--
extra : rebase_source : 9bcfc96cd27cb088f8d9671780304c2ac3772fdf
2017-12-07 15:20:48 +01:00
Martin Stransky
53c4e3f117 Bug 1417874 - Split clipboard implementation to shared (nsClipboard) and backend specific (nsClipboardX11) parts, r=jhorak
MozReview-Commit-ID: 5IebGayJl1

--HG--
extra : rebase_source : 7009a0f5a668895930280fc4426baa22abdc499c
2017-11-16 14:00:00 +01:00
Martin Stransky
c960be3742 Bug 1421974 - use gtk_window_set_titlebar() to hide titlebar on WM where GDK_DECOR_BORDER does not work, r=jhorak
This patch is based on Karl Tomlinson's (:karlt) demo from Bug 1419456. We use gtk_window_set_titlebar()
to set invisible widget. The widget takes place of GtkHeaderBar which leads Gtk+ to render CSD shadows
and handle window resizing, it does not render any titlebar.

gtk_window_set_titlebar() works on unrealized windows only and mShell is already realized at time
of nsWindow::SetDrawsInTitlebar() call so we need to update recent GtkWidget setup.

In that case we create GdkWindow for mContainer (instead of mShell), create a temporary GtkWindow,
reparent mContainer (which owns mGdkWindow) to it, unrealize mShell and set up the titlebar
for mShell toplevel window.

As a workaround for Gtk+ Bug 791081 we also allocate some valid size for mShell before it's newly realized
with the updated titlebar.

MozReview-Commit-ID: A3KwRoOzoko

--HG--
extra : rebase_source : ded644762d3be9e79e3d407f57b2f9098021fb96
2017-12-01 15:22:48 +01:00
Martin Stransky
034109dd85 Bug 1421974 - refactor nsWindow::HideWindowChrome() to nsWindow::SetWindowDecoration() and share it with nsWindow::SetDrawsInTitlebar, r=jhorak
MozReview-Commit-ID: 3xEdMXq9JvJ

--HG--
extra : rebase_source : 20a981ec562388337f826cbfcc5cdd5a4c6c37a8
2017-12-01 15:09:11 +01:00
Martin Stransky
51d1404cde Bug 1420820 - Added MOZ_GTK_TITLEBAR_DECORATION to override window manager detection and set window decoration type, r=jhorak
Enables override window manager default with those values:

MOZ_GTK_TITLEBAR_DECORATION=none - Firefox does not mess with decoration
MOZ_GTK_TITLEBAR_DECORATION=client - Firefox tries to disable titlebar rendering and draws shadows by client side decorations.
MOZ_GTK_TITLEBAR_DECORATION=system - Firefox tries to disable titlebar rendering and leave system (window manager) to draw window decorations.

MozReview-Commit-ID: G60QS3g1TD0

--HG--
extra : rebase_source : fd7b5d2b0282fbd54046947d210b1288a0610a23
2017-12-04 15:19:00 +01:00
Martin Stransky
91251dce14 Bug 1281425 - Implement wayland loop to process wl_display events for threads and bind wl_registry for wl_shm, r=jhorak
MozReview-Commit-ID: 1pS1wfOiOo4

--HG--
extra : rebase_source : cde165f1b79625eb807035ac01d50c53cff90bfc
2017-11-02 17:08:33 +01:00
Martin Stransky
a6e8113393 Bug 1281425 - Added nsWaylandDisplay class to support access to Wayland display, r=jhorak
MozReview-Commit-ID: 6IU5hS15MmM

--HG--
extra : rebase_source : a4f8b13d2a95dbdeff315e1aea087712daece4fd
2017-10-26 20:19:36 +02:00
Martin Stransky
28829e9356 Bug 1419460 - search XDG_CURRENT_DESKTOP for desktop environment type substring, r=jhorak
We need apply various titlebar/border configuration which is based on active
window manager and desktop type. The XDG_CURRENT_DESKTOP shell variable contains active
desktop environment which we use at GetCSDSupportLevel().

Unfortunately Ubuntu adds "ubuntu:" prefix at XDG_CURRENT_DESKTOP so we can't do
plain string compare but rather search for DE substring at GetCSDSupportLevel().

MozReview-Commit-ID: GmAZ30p47eI

--HG--
extra : rebase_source : eeef51e7326bb8be6418554b07ce5791e988f02f
2017-11-23 14:01:35 +01:00
Dorel Luca
79499f4044 Merge mozilla-central to autoland r=merge on a CLOSED TREE 2017-11-29 12:31:25 +02:00
Martin Stransky
f9a10ab56d Bug 1420110 - remove browser.tabs.drawInTitlebar check from nsLookAndFeel, r=jhorak
The browser.tabs.drawInTitlebar check at nsLookAndFeel is redundant, breaks Thunderbird and dynamic titlebar rendering change. Let's use browser.tabs.drawInTitlebar at browser level and when enabled configure titlebar visibility by moz_gtk* media atoms.

MozReview-Commit-ID: IhCYmXgVME7

--HG--
extra : rebase_source : 6f152e5c3d7d5abbb134c9f5adcb76fd6ed335cb
2017-11-23 21:00:12 +01:00
Bob Owen
0160e22eae Bug 1420171 Part 2: Remove some unused members from nsDeviceContextSpecG. r=karlt 2017-11-28 08:58:58 +00:00
Bob Owen
546d657b09 Bug 1420171 Part 1: Only default the print-to file name on Linux if not already set. r=karlt
This allows the web extension saveAsPDF function to work properly.
2017-11-28 08:58:43 +00:00
lochang
e889dbe685 Bug 1417751 - Implement a new value inner-spin-button to -moz-appearance on all platforms except Android. r=mats
MozReview-Commit-ID: 7jpLCOWZA2x

--HG--
extra : rebase_source : d2a4d160d26e6f6996ed1cb3a673576236b8ef23
2017-11-29 10:43:13 +08:00
Cosmin Sabou
7d7b59dd0b Backed out changeset 423f4e43a975 (bug 1417751) for xpcshell failures at devtools/shared/tests/unit/test_css-properties-db.js r=backout on a CLOSED TREE 2017-11-28 13:50:59 +02:00
lochang
416f319bb8 Bug 1417751 - Implement a new value inner-spin-button to -moz-appearance on all platforms except Android. r=mats
MozReview-Commit-ID: 3I1LBLbCfmF

--HG--
extra : rebase_source : f9a356d592eac90d91a59de0c7ab0ded6ab80ab2
2017-11-28 10:39:50 +08:00
Martin Stransky
7916b9afd7 Bug 1419456 - Disable full CSD support for XFCE as it does not support GDK_DECOR_BORDER, r=jhorak
MozReview-Commit-ID: BFOgxJ3abrT

--HG--
extra : rebase_source : f17d0a8d1e64b09aa02f7c0b314980db0eacee84
2017-11-21 20:03:21 +01:00
Martin Stransky
26d40cc144 Bug 1418829 - Add MATE entry to GetCSDSupportLevel(), use GDK_DECOR_BORDER with CSD_SUPPORT_FULL only, r=jhorak
Adding MATE as FLAT as it does not support the shadow borders around the window.

GDK_DECOR_BORDER decoration mode means that the window manager renders borders around the window.
We want the border rendering for CSD_SUPPORT_FULL only which means the border looks like shadows. We don't wand WM to render solid/bold borders around main toplevel window.

MozReview-Commit-ID: BdwHi0LJRGC

--HG--
extra : rebase_source : 7b7d6733e62ae3188fe6cdeecca17de05b3d6873
2017-11-20 14:30:57 +01:00
Martin Stransky
7c5df586c4 Bug 1418829 - nsLookAndFeel enables rendering to the titlebar for supported window managers only, r=jhorak
MozReview-Commit-ID: JvqQuZenkWy

--HG--
extra : rebase_source : 11047d6bb3b85cd73aae7a8da9ac8124b2b9a5e7
2017-11-20 14:29:49 +01:00
Martin Stransky
5b47065c12 Bug 1418829 - Export GetCSDSupportLevel() as public from nsWindow, r=jhorak
We need that for nsLookAndFeel module.

MozReview-Commit-ID: 61YKeAUoKEu

--HG--
extra : rebase_source : 3587d39005fe8e6a63b527f55f377182bf1c69bd
2017-11-20 14:28:29 +01:00