在歌词滚动结束后清理窗口阴影,缓解Mac下桌面歌词出现残留阴影的问题
This commit is contained in:
@@ -194,6 +194,11 @@ export const getMainFrame = (): Electron.WebFrameMain | null => {
|
||||
return browserWindow.webContents.mainFrame
|
||||
}
|
||||
|
||||
export const invalidateShadow = () => {
|
||||
if (!browserWindow) return
|
||||
browserWindow.invalidateShadow()
|
||||
}
|
||||
|
||||
interface AlwaysOnTopTools {
|
||||
timeout: NodeJS.Timeout | null
|
||||
setAlwaysOnTop: (isLoop: boolean) => void
|
||||
|
||||
@@ -3,7 +3,7 @@ import { mainOn, mainHandle } from '@common/mainIpc'
|
||||
import { WIN_LYRIC_RENDERER_EVENT_NAME } from '@common/ipcNames'
|
||||
import { buildLyricConfig, getLyricWindowBounds } from './utils'
|
||||
import { sendNewDesktopLyricClient } from '@main/modules/winMain'
|
||||
import { getBounds, getMainFrame, sendEvent, setBounds } from './main'
|
||||
import { getBounds, getMainFrame, invalidateShadow, sendEvent, setBounds } from './main'
|
||||
import { MessageChannelMain } from 'electron'
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ export default () => {
|
||||
setBounds(getLyricWindowBounds(getBounds(), options))
|
||||
})
|
||||
|
||||
mainOn(WIN_LYRIC_RENDERER_EVENT_NAME.invalidate_shadow, () => {
|
||||
invalidateShadow()
|
||||
})
|
||||
|
||||
mainOn(WIN_LYRIC_RENDERER_EVENT_NAME.request_main_window_channel, ({ event }) => {
|
||||
if (event.senderFrame !== getMainFrame()) return
|
||||
// Create a new channel ...
|
||||
|
||||
Reference in New Issue
Block a user