Fix power menu VPN display and navigation rendering issues
- Fixed power menu showing VPN address twice by excluding VPN interfaces (tailscale, wg, netbird, tun, wt) when detecting local IP - Fixed site bleeding through during navigation by removing all other BrowserViews before attaching new one - Fixed dim navigation popup by forcing reflow and adding fade-in effect - Added webContents.invalidate() to ensure proper view rendering after switch These changes improve the visual clarity and reliability of the navigation system and power menu display.
This commit is contained in:
+33
-1
@@ -4672,6 +4672,18 @@ function attachView(i){
|
||||
if(!mainWindow||!views[i]||showingHidden)return;
|
||||
|
||||
currentIndex=i;
|
||||
|
||||
// Remove all other views to prevent bleeding through
|
||||
views.forEach((view,idx)=>{
|
||||
if(idx!==i&&mainWindow&&!mainWindow.isDestroyed()){
|
||||
try{
|
||||
mainWindow.removeBrowserView(view);
|
||||
}catch(e){
|
||||
// View may not be attached, ignore
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
try{
|
||||
mainWindow.addBrowserView(views[i]);
|
||||
}catch(e){
|
||||
@@ -4680,6 +4692,11 @@ function attachView(i){
|
||||
mainWindow.setTopBrowserView(views[i]);
|
||||
const[w,h]=mainWindow.getContentSize();
|
||||
views[i].setBounds({x:0,y:0,width:w,height:h});
|
||||
|
||||
// Force repaint to ensure proper rendering
|
||||
if(views[i].webContents){
|
||||
views[i].webContents.invalidate();
|
||||
}
|
||||
|
||||
const tabIdx=viewIndexToTabIndex(i);
|
||||
if(tabIdx>=0&&tabs[tabIdx]){
|
||||
@@ -5069,14 +5086,19 @@ function showPowerMenu(){
|
||||
let localIP='No IP';
|
||||
let vpnIP='';
|
||||
|
||||
// Get local IP
|
||||
// Get local IP (exclude VPN interfaces)
|
||||
for(const name of Object.keys(ipAddress)){
|
||||
// Skip VPN interfaces
|
||||
if(name.startsWith('tailscale')||name.startsWith('wg')||name.startsWith('netbird')||name.startsWith('tun')||name.startsWith('wt')){
|
||||
continue;
|
||||
}
|
||||
for(const net of ipAddress[name]){
|
||||
if(net.family==='IPv4'&&!net.internal){
|
||||
localIP=net.address;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(localIP!=='No IP')break;
|
||||
}
|
||||
|
||||
// Get VPN IPs (Tailscale, WireGuard, Netbird)
|
||||
@@ -6531,6 +6553,14 @@ window.addEventListener('DOMContentLoaded',()=>{
|
||||
navMenu.style.display='flex';
|
||||
navMenuVisible=true;
|
||||
|
||||
// Force reflow and repaint to ensure proper rendering
|
||||
navMenu.offsetHeight;
|
||||
navMenu.style.opacity='0';
|
||||
setTimeout(()=>{
|
||||
navMenu.style.transition='opacity 0.15s ease-in';
|
||||
navMenu.style.opacity='1';
|
||||
},10);
|
||||
|
||||
// Set 30-second auto-dismiss timer
|
||||
if(navMenuTimer){
|
||||
clearTimeout(navMenuTimer);
|
||||
@@ -6555,6 +6585,8 @@ window.addEventListener('DOMContentLoaded',()=>{
|
||||
}
|
||||
if(navMenu){
|
||||
navMenu.style.display='none';
|
||||
navMenu.style.opacity='1';
|
||||
navMenu.style.transition='';
|
||||
}
|
||||
navMenuVisible=false;
|
||||
console.log('[NAV] Menu hidden');
|
||||
|
||||
Reference in New Issue
Block a user