From c23358ac957619cef2dc5f3f3ece33e2d2b6dd0e Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 21 Sep 2024 23:28:46 +0900 Subject: [PATCH] Revert "internal/restorable: remove 'volatile' attribute when restorable is not used" This reverts commit 9bdc89d40f602b9d6fc0c9e06d9d0c039e842bfd. Reason: Unexpected changes were included --- internal/restorable/image.go | 8 +++----- internal/ui/window.go | 4 ---- internal/ui/window_glfw.go | 16 ---------------- window.go | 4 ---- 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/internal/restorable/image.go b/internal/restorable/image.go index b974283f1..eab5ccc9b 100644 --- a/internal/restorable/image.go +++ b/internal/restorable/image.go @@ -169,11 +169,9 @@ func NewImage(width, height int, imageType ImageType) *Image { } var attribute string - if needsRestoration() { - switch imageType { - case ImageTypeVolatile: - attribute = "volatile" - } + switch imageType { + case ImageTypeVolatile: + attribute = "volatile" } i := &Image{ image: graphicscommand.NewImage(width, height, imageType == ImageTypeScreen, attribute), diff --git a/internal/ui/window.go b/internal/ui/window.go index 830264b66..aae945c37 100644 --- a/internal/ui/window.go +++ b/internal/ui/window.go @@ -43,7 +43,6 @@ type Window interface { IsClosingHandled() bool SetMousePassthrough(enabled bool) IsMousePassthrough() bool - RequestAttention() } type nullWindow struct{} @@ -129,6 +128,3 @@ func (*nullWindow) SetMousePassthrough(enabled bool) { func (*nullWindow) IsMousePassthrough() bool { return false } - -func (*nullWindow) RequestAttention() { -} diff --git a/internal/ui/window_glfw.go b/internal/ui/window_glfw.go index ab5c2d681..4cdc7fec1 100644 --- a/internal/ui/window_glfw.go +++ b/internal/ui/window_glfw.go @@ -506,19 +506,3 @@ func (w *glfwWindow) IsMousePassthrough() bool { }) return v } - -func (w *glfwWindow) RequestAttention() { - if w.ui.isTerminated() { - return - } - if !w.ui.isRunning() { - // Do nothing - return - } - w.ui.mainThread.Call(func() { - if w.ui.isTerminated() { - return - } - w.ui.window.RequestAttention() - }) -} diff --git a/window.go b/window.go index f628d447c..70f7efd2e 100644 --- a/window.go +++ b/window.go @@ -341,7 +341,3 @@ func SetWindowMousePassthrough(enabled bool) { func IsWindowMousePassthrough() bool { return ui.Get().Window().IsMousePassthrough() } - -func RequestWindowAttention() { - ui.Get().Window().RequestAttention() -}