Commit Graph

280 Commits

Author SHA1 Message Date
Masayuki Nakano
0f9b3a05da Bug 1594215 - Make PuppetWidget::GetEditCommands() check mBrowserChild before using it r=smaug
The reason of the crash is, the window may have already been destroyed and
`PuppetWidget::mBrowserChild` was set to `nullptr` when synthesizing key event.

This patch makes `PuppetWidget::GetEditCommands()` check whether it's `nullptr`
and returns whether it's succeeded or not.  Therefore, `TextInputProcessor`
can throw exception in such case.

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

--HG--
extra : moz-landing-system : lando
2019-11-08 11:32:51 +00:00
Jim Mason
1be2b74935 Bug 969322 - make :-moz-window-inactive state follow GDK_WINDOW_STATE_FOCUSED when drawing in titlebar r=karlt,stransky
This patch fixes activation of the :-moz-window-inactive pseudoclass in client side decoration during drag operations.  It depends on and complements the fixes provided in support of Bug 1491808.

Obsoletes D50445

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

--HG--
extra : moz-landing-system : lando
2019-11-06 20:49:07 +00:00
Martin Stransky
486a8209db Bug 1592933 - [Wayland] Cache scale factor for toplevel windows, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D51253

--HG--
extra : moz-landing-system : lando
2019-11-06 13:18:55 +00:00
Jan Horak
4d0cec02a5 Bug 1565401 - return valid screen size on multimonitor setup under Wayland; r=stransky,NeilDeakin
By getting the right screen size we can shrink the popup menus which overflows
the screen size under Wayland. The ScreenManager does not help us, because we
can't get absolute window position, but we can use gdk_display_get_monitor_at_window
and gdk_monitor_get_workarea to get the correct screen rectangle.

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

--HG--
extra : moz-landing-system : lando
2019-10-17 11:27:08 +00:00
Cosmin Sabou
e1278bb139 Backed out changeset 23e9fe8a919b (bug 1565401) for causing build bustages on nsWindow.h. CLOSED TREE 2019-10-16 18:45:09 +03:00
Jan Horak
e2b9bdb35e Bug 1565401 - return valid screen size on multimonitor setup under Wayland; r=stransky,NeilDeakin
By getting the right screen size we can shrink the popup menus which overflows
the screen size under Wayland. The ScreenManager does not help us, because we
can't get absolute window position, but we can use gdk_display_get_monitor_at_window
and gdk_monitor_get_workarea to get the correct screen rectangle.

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

--HG--
extra : moz-landing-system : lando
2019-10-16 13:03:43 +00:00
Martin Stransky
0595546bfc Bug 1587008 - [Wayland] Get wl_egl_window size from compositor by nsWindow::SetEGLNativeWindowSize, r=jhorak
We can't set wl_egl_window from widget code as it must match GL rendering pipeline,
so let compositor to set the egl window size.

Depends on D49136

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

--HG--
extra : moz-landing-system : lando
2019-10-15 19:25:47 +00:00
Dorel Luca
518c1a81eb Backed out 2 changesets (bug 1587008) for build bustage on src/widget/gtk/GtkCompositorWidget.cpp. CLOSED TREE
Backed out changeset 9e610c4628e1 (bug 1587008)
Backed out changeset afc6499c8f1f (bug 1587008)

--HG--
extra : rebase_source : 3c3cc17ada4079f279809cae1ece2e226fde5acf
extra : histedit_source : c7f61dbede0eda8ea3b0a1dfa5c67f8650f4ca81
2019-10-15 19:10:32 +03:00
Martin Stransky
11e2fafd1f Bug 1587008 - [Wayland] Get wl_egl_window size from compositor by nsWindow::SetEGLNativeWindowSize, r=jhorak
We can't set wl_egl_window from widget code as it must match GL rendering pipeline,
so let compositor to set the egl window size.

Depends on D49136

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

--HG--
extra : moz-landing-system : lando
2019-10-15 13:12:25 +00:00
Jan Horak
4a0dbe414e Bug 1582679 - Rewrite popup hiding on wayland; r=stransky
Under Wayland it is possible to add only one popup window
to a parent window. If we try to attach another popup to the window,
the GTK refuses to do that. This can happen when the previous popup
has not yet been hidden while the new popup is showing (in some cases
the nsWindow::Show(false) for the previous popup is not called before
nsWindow::Show(true) for the new one).

We deal with it by hiding wayland popups which are no longer in the
XULPopupManager (PM) before showing a new one. We only do that for
the main menu popups or context (sub)menus. We cannot use PM to check
for the panel popup content like Folder dropdown in Edit Bookmark panel
or WebRTC microphone/video source dropdown. In that case we simply use
the last shown popup as a transient for the new one or the toplevel window.

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

--HG--
extra : moz-landing-system : lando
2019-10-02 13:21:56 +00:00
Brindusan Cristian
bc0bc5f832 Backed out changeset 30310d7d693a (bug 1582679) for mochitest assertions at nsWindow.cpp:3766. CLOSED TREE 2019-10-02 00:14:31 +03:00
Jan Horak
730e9ad9d9 Bug 1582679 - Rewrite popup hiding on wayland; r=stransky
Under Wayland it is possible to add only one popup window
to a parent window. If we try to attach another popup to the window,
the GTK refuses to do that. This can happen when the previous popup
has not yet been hidden while the new popup is showing (in some cases
the nsWindow::Show(false) for the previous popup is not called before
nsWindow::Show(true) for the new one).

We deal with it by hiding wayland popups which are no longer in the
XULPopupManager (PM) before showing a new one. We only do that for
the main menu popups or context (sub)menus. We cannot use PM to check
for the panel popup content like Folder dropdown in Edit Bookmark panel
or WebRTC microphone/video source dropdown. In that case we simply use
the last shown popup as a transient for the new one or the toplevel window.

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

--HG--
extra : moz-landing-system : lando
2019-10-01 13:14:02 +00:00
Martin Stransky
47f4838fa0 Bug 1584492 [Linux] Add mIsPIPWindow to nsWindow, r=jhorak
Depends on D47409

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

--HG--
extra : moz-landing-system : lando
2019-09-28 06:55:54 +00:00
Martin Stransky
39d980d661 Bug 1575136 - [Linux/Gtk] Set initial wm_role for windows, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D47217

--HG--
extra : moz-landing-system : lando
2019-09-26 12:11:44 +00:00
Martin Stransky
b39e038df7 Bug 1583737 - Implement nsWindow::LockAspectRatio() on Linux, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D47046

--HG--
extra : moz-landing-system : lando
2019-09-26 07:57:57 +00:00
Martin Stransky
1cf5fdd9b6 Bug 1562827 - [Linux] Merge nsWindow::ReparentNativeWidgetInternal() to nsWindow::SetParent() and use nsWindow::ReparentNativeWidget() for toplevel windows only, r=karlt
- Use former ReparentNativeWidgetInternal() code in nsWindow::SetParent().
  Also update mToplevelParentWindow for Wayland to hold default toplevel window.

- Make nsWindow::ReparentNativeWidget() to work on toplevel windows only and use only gtk_window_set_transient_for() to reparent
  a toplevel window. Also update mToplevelParentWindow for Wayland.

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

--HG--
extra : moz-landing-system : lando
2019-08-28 23:48:44 +00:00
Markus Stange
cc120aa3b7 Bug 1573343 - Make the aInvalidRegion parameter of EndRemoteDrawing a const reference rather than a regular reference. r=mattwoodrow
There's no point in mutating it, and nobody does.

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

--HG--
extra : moz-landing-system : lando
2019-08-19 22:40:39 +00:00
Martin Stransky
6354d2287a Bug 1567434 - [Wayland] Don't use gtk_window_get_transient_for() to get parent toplevel window, r=jhorak
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.

- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
  NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.

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

--HG--
extra : moz-landing-system : lando
2019-08-05 10:37:21 +00:00
Brindusan Cristian
c00617be71 Backed out 2 changesets (bug 1567434) for build bustages at nsWindow.cpp:3587:53. CLOSED TREE
Backed out changeset 10925a6df9b3 (bug 1567434)
Backed out changeset 1cd94e91245c (bug 1567434)
2019-08-05 12:23:04 +03:00
Martin Stransky
99f4b257a1 Bug 1567434 - [Wayland] Don't use gtk_window_get_transient_for() to get parent toplevel window, r=jhorak
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.

- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
  NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.

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

--HG--
extra : moz-landing-system : lando
2019-08-05 08:39:53 +00:00
sotaro
41e801baab Bug 1566468 - Fix CompositorInitiallyPaused() r=nical
CompositorInitiallyPaused() uses mNeedsUpdatingEGLSurface. But it is not good. mNeedsUpdatingEGLSurface is set to true in moz_container_set_initial_draw_callback(). If compositor is created before moz_container_set_initial_draw_callback(), compositor is not initially paused. It happens sometimes with popup window.

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

--HG--
extra : moz-landing-system : lando
2019-07-17 14:08:39 +00:00
sotaro
f2c65ceeb7 Bug 1565785 - Skip WR rendering until window becomes ready to draw on Wayland r=nical
Differential Revision: https://phabricator.services.mozilla.com/D37977

--HG--
extra : moz-landing-system : lando
2019-07-16 01:28:32 +00:00
Mihai Alexandru Michis
a2b90fe037 Backed out changeset b1f8f86bbda8 (bug 1565785) for causing bustages in nsWindow.h CLOSED TREE 2019-07-16 03:12:42 +03:00
sotaro
45b727fe13 Bug 1565785 - Skip WR rendering until window becomes ready to draw on Wayland r=nical
Differential Revision: https://phabricator.services.mozilla.com/D37977

--HG--
extra : moz-landing-system : lando
2019-07-15 14:33:04 +00:00
myfreeweb
01916974b0 Bug 1213601 - implement kinetic/inertial scrolling (fling) for Gtk. r=botond
--HG--
extra : rebase_source : 69a374c26bcb8781e83aeb26058a2de349313bbc
extra : amend_source : 521bb6f2b5799bfca5f8b8b5bbe9e4fef1f2dd1e
2019-06-20 16:18:45 -04:00
Emilio Cobos Álvarez
21d5c25734 Bug 1553769 - Make nsIWidget::SetFocus infallible, and make it take an enum class. r=NeilDeakin
Only gtk returns failure ever, and nobody checks the result anyway.

Use an enum class so that it's clear from the caller what it means.

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

--HG--
extra : moz-landing-system : lando
2019-05-31 22:13:56 +00:00
Martin Stransky
ce7abe5c5c Bug 1534936 - [Wayland] Clear transparent popup window background, r=jhorak
When transparent popup window is rendered clear window background to clear
visual artifacts and bold shadows over the popup.

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

--HG--
extra : moz-landing-system : lando
2019-05-31 13:26:58 +00:00
Brindusan Cristian
bfa0a8a991 Backed out changeset c0895e6c7343 (bug 1553769) for causing build bustages at PluginWidgetProxy.cpp. CLOSED TREE 2019-05-30 01:00:20 +03:00
Emilio Cobos Álvarez
748cc8584f Bug 1553769 - Make nsIWidget::SetFocus infallible, and make it take an enum class. r=NeilDeakin
Only gtk returns failure ever, and nobody checks the result anyway.

Use an enum class so that it's clear from the caller what it means.

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

--HG--
extra : moz-landing-system : lando
2019-05-29 14:37:26 +00:00
Martin Stransky
daf67c12bc Bug 1550051 - [Wayland] Don't track invisible popup windows, r=jhorak
Recently we track and position all popups on Wayland which leads to
wrong placement when parent popup window is hidden.

In this patch we use plain gtk_window_move() for hidden popups and
we don't track them so they can't be used as a parent window.

Also implement nsWindow::HideWaylandPopupAndAllChildren() to clearly
hide a popup window with and its children windows.

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

--HG--
extra : moz-landing-system : lando
2019-05-28 11:12:03 +00:00
Razvan Maries
6fbdaf61c3 Backed out changeset f9699ae30f4d (bug 1213601) on jrmuizel's request. 2019-05-26 18:12:56 +03:00
myfreeweb
e6dc1a7382 Bug 1213601 - Implement kinetic/inertial scrolling (fling) for Gtk touchpads. r=botond,karlt
--HG--
extra : rebase_source : c89a97e40aa59e1038530becdb53c2d7b992db7b
2019-05-24 13:31:34 -04:00
Martin Stransky
89dd37e531 Bug 1539471 - [wayland] Track active popup windows on Wayland and use dynamic popup hierarchy, r=ashie
In order to show all popups on Wayland we need to set popup parent runtime for popups which don't have
fixed parent. For instance popup menus (fired after right button mouse click) can be issued on top of another popup
and we need to follow that connection on Wayland.

We track all open (active) popups to:

- close all visible tooltip windows when we're going to open another tooltip
- close concurrent popup on the same level when a new one is about to open
- get latest active popup as a parent for a new tooltip windows
- get latest active popup as a parent for a new popup menu without fixed parent

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

--HG--
extra : moz-landing-system : lando
2019-05-07 11:28:04 +00:00
Martin Stransky
b0e5ec67f3 Bug 1423598 - [Wayland] Use gdk_window_move_to_rect() to place popup windows, r=ashie
Differential Revision: https://phabricator.services.mozilla.com/D22962

--HG--
extra : moz-landing-system : lando
2019-04-25 11:44:44 +00:00
Gurzau Raul
7c92e63506 Backed out changeset c11577f6743e (bug 1423598) for build bustage at /gtk/nsWindow.cpp. on a CLOSED TREE. 2019-04-25 13:37:08 +03:00
Martin Stransky
29fe37289b Bug 1423598 - [Wayland] Use gdk_window_move_to_rect() to place popup windows, r=ashie
Differential Revision: https://phabricator.services.mozilla.com/D22962

--HG--
extra : moz-landing-system : lando
2019-04-25 09:00:16 +00:00
Martin Stransky
4b8741979a Bug 1532643 - [Wayland] Set popup window hierarchy run-time on Wayland for menus in the same frame hierarchy, r=NeilDeakin
Wayland protocol allows to have only one popup window attached to a parent widget.

Recently we use a toplevel window widget as parent for all popups.
That means a second level menu (like File -> New Container Tab)
is not displayed as both ("File" and "New Container Tab" menus)
have the same parent widget.

As a solution allow to get the actual parent run-time and set that
when we open the window on toolkit level.

This patch covers menu widgets in the same frame hierarchy.

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

--HG--
extra : moz-landing-system : lando
2019-04-17 14:19:57 +00:00
sotaro
554777b1d1 Bug 1532024 - Handle a case that GetRemoteRenderer() returned nullptr r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D21831

--HG--
extra : moz-landing-system : lando
2019-03-06 08:17:51 +00:00
Martin Stransky
1f8f77f796 Bug 1530625 - Enable system titlebar on Gnome/X.org sessions due mutter Bug 1530625 and disable titlebar X shape mask on mutter/X.org, r=lsalzman
- Detect current desktop session and disable shape mask on Mutter/X.org due to Bug 1530252 (mutter bug).
- Use system titlebar on Mutter/X.org as we can't draw the titlebar reliably.
- Remove widget.default-hidden-titlebar from prefs. When it's defined it overrides default titlebar detection heuristics now.
- Don't use shape masks at all on Mutter/x.org. When system titlebar is hidden in this case (by user choice) it has opaque corners unless
  argb visual is selected.
- Use Window manager decorations on Gnome Classic session, that works better than client decorations.

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

--HG--
extra : moz-landing-system : lando
2019-02-26 17:46:15 +00:00
sotaro
1579a88e49 Bug 1527804 - Trigger composite from frame_callback_handler() r=stransky
Bug 1514156 expects that nsWindow::OnExposeEvent() is called after frame_callback_handler() called. But it did not happen during opening add-ons(gecko profiler). Then we need to trigger rendering directly from frame_callback_handler() call.

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

--HG--
extra : moz-landing-system : lando
2019-02-25 12:15:50 +00:00
Martin Stransky
8222d966e6 Bug 1529713 - [Titlebar] Use Window manager decorations on GNOME again, r=lsalzman
This patch enables the shape mask in CSD and Window manager decorations mode
when we're runnin on composited screen and mozilla.widget.use-argb-visuals is not set.

Also don't use shape mask with Wayland and GL backend. When shape mask is set,
advertise toplevel window transparency but don't advertise it
as alpha to GtkCompositorWidget.

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

--HG--
extra : moz-landing-system : lando
2019-02-22 14:01:50 +00:00
sotaro
0e2cb6d4e8 Bug 1514156 - Add RenderCompositorEGL for wayland r=nical
When GDK_BACKEND is wayland, widget is not fully mapped during creating CompositorSession. Needs to create valid EGLSurface after widget is fully mapped.

Differential Revision: https://phabricator.services.mozilla.com/D18940
2019-02-12 16:33:31 +09:00
Emilio Cobos Álvarez
ef7d8198eb Bug 1520502 - Set the standard cursor and the custom cursor in the same IPC message. r=jmathies
This cleans up a bit and allows us to be smarter about which cursors
should we allow from content or what not, which will help with bug 1445844 and
co.

Differential Revision: https://phabricator.services.mozilla.com/D16711
2019-01-26 07:49:28 +01:00
Martin Stransky
59a8114e76 Bug 1521012 - [Linux/GNOME] Use X shape mask to draw transparent corners when we draw to titlebar, r=lsalzman
To support rounded corners of Gtk+ titlebar themes (Adwaita, Radiance..) in GNOME we need to use X shape mask
as fully transparent toplevel window causes various issues (like Bug 1516224).

We draw mShell as transparent and mContainer as non-transparent with shape mask applied. The shape mask
is generated only when titlebar rendering is enabled and it's generated from GtkHeaderBar Widget
to match the exact look.

We use existing mTransparencyBitmap for the shape mask where mTransparencyBitmapForTitlebar controls
whether it's a general shape mask or our specialised shape for titlebar only.

This is already enabled for GNOME environment by default. So there's a new preference
widget.default-hidden-titlebar added to easily disable it if any issue appears
during testing.

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

--HG--
extra : moz-landing-system : lando
2019-01-23 12:36:25 +00:00
Cosmin Sabou
7ccc9d8b0b Merge mozilla-inbound to mozilla-central. a=merge 2019-01-19 11:57:49 +02:00
Tim Nguyen
60a5143df0 Bug 1241885 - Implement support for -moz-window-dragging in GTK and remove toolkit toolbar-drag binding. r=dao,bzbarsky,stransky
The restriction preventing fullscreen windows from being dragged is removed.

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

--HG--
extra : moz-landing-system : lando
2019-01-18 22:42:24 +00:00
Andreea Pavel
95431afe85 Backed out 1 changesets (bug 1241885) for build bustages on a CLOSED TREE
Backed out changeset 176be7000d33 (bug 1241885)
2019-01-18 23:49:55 +02:00
Tim Nguyen
495df7ddea Bug 1241885 - Implement support for -moz-window-dragging in GTK and remove toolkit toolbar-drag binding. r=dao,bzbarsky,stransky
The restriction preventing fullscreen windows from being dragged is removed.

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

--HG--
extra : moz-landing-system : lando
2019-01-18 16:51:08 +00:00
Martin Stransky
53be695239 Bug 1490344 - [Linux/Gtk] Enable hidden system titlebar by default on Gnome, r=dao
This patch implements -moz-gtk-csd-hide-titlebar-by-default media query
to check if the system titlebar should be disabled by default on Linux systems
(it's already disabled on Window/Mac).

It also removes explicit definition of browser.tabs.drawInTitlebar preference on Linux.
When browser.tabs.drawInTitlebar is missing the -moz-gtk-csd-hide-titlebar-by-default
is used to obtain the titlebar state. When browser.tabs.drawInTitlebar is set
in about:config or by Customize menu, the user peference is used instead of the default.

It also fixes a -moz-gtk-csd-available media query,
it was always true regardless the actual system setting.

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

--HG--
extra : moz-landing-system : lando
2019-01-17 12:44:49 +00:00
Andreea Pavel
d0b4b569af Backed out changeset aa442da7cfd8 (bug 1490344) for failing bc at browser/components/customizableui/test/browser_970511_undo_restore_default.js on a CLOSED TREE 2019-01-16 13:33:24 +02:00