mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1186662 - Part 3: Suppress the Displayport during active resize on Windows. r=kats,jimm
--HG-- extra : commitid : FI8OCMTZVoP extra : rebase_source : f09763a2f182039f7cddc7eda32ec4a7cc6b76ff
This commit is contained in:
parent
3993946636
commit
f50d3758bc
@ -337,7 +337,9 @@ static bool gIsPointerEventsEnabled = false;
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
nsWindow::nsWindow() : nsWindowBase()
|
||||
nsWindow::nsWindow()
|
||||
: nsWindowBase()
|
||||
, mResizeState(NOT_RESIZING)
|
||||
{
|
||||
mIconSmall = nullptr;
|
||||
mIconBig = nullptr;
|
||||
@ -5325,11 +5327,49 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
||||
DispatchPendingEvents();
|
||||
break;
|
||||
|
||||
case WM_SIZING:
|
||||
{
|
||||
// When we get WM_ENTERSIZEMOVE we don't know yet if we're in a live
|
||||
// resize or move event. Instead we wait for first VM_SIZING message
|
||||
// within a ENTERSIZEMOVE to consider this a live resize event.
|
||||
if (mResizeState == IN_SIZEMOVE) {
|
||||
mResizeState = RESIZING;
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
mozilla::services::GetObserverService();
|
||||
|
||||
if (observerService) {
|
||||
observerService->NotifyObservers(nullptr, "live-resize-start",
|
||||
nullptr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_ENTERSIZEMOVE:
|
||||
{
|
||||
if (mResizeState == NOT_RESIZING) {
|
||||
mResizeState = IN_SIZEMOVE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_EXITSIZEMOVE:
|
||||
{
|
||||
if (mResizeState == RESIZING) {
|
||||
mResizeState = NOT_RESIZING;
|
||||
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
|
||||
|
||||
if (observerService) {
|
||||
observerService->NotifyObservers(nullptr, "live-resize-end", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (!sIsInMouseCapture) {
|
||||
NotifySizeMoveDone();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_NCLBUTTONDBLCLK:
|
||||
DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0, lParamToClient(lParam),
|
||||
@ -7521,7 +7561,6 @@ nsWindow::DealWithPopups(HWND aWnd, UINT aMessage,
|
||||
return false;
|
||||
|
||||
case WM_MOVING:
|
||||
case WM_SIZING:
|
||||
case WM_MENUSELECT:
|
||||
break;
|
||||
|
||||
|
@ -562,6 +562,14 @@ protected:
|
||||
|
||||
nsIntRect mLastPaintBounds;
|
||||
|
||||
// Used for displayport suppression during window resize
|
||||
enum ResizeState {
|
||||
NOT_RESIZING,
|
||||
IN_SIZEMOVE,
|
||||
RESIZING,
|
||||
};
|
||||
ResizeState mResizeState;
|
||||
|
||||
// Transparency
|
||||
#ifdef MOZ_XUL
|
||||
// Use layered windows to support full 256 level alpha translucency
|
||||
|
Loading…
Reference in New Issue
Block a user