mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 928722 - Resample the system scrollbar width when the UI theme is changed or mouse plugged in. (pair programmed with mconley). r=mconley
This commit is contained in:
parent
d2a09efaae
commit
cba4ee8eb1
@ -47,6 +47,8 @@ const PanelUI = {
|
||||
|
||||
this.menuButton.addEventListener("mousedown", this);
|
||||
this.menuButton.addEventListener("keypress", this);
|
||||
this._overlayScrollListenerBoundFn = this._overlayScrollListener.bind(this);
|
||||
window.matchMedia("(-moz-overlay-scrollbars)").addListener(this._overlayScrollListenerBoundFn);
|
||||
this._initialized = true;
|
||||
},
|
||||
|
||||
@ -77,6 +79,8 @@ const PanelUI = {
|
||||
this.helpView.removeEventListener("ViewShowing", this._onHelpViewShow);
|
||||
this.menuButton.removeEventListener("mousedown", this);
|
||||
this.menuButton.removeEventListener("keypress", this);
|
||||
window.matchMedia("(-moz-overlay-scrollbars)").removeListener(this._overlayScrollListenerBoundFn);
|
||||
this._overlayScrollListenerBoundFn = null;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -443,6 +447,12 @@ const PanelUI = {
|
||||
quitButton.setAttribute("tooltiptext", tooltipString);
|
||||
#endif
|
||||
},
|
||||
|
||||
_overlayScrollListenerBoundFn: null,
|
||||
_overlayScrollListener: function(aMQL) {
|
||||
ScrollbarSampler.resetSystemScrollbarWidth();
|
||||
this._scrollWidth = null;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -31,6 +31,10 @@ this.ScrollbarSampler = {
|
||||
return deferred.promise;
|
||||
},
|
||||
|
||||
resetSystemScrollbarWidth: function() {
|
||||
gSystemScrollbarWidth = null;
|
||||
},
|
||||
|
||||
_sampleSystemScrollbarWidth: function() {
|
||||
let deferred = Promise.defer();
|
||||
let hwin = Services.appShell.hiddenDOMWindow;
|
||||
|
Loading…
Reference in New Issue
Block a user