Skip to content

Commit

Permalink
Fix mac reinit-window
Browse files Browse the repository at this point in the history
- Autohide corsor on playback
  • Loading branch information
amarullz committed Jun 25, 2024
1 parent 88f2108 commit 6522ed3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 16 deletions.
4 changes: 4 additions & 0 deletions app/src/main/assets/view/m.css
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,10 @@ c.loader {
opacity: 1;
}

#pb:not(.menushow).nocursor{
cursor:none !important;
}

#pb_iactions {
position: absolute;
left: 0;
Expand Down
30 changes: 29 additions & 1 deletion app/src/main/assets/view/m.js
Original file line number Diff line number Diff line change
Expand Up @@ -8352,10 +8352,16 @@ const pb={
pb.pb.classList.remove('menushow');
pb.skipauto_update(1);
body.classList.add('playback_menu_hide');
pb.pb._nocursor=1;
try{
pb.pb.onmousemove();
}catch(e){}
},
menu_show:function(pos){
body.classList.remove('playback_menu_hide');
pb.pb.classList.add('menushow');
pb.pb.classList.remove('nocursor');
pb.pb._nocursor=0;
pb.menus[pb.menusel].classList.remove('active');
pb.menusel=(pos===undefined?2:pos);
pb.pb_actions.classList.add('active');
Expand Down Expand Up @@ -8667,7 +8673,29 @@ const pb={
}
},null,null,true);

// pb.pb.onmousemove=
pb.pb.lastmove=0;
pb.pb._nocursor=0;
pb.pb.onmousemove=function(){
if (pb.pb.__hidecursor_to){
clearTimeout(pb.pb.__hidecursor_to);
pb.pb.__hidecursor_to=null;
}
if (pb.pb._nocursor==1){
pb.pb.__hidecursor_to=setTimeout(
function(){
pb.pb.__hidecursor_to=null;
pb.pb._nocursor=2;
pb.pb.classList.add('nocursor');
},
1000
);
}
else if (pb.pb._nocursor==2){
pb.pb._nocursor=1;
pb.pb.classList.remove('nocursor');
pb.pb.onmousemove();
}
};
pb.pb.ontouchmove=function(){
if (pb.pb.classList.contains('menushow')){
pb.lastkey=$tick();
Expand Down
34 changes: 19 additions & 15 deletions electron/src/animetv.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const common = require("./libs/common.js");
const intercept = require("./libs/intercept.js");

const main={
initialized:false,
init(){
var mainDisplay = screen.getPrimaryDisplay();
var dw = mainDisplay.size.width * 3 / 4;
Expand Down Expand Up @@ -63,21 +64,24 @@ const main={
main.win.webContents.setUserAgent(common.UAG);

/* Init all handlers */
ipcMain.on("main",main.handlerWin);
main.win.webContents.on("before-input-event",main.handlerKeys);
ipcMain.on('config-load', main.handlerConfigLoad);
ipcMain.on('vars-load', main.handlerVarsLoad);
ipcMain.handle('config-save', main.handlerConfigSave);
ipcMain.handle('vars-save', main.handlerVarsSave);
ipcMain.handle('intent-start', main.handlerIntent);
ipcMain.handle('set-url', (e,d)=>{
if (d!=''){
main.win.loadURL(d);
}
});
ipcMain.handle('exec-js', (e,d)=>{
common.execJs(d);
});
if (!main.initialized){
ipcMain.on("main",main.handlerWin);
main.win.webContents.on("before-input-event",main.handlerKeys);
ipcMain.on('config-load', main.handlerConfigLoad);
ipcMain.on('vars-load', main.handlerVarsLoad);
ipcMain.handle('config-save', main.handlerConfigSave);
ipcMain.handle('vars-save', main.handlerVarsSave);
ipcMain.handle('intent-start', main.handlerIntent);
ipcMain.handle('set-url', (e,d)=>{
if (d!=''){
main.win.loadURL(d);
}
});
ipcMain.handle('exec-js', (e,d)=>{
common.execJs(d);
});
main.initialized=true;
}

/* init values */
if ('__sd' in common.config){
Expand Down

0 comments on commit 6522ed3

Please sign in to comment.