Commit 517b42c2 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1822764 - Only do the extra resizer pixel on KDE. r=stransky, a=dsmith

It doesn't match the native GNOME behavior, so keep it in that DE only.

Differential Revision: https://phabricator.services.mozilla.com/D173676
parent a8caf1f2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -471,11 +471,14 @@ const nsCString& GetDesktopEnvironmentIdentifier() {
}

bool IsGnomeDesktopEnvironment() {
  return FindInReadable("gnome"_ns, GetDesktopEnvironmentIdentifier());
  static bool sIsGnome =
      !!FindInReadable("gnome"_ns, GetDesktopEnvironmentIdentifier());
  return sIsGnome;
}

bool IsKdeDesktopEnvironment() {
  return GetDesktopEnvironmentIdentifier().EqualsLiteral("kde");
  static bool sIsKde = GetDesktopEnvironmentIdentifier().EqualsLiteral("kde");
  return sIsKde;
}

}  // namespace mozilla::widget
+13 −9
Original line number Diff line number Diff line
@@ -4317,15 +4317,19 @@ Maybe<GdkWindowEdge> nsWindow::CheckResizerEdge(
      // we still want the resizers there, even when tiled.
      return true;
    }
    if (mDrawInTitlebar) {
      // If we show top resizers on a (non-PIP) tiled window on GNOME, it
      // doesn't really work, since the window is "stuck" to the top and
      // bottom, so don't show them in that case.
      return !mIsTiled;
    }
    // If we're not a PIP window nor drawing to the titlebar, we don't need to
    // add resizers.
    if (!mDrawInTitlebar) {
      return false;
    }
    // On KDE, allow for 1 extra pixel at the top of regular windows when
    // drawing to the titlebar. This matches the native titlebar behavior on
    // that environment. See bug 1813554.
    //
    // Don't do that on GNOME (see bug 1822764). If we wanted to do this on
    // GNOME we'd need an extra check for mIsTiled, since the window is "stuck"
    // to the top and bottom.
    //
    // Other DEs are untested.
    return mDrawInTitlebar && IsKdeDesktopEnvironment();
  }();

  if (!canResize) {