Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lacymorrow committed Jun 5, 2023
1 parent 65c3583 commit 3f2bdca
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/crossover.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ const keyboardShortcuts = () => {
},
},

// Focus next window
{
action: 'nextWindow',
keybind: `${accelerator}+N`,
fn() {

windows.nextWindow()

},
},

// Move CrossOver to next monitor
{
action: 'changeDisplay',
Expand Down
12 changes: 12 additions & 0 deletions src/main/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ async function load( win = this.win || windows.win ) {
// windows.each( win => console.log(win)) or each(windows, win => console.log(win))
async function each( w, fn, ...args ) {

// If no window passed, throw away args
if ( typeof w === 'function' ) {

args.unshift( fn )
Expand Down Expand Up @@ -497,6 +498,16 @@ const moveWindow = options_ => {

}

const nextWindow = () => {

const targetWindow = windows.getActiveWindow()
const windowsList = windows.getAllWindows()
const index = windowsList.indexOf( targetWindow )
const nextWindow = windowsList[( index + 1 ) % windowsList.length]
nextWindow.focus()

}

const onWillResize = ( _event, newBounds ) => {

if ( !newBounds ) {
Expand Down Expand Up @@ -589,6 +600,7 @@ const windows = {
hideWindow,
moveToNextDisplay,
moveWindow,
nextWindow,
onWillResize,
safeSetBounds,
setProgress,
Expand Down
Binary file added src/static/crosshairs/User Created/bullet-drop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3f2bdca

Please sign in to comment.