Closed Bug 1447775 Opened 6 years ago Closed 6 years ago

Window buttons are not centered vertically when main window is maximized and drag space is enabled

Categories

(Firefox :: Theme, defect)

61 Branch
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Tracking Status
firefox60 --- wontfix
firefox63 --- wontfix
firefox64 --- wontfix
firefox65 --- verified

People

(Reporter: zzag, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: fixed by bug 1356920)

Attachments

(2 files, 1 obsolete file)

Attached image with-drag-space.png
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180321102906

Steps to reproduce:

1. Use latest KDE Plasma (5.12.3)
2. Check "Drag Space" checkbox (i.e. enable drag space)
3. Uncheck "Title Bar" checkbox (i.e. enable CSD)
3. Maximize window


Actual results:

Window controls(close, maximize, minimize) aren't centered vertically.


Expected results:

Window controls(close, maximize, minimize) should be centered vertically.
Attached image without-drag-space.png
For reference, this is how Firefox looks with drag space being disabled.
Blocks: gtktitlebar
Summary: [KDE] Windows buttons are not centered vertically when main window is maximized and drag space is enabled → [KDE] Window buttons are not centered vertically when main window is maximized and drag space is enabled
This affects only maximized windows, right? In that case the drag space is not rendered (it's rendered at normal state only AFAIK).
Flags: needinfo?(vladzzag)
Yes, I can reproduce that on gnome-shell/Adwaita theme too.
Assignee: nobody → stransky
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(vladzzag)
(In reply to Martin Stránský [:stransky] from comment #2)
> In that case the drag space is not rendered (it's rendered at normal state only AFAIK).

I'd like to point out that there is a little space above tabs when Firefox is maximized and the drag space is disabled. Yet, there is no space above tabs when the drag space is enabled (when Firefox is maximized). :D
Window buttons are vertically centered. Did you fix that?
Looks like we need to call some refresh when maximize/unmaximize here. When the icons are rendered incorrectly it's enough to toggle menu bar and the rendering is fixed (at least for me).
(In reply to Martin Stránský [:stransky] from comment #6)
> Looks like we need to call some refresh when maximize/unmaximize here. When
> the icons are rendered incorrectly it's enough to toggle menu bar and the
> rendering is fixed (at least for me).

OK, after playing with enabling/disabling drag space and maximizing/unmaximizing Firefox, I could reproduce the bug again. Toggling menu bar helped me too.
This is a variant of Bug 715867. sizemodechange/resize is fireed *before* actual window.sizemode attribute is changed. The sequence is:

1) Window size is changed
2) sizemodechange/resize is fired
3) TabsInTitlebar._layOutTitlebar() calculates new titlebar size but with old TabsToolbar.height value:

   let fullTabsHeight = rect($("TabsToolbar")).height;

4) sizemode is set to "normal", CSS rule applies:

  /* Add extra space to titlebar for dragging */
  :root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar,
  :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar {
    padding-top: var(--space-above-tabbar);
  }

5) TabsToolbar has extra padding which causes icons are not centered.
Sizemode attribute is updated by nsXULWindow::SavePersistentAttributes() which is fired by timer. I wonder how that does work on other systems...
Component: Widget: Gtk → XP Toolkit/Widgets: XUL
Component: XP Toolkit/Widgets: XUL → Event Handling
Summary: [KDE] Window buttons are not centered vertically when main window is maximized and drag space is enabled → Window buttons are not centered vertically when main window is maximized and drag space is enabled
(nothing to do with event handling.)
Component: Event Handling → Widget
This is probably going to regress something. :) You should fire off a try run on multiple platforms for this just to check.
Comment on attachment 8967302 [details]
Bug 1447775 - Change persist mode immediately after sizemodechange change,

https://reviewboard.mozilla.org/r/235984/#review242340
Attachment #8967302 - Flags: review?(jmathies) → review+
You're right, there's a regression on MacOS:

https://treeherder.mozilla.org/logviewer.html#?job_id=173232063&repo=try&lineNumber=20399

03:35:57     INFO - GECKO(2280) | [2280, Main Thread] ###!!! ASSERTION: mBounds out of sync!: 'mWindow && mBounds == r', file /builds/worker/workspace/build/src/widget/cocoa/nsCocoaWindow.mm, line 1717
03:35:57     INFO - GECKO(2280) | #01: nsBaseWidget::GetRestoredBounds(mozilla::gfx::IntRectTyped<mozilla::LayoutDevicePixel>&) [widget/nsBaseWidget.cpp:1661]
03:35:57     INFO - 
03:35:57     INFO - GECKO(2280) | #02: nsXULWindow::SavePersistentAttributes() [xpfe/appshell/nsXULWindow.cpp:1628]
Dao, is this one also covered by bug 1356920? Thanks.
Flags: needinfo?(dao+bmo)
(In reply to Martin Stránský [:stransky] from comment #17)
> Dao, is this one also covered by bug 1356920? Thanks.

Yeah, I guess it would fix this.
Depends on: 1356920
Flags: needinfo?(dao+bmo)
I believe this is fixed.
Assignee: stransky → nobody
Status: NEW → RESOLVED
Closed: 6 years ago
Component: Widget → Theme
Product: Core → Firefox
Resolution: --- → FIXED
Whiteboard: fixed by bug 1356920
Flags: qe-verify+
Attachment #8967302 - Attachment is obsolete: true

I have managed to reproduce this issue on an affected Firefox 61.0a1 (20180320220122) build using Ubuntu 18.06 x64 by following the STR from comment 0.

This issue is verified fixed using Firefox 65.0b12 and Firefox 66.0a1 (20190120213632) on the following OSes: Windows 10 x64, mac 10.13.6, Ubuntu 18.06 x64, Windows 8.1 x64.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: