Merge pull request #57 from outis1one/claude/fix-power-menu-vpn-01Bfone8eTWK9fQxkvFe8TDk
Fix power menu VPN display and navigation rendering issues
This commit is contained in:
+33
-1
@@ -4672,6 +4672,18 @@ function attachView(i){
|
|||||||
if(!mainWindow||!views[i]||showingHidden)return;
|
if(!mainWindow||!views[i]||showingHidden)return;
|
||||||
|
|
||||||
currentIndex=i;
|
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{
|
try{
|
||||||
mainWindow.addBrowserView(views[i]);
|
mainWindow.addBrowserView(views[i]);
|
||||||
}catch(e){
|
}catch(e){
|
||||||
@@ -4681,6 +4693,11 @@ function attachView(i){
|
|||||||
const[w,h]=mainWindow.getContentSize();
|
const[w,h]=mainWindow.getContentSize();
|
||||||
views[i].setBounds({x:0,y:0,width:w,height:h});
|
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);
|
const tabIdx=viewIndexToTabIndex(i);
|
||||||
if(tabIdx>=0&&tabs[tabIdx]){
|
if(tabIdx>=0&&tabs[tabIdx]){
|
||||||
const configuredUrl=tabs[tabIdx].url;
|
const configuredUrl=tabs[tabIdx].url;
|
||||||
@@ -5069,14 +5086,19 @@ function showPowerMenu(){
|
|||||||
let localIP='No IP';
|
let localIP='No IP';
|
||||||
let vpnIP='';
|
let vpnIP='';
|
||||||
|
|
||||||
// Get local IP
|
// Get local IP (exclude VPN interfaces)
|
||||||
for(const name of Object.keys(ipAddress)){
|
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]){
|
for(const net of ipAddress[name]){
|
||||||
if(net.family==='IPv4'&&!net.internal){
|
if(net.family==='IPv4'&&!net.internal){
|
||||||
localIP=net.address;
|
localIP=net.address;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(localIP!=='No IP')break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get VPN IPs (Tailscale, WireGuard, Netbird)
|
// Get VPN IPs (Tailscale, WireGuard, Netbird)
|
||||||
@@ -6531,6 +6553,14 @@ window.addEventListener('DOMContentLoaded',()=>{
|
|||||||
navMenu.style.display='flex';
|
navMenu.style.display='flex';
|
||||||
navMenuVisible=true;
|
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
|
// Set 30-second auto-dismiss timer
|
||||||
if(navMenuTimer){
|
if(navMenuTimer){
|
||||||
clearTimeout(navMenuTimer);
|
clearTimeout(navMenuTimer);
|
||||||
@@ -6555,6 +6585,8 @@ window.addEventListener('DOMContentLoaded',()=>{
|
|||||||
}
|
}
|
||||||
if(navMenu){
|
if(navMenu){
|
||||||
navMenu.style.display='none';
|
navMenu.style.display='none';
|
||||||
|
navMenu.style.opacity='1';
|
||||||
|
navMenu.style.transition='';
|
||||||
}
|
}
|
||||||
navMenuVisible=false;
|
navMenuVisible=false;
|
||||||
console.log('[NAV] Menu hidden');
|
console.log('[NAV] Menu hidden');
|
||||||
|
|||||||
Reference in New Issue
Block a user