Commit Graph

1690 Commits

Author SHA1 Message Date
Cristina Horotan
bb08cc9f1d Backed out 5 changesets (bug 1930292, bug 1932600) for causing chrome failures at test_maximized_persist.xhtml on a CLOSED TREE
Backed out changeset 2418bfee53f1 (bug 1932600)
Backed out changeset 3297e990715a (bug 1932600)
Backed out changeset 24a670dea977 (bug 1930292)
Backed out changeset 7dd9f48216dd (bug 1930292)
Backed out changeset 15a85ec739dd (bug 1930292)
2024-11-28 06:57:35 +02:00
Emilio Cobos Álvarez
67678746e6 Bug 1930292 - Turn chromemargin into a boolean attribute. r=win-reviewers,desktop-theme-reviewers,pip-reviewers,firefox-desktop-core-reviewers ,dao,mconley,rkraesig
There are probably other simplifications that can be done after this on the
windows side of things, but I tried to keep this minimal.

Differential Revision: https://phabricator.services.mozilla.com/D229765
2024-11-28 03:26:50 +00:00
Sandor Molnar
0a5179c08b Backed out 4 changesets (bug 1932784) for causing build bustages @ nsWaylandDisplay.h
Backed out changeset 904eb3043370 (bug 1932784)
Backed out changeset b13e482a5c6f (bug 1932784)
Backed out changeset 22dd30bf7d5a (bug 1932784)
Backed out changeset f8762853ca6e (bug 1932784)
2024-11-23 13:38:54 +02:00
Kelsey Gilbert
209d5a808f Bug 1932784 - Forward declare WaylandVsyncSource instead of include in nsWindow.h. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D229867
2024-11-23 04:09:01 +00:00
Emilio Cobos Álvarez
75afaf28bb Bug 1849109 - Prevent move-to-rect loops with fractional scale. r=stransky
See comment. Without it we might get slightly different bounds which
gets us into a resize loop.

Differential Revision: https://phabricator.services.mozilla.com/D228674
2024-11-13 12:21:27 +00:00
Emilio Cobos Álvarez
ea9d1167bd Bug 1849109 - Fix popup sizing with fractional scales. r=stransky
We probably need more fixes on top, I see sometimes we get stuck in a
move-to-rect loop (probably because our gtk call doesn't know about the
fractional scale).

But this fixes the sizing and positioning at least.

Differential Revision: https://phabricator.services.mozilla.com/D228602
2024-11-12 16:19:18 +00:00
Martin Stransky
8c64ad12c8 Bug 1929846 [Linux] Check nsWindow state before release r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228310
2024-11-08 09:51:16 +00:00
Emilio Cobos Álvarez
fbfcb95a50 Bug 1926624 - Unify top level widget behavior across platforms, standardizing on previous macOS behavior. r=stransky,mac-reviewers,win-reviewers,spohl,nrishel
So the issue here is that my patch made GetTopLevelWidget() return the
top level window across the widget chain, including this one in
particular:

  https://searchfox.org/mozilla-central/rev/387f3edbef37d31b2e91fb0812c74b54729e86ff/layout/base/nsDocumentViewer.cpp#2339

We have two AppWindows parented:

 * Top level browser -> Alert window.

It seems it's know that cocoa windows that aren't shown yet may have a
HiDPI scale factor different from their actual screen's scale factor:

 * https://searchfox.org/mozilla-central/rev/387f3edbef37d31b2e91fb0812c74b54729e86ff/widget/cocoa/nsCocoaWindow.mm#1895-1935

This causes the alert window have a devicePixelRatio of 2 but the top
level have a devicePixelRatio of 1.

Which means that nsDeviceContext thinks we have a DPI of 1, but
AppWindow and co have a DPI of 2, causing this mismatch.

Fix this by making GetTopLevelWidget actually return the nsCocoaWindow
widget for the alert, not the other.

This restores the behavior for cocoa, but changes it for Windows and
Linux (Android can't have nested top level windows, afaict).

Given windows and Linux both had the concept of "top level widget" in a
similar fashion, I think we can try this. I'll add a smaller fix for
uplift purposes.

Differential Revision: https://phabricator.services.mozilla.com/D227875
2024-11-08 09:29:26 +00:00
Botond Ballo
26e490ad6c Bug 1929746 - Put Linux hold gestures behind a pref. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D228275
2024-11-07 16:05:03 +00:00
Norisz Fay
a777a71cbf Backed out changeset 0c01a856e4c3 (bug 1870427) as requested by Emilio CLOSED TREE 2024-11-02 22:28:11 +02:00
Brad Werth
4eb2440013 Bug 1870427: Call XSync on the display for the window, not the default display. r=emilio
This may fix a source of "BadDrawable" X Window crashes. It's based on
reasoning from a fix for Bug 133713.

Differential Revision: https://phabricator.services.mozilla.com/D227407
2024-10-31 22:23:51 +00:00
serge-sans-paille
5946338a6a Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-30 11:05:24 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
stransky
c9128db70b Bug 1927090 [Linux] Track mShell release r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D226885
2024-10-26 06:02:04 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Emilio Cobos Álvarez
8955f5a673 Bug 1924240 - Devirtualize parent handling. r=mac-reviewers,win-reviewers,geckoview-reviewers,bradwerth,m_kato,rkraesig
Move mParent to nsIWidget.h along with kids and so on. Instead of
ReparentNativeWidget add a more general DidChangeParent method.

Make mParent weak to prevent cycles. These are broken on Destroy() but
it feels kinda silly, and we were inconsistent before I started this
effort so pretty sure it can be done.

Differential Revision: https://phabricator.services.mozilla.com/D225796
2024-10-22 20:25:18 +00:00
Emilio Cobos Álvarez
ccfb880865 Bug 1924240 - More common parent handling between Linux and Windows. r=stransky,win-reviewers,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D225426
2024-10-22 20:25:17 +00:00
Cosmin Sabou
f3981441dd Backed out 4 changesets (bug 1924240) for causing failures related to nsBaseWidget. CLOSED TREE
Backed out changeset 4d75277ebe4e (bug 1924240)
Backed out changeset 7cec75426e72 (bug 1924240)
Backed out changeset 3c9fb8f4a18e (bug 1924240)
Backed out changeset 66cf65217104 (bug 1924240)
2024-10-22 22:24:52 +03:00
Emilio Cobos Álvarez
a98c45506e Bug 1924240 - Devirtualize parent handling. r=mac-reviewers,win-reviewers,geckoview-reviewers,bradwerth,m_kato,rkraesig
Move mParent to nsIWidget.h along with kids and so on. Instead of
ReparentNativeWidget add a more general DidChangeParent method.

Make mParent weak to prevent cycles. These are broken on Destroy() but
it feels kinda silly, and we were inconsistent before I started this
effort so pretty sure it can be done.

Differential Revision: https://phabricator.services.mozilla.com/D225796
2024-10-22 16:32:47 +00:00
Emilio Cobos Álvarez
3210318028 Bug 1924240 - More common parent handling between Linux and Windows. r=stransky,win-reviewers,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D225426
2024-10-22 16:32:45 +00:00
Emilio Cobos Álvarez
ffd3f99e26 Bug 1924616 - Remove KDE resizer hack. r=stransky
This was implemented in bug 1813554 to allow resizing tiled windows at
the top of the window, but since then KWin has changed behavior and no
longer allows resizing tiled windows, so this is now unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D226005
2024-10-18 09:47:15 +00:00
Botond Ballo
b77045aa19 Bug 1568722 - Handle Linux hold gestures in APZ. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D225439
2024-10-16 19:59:07 +00:00
Tamas Szentpeteri
8285dfaab8 Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. 2024-10-08 23:27:18 +03:00
serge-sans-paille
1966f9a43c Bug 1920718 - Annotate all global variable with runtime initialization as MOZ_RUNINIT r=application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-08 16:49:51 +00:00
Emilio Cobos Álvarez
3db3f89e13 Bug 1923289 - Don't report popups as transparent in uncomposited screens. r=stransky
This makes us choose the right rounding mode in nsView::CalcWidgetBounds
in order to prevent seams.

Remove composited screen special case which is no longer relevant now
that the X11 shape mask code is gone.

Differential Revision: https://phabricator.services.mozilla.com/D224918
2024-10-08 12:11:00 +00:00
Emilio Cobos Álvarez
7e3778ba99 Bug 1922956 - Further clean-up widget creation code-paths. r=win-reviewers,mac-reviewers,geckoview-reviewers,mstange,rkraesig,m_kato
This is all super-hacky (see a lot of the XXXcjones comments).

Simplify it... We never create widgets with a bare native parent but no
nsIWidget parent. Pass nsIWidgets and deal with things correctly.

There were also things that were dealing with stuff that can't happen,
like top level popups, children of PuppetWidgets, or such.

Instead of overriding Create(), let's just teach nsBaseWidget about
non-native (headless/puppet) widgets.

Remove lots of old APIs for the native window stuff that are unused
and/or unimplemented.

Differential Revision: https://phabricator.services.mozilla.com/D224613
2024-10-07 16:43:53 +00:00
Emilio Cobos Álvarez
f8a42a3842 Bug 1921903 - Ensure we don't create hidden widgets in non-macOS platforms. r=rkraesig,geckoview-reviewers,win-reviewers,m_kato
Pretty sure that we can't hit that case right now, and try with MOZ_ASSERT
agrees with me at least.

Popups don't get there. For puppet widgets, mParentWidget is provided
explicitly.

This code is all super messy and can be cleaned-up significantly.
See following patch.

Differential Revision: https://phabricator.services.mozilla.com/D224612
2024-10-07 10:15:16 +00:00
stransky
dcadd53641 Bug 1836886 [Wayland] Implement smooth scrolling r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D223285
2024-10-04 12:07:12 +00:00
serge-sans-paille
9c8d693599 Bug 1921270 - Remove global constructor from widget/gtk/nsWindow.cpp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D223863
2024-10-03 06:55:07 +00:00
Sandor Molnar
48acafccc3 Backed out 6 changesets (bug 1921341, bug 1921268, bug 1921270, bug 1921269, bug 1921267, bug 1921276) for causing build bustages @ gfxSVGGlyphs.h CLOSED TREE
Backed out changeset 2a5d5e7e863b (bug 1921341)
Backed out changeset 86df2445ee83 (bug 1921276)
Backed out changeset bf1b223af380 (bug 1921270)
Backed out changeset 4cdbd2521712 (bug 1921269)
Backed out changeset 6bb5d64f664a (bug 1921267)
Backed out changeset 7ec43f4b07ff (bug 1921268)
2024-10-03 02:05:13 +03:00
serge-sans-paille
621196218d Bug 1921270 - Remove global constructor from widget/gtk/nsWindow.cpp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D223863
2024-10-02 19:41:39 +00:00
Emilio Cobos Álvarez
7d8a3560cf Bug 1919115 - Check per-edge resizability in CheckResizerEdge(). r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D223977
2024-10-02 10:32:19 +00:00
Butkovits Atila
bc3492892e Backed out 6 changesets (bug 1921267, bug 1921270, bug 1921269, bug 1921276, bug 1921268, bug 1921341) for causing bustages at WheelHandlingHelper.cpp.
Backed out changeset d9054241c1f4 (bug 1921341)
Backed out changeset 5b4ba445b189 (bug 1921276)
Backed out changeset 6497eb64ef2a (bug 1921270)
Backed out changeset 9c39218f7372 (bug 1921269)
Backed out changeset 2d5d640c060d (bug 1921267)
Backed out changeset 7b068aede249 (bug 1921268)
2024-10-01 15:17:46 +03:00
serge-sans-paille
98e994284f Bug 1921270 - Remove global constructor from widget/gtk/nsWindow.cpp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D223863
2024-10-01 09:09:39 +00:00
Sandor Molnar
bfdb9bff72 Backed out changeset 5dfed78115dc (bug 1836886) for causing bc failures @ browser_disableSwipeGestures.js CLOSED TREE 2024-09-30 11:40:08 +03:00
stransky
91fed9b689 Bug 1836886 [Wayland] Implement smooth scrolling r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D223285
2024-09-30 06:57:35 +00:00
stransky
bd1d001925 Bug 1899299 [Linux] Listen mouse events on mShell for modal popups r=emilio
A popup attached to a modal parent window doesn't get mouse events
from Gtk as they'are directed to the modal parent. This is usually solved
by pointer grab which that doesn't work on Wayland in our current
setup as it performs show and grab in one step.

We emulate it by setting popup as modal too but then patent
window doesn't get mouse events outside of popup (Bug 1899299).
we need to listen

Surprisingly attaching events handler to mShell fixes it
and we're getting events from both parent and popup windows.

Differential Revision: https://phabricator.services.mozilla.com/D221290
2024-09-12 12:17:58 +00:00
Martin Stransky
d56dd2bd5e Bug 1915596 [Wayland] Get touchpad hold event directly from Wayland display r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D220551
2024-09-06 09:16:28 +00:00
Emilio Cobos Álvarez
b0608ef1b9 Bug 1913104 - Remove X11 mask code. r=stransky,desktop-theme-reviewers,dao
It's only used in non-compositing WMs, to implement popup transparency,
and it's completely untested.

Instead, do not draw shadows and rounded corners on those WMs.

Differential Revision: https://phabricator.services.mozilla.com/D219141
2024-08-16 12:48:28 +00:00
Sandor Molnar
d80357e6a8 Backed out changeset 2822f96450d4 (bug 1913104) for causing dt failures @ browser_rules_container-queries.js CLOSED TREE 2024-08-16 13:08:16 +03:00
Emilio Cobos Álvarez
1ecbf8d63a Bug 1913104 - Remove X11 mask code. r=stransky,desktop-theme-reviewers,dao
It's only used in non-compositing WMs, to implement popup transparency,
and it's completely untested.

Instead, do not draw shadows and rounded corners on those WMs.

Differential Revision: https://phabricator.services.mozilla.com/D219141
2024-08-16 08:11:18 +00:00
stransky
bc452247d2 Bug 1899299 [Linux] Remove GetFirstNSWindowForGDKWindow() as we don't use widget plugins r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216912
2024-08-16 06:54:58 +00:00
stransky
24b8465cdf Bug 1899299 [Linux] Remove mRetryPointerGrab as it's unused r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216911
2024-08-16 06:54:57 +00:00
Iulian Moraru
c8c411cb37 Backed out 5 changesets (bug 1899299) for causing multiple functional regressions on Linux. CLOSED TREE
Backed out changeset 25389422d457 (bug 1899299)
Backed out changeset e0e1f122e646 (bug 1899299)
Backed out changeset d300cc8b778e (bug 1899299)
Backed out changeset d6e1dbfd1002 (bug 1899299)
Backed out changeset a0c9c1dcb19c (bug 1899299)
2024-08-13 16:27:08 +03:00
stransky
5fe85de041 Bug 1899299 [Linux] Keep propagating relocated mShell events to child widgets r=emilio
Depends on D216914

Differential Revision: https://phabricator.services.mozilla.com/D216946
2024-08-12 06:35:00 +00:00
stransky
595c0ba868 Bug 1899299 [Linux] Reformat widget event code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216914
2024-08-12 06:35:00 +00:00
stransky
9da56db9a4 Bug 1899299 [Linux] Move some widget events from mContainer to mShell r=emilio
- Move more widget events from mContainer to mShell. We generally want to listen on mShell and use mContainer
  for GtkContainer related events only.
- Set correct event masks for mShell/mContainer

Differential Revision: https://phabricator.services.mozilla.com/D216913
2024-08-12 06:34:59 +00:00