@@ -50,6 +50,8 @@ func ExecuteAction(action string, tr *desktop.Tracker, ws *desktop.Workspace) bo
50
50
success = ToggleDecoration (tr , ws )
51
51
case "restore" :
52
52
success = Restore (tr , ws )
53
+ case "reset" :
54
+ success = Reset (tr , ws )
53
55
case "cycle_next" :
54
56
success = CycleNext (tr , ws )
55
57
case "cycle_previous" :
@@ -66,30 +68,32 @@ func ExecuteAction(action string, tr *desktop.Tracker, ws *desktop.Workspace) bo
66
68
success = MaximizedLayout (tr , ws )
67
69
case "layout_fullscreen" :
68
70
success = FullscreenLayout (tr , ws )
71
+ case "slave_increase" :
72
+ success = IncreaseSlave (tr , ws )
73
+ case "slave_decrease" :
74
+ success = DecreaseSlave (tr , ws )
75
+ case "master_increase" :
76
+ success = IncreaseMaster (tr , ws )
77
+ case "master_decrease" :
78
+ success = DecreaseMaster (tr , ws )
79
+ case "window_next" :
80
+ success = NextWindow (tr , ws )
81
+ case "window_previous" :
82
+ success = PreviousWindow (tr , ws )
83
+ case "screen_next" :
84
+ success = NextScreen (tr , ws )
85
+ case "screen_previous" :
86
+ success = PreviousScreen (tr , ws )
69
87
case "master_make" :
70
88
success = MakeMaster (tr , ws )
71
89
case "master_make_next" :
72
90
success = MakeMasterNext (tr , ws )
73
91
case "master_make_previous" :
74
92
success = MakeMasterPrevious (tr , ws )
75
- case "master_increase" :
76
- success = IncreaseMaster (tr , ws )
77
- case "master_decrease" :
78
- success = DecreaseMaster (tr , ws )
79
- case "slave_increase" :
80
- success = IncreaseSlave (tr , ws )
81
- case "slave_decrease" :
82
- success = DecreaseSlave (tr , ws )
83
93
case "proportion_increase" :
84
94
success = IncreaseProportion (tr , ws )
85
95
case "proportion_decrease" :
86
96
success = DecreaseProportion (tr , ws )
87
- case "window_next" :
88
- success = NextWindow (tr , ws )
89
- case "window_previous" :
90
- success = PreviousWindow (tr , ws )
91
- case "reset" :
92
- success = Reset (tr , ws )
93
97
case "restart" :
94
98
success = Restart (tr )
95
99
case "exit" :
@@ -217,6 +221,19 @@ func Restore(tr *desktop.Tracker, ws *desktop.Workspace) bool {
217
221
return true
218
222
}
219
223
224
+ func Reset (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
225
+ if ws .TilingDisabled () {
226
+ return false
227
+ }
228
+ ws .ResetLayouts ()
229
+ tr .Tile (ws )
230
+
231
+ ui .ShowLayout (ws )
232
+ ui .UpdateIcon (ws )
233
+
234
+ return true
235
+ }
236
+
220
237
func CycleNext (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
221
238
if ws .TilingDisabled () {
222
239
return false
@@ -353,47 +370,30 @@ func FullscreenLayout(tr *desktop.Tracker, ws *desktop.Workspace) bool {
353
370
return true
354
371
}
355
372
356
- func MakeMaster (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
357
- if ws .TilingDisabled () {
358
- return false
359
- }
360
- if c , ok := tr .Clients [store .Windows .Active .Id ]; ok {
361
- ws .ActiveLayout ().MakeMaster (c )
362
- tr .Tile (ws )
363
- return true
364
- }
365
-
366
- return false
367
- }
368
-
369
- func MakeMasterNext (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
373
+ func IncreaseSlave (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
370
374
if ws .TilingDisabled () {
371
375
return false
372
376
}
373
- c := ws .ActiveLayout ().NextClient ()
374
- if c == nil {
375
- return false
376
- }
377
-
378
- ws .ActiveLayout ().MakeMaster (c )
377
+ ws .ActiveLayout ().IncreaseSlave ()
379
378
tr .Tile (ws )
380
379
381
- return NextWindow (tr , ws )
380
+ ui .ShowLayout (ws )
381
+ ui .UpdateIcon (ws )
382
+
383
+ return true
382
384
}
383
385
384
- func MakeMasterPrevious (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
386
+ func DecreaseSlave (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
385
387
if ws .TilingDisabled () {
386
388
return false
387
389
}
388
- c := ws .ActiveLayout ().PreviousClient ()
389
- if c == nil {
390
- return false
391
- }
392
-
393
- ws .ActiveLayout ().MakeMaster (c )
390
+ ws .ActiveLayout ().DecreaseSlave ()
394
391
tr .Tile (ws )
395
392
396
- return PreviousWindow (tr , ws )
393
+ ui .ShowLayout (ws )
394
+ ui .UpdateIcon (ws )
395
+
396
+ return true
397
397
}
398
398
399
399
func IncreaseMaster (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
@@ -422,53 +422,86 @@ func DecreaseMaster(tr *desktop.Tracker, ws *desktop.Workspace) bool {
422
422
return true
423
423
}
424
424
425
- func IncreaseSlave (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
425
+ func NextWindow (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
426
426
if ws .TilingDisabled () {
427
427
return false
428
428
}
429
- ws .ActiveLayout ().IncreaseSlave ()
430
- tr .Tile (ws )
429
+ c := ws .ActiveLayout ().NextClient ()
430
+ if c == nil {
431
+ return false
432
+ }
431
433
432
- ui .ShowLayout (ws )
433
- ui .UpdateIcon (ws )
434
+ store .ActiveWindowSet (store .X , c .Window )
434
435
435
436
return true
436
437
}
437
438
438
- func DecreaseSlave (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
439
+ func PreviousWindow (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
439
440
if ws .TilingDisabled () {
440
441
return false
441
442
}
442
- ws .ActiveLayout ().DecreaseSlave ()
443
- tr .Tile (ws )
443
+ c := ws .ActiveLayout ().PreviousClient ()
444
+ if c == nil {
445
+ return false
446
+ }
444
447
445
- ui .ShowLayout (ws )
446
- ui .UpdateIcon (ws )
448
+ store .ActiveWindowSet (store .X , c .Window )
447
449
448
450
return true
449
451
}
450
452
451
- func IncreaseProportion (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
453
+ func NextScreen (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
452
454
if ws .TilingDisabled () {
453
455
return false
454
456
}
455
- ws .ActiveLayout ().IncreaseProportion ()
456
- tr .Tile (ws )
457
+ c := tr .ActiveClient ()
458
+ if c == nil {
459
+ return false
460
+ }
457
461
458
- return true
462
+ screen := int (c .Latest .Location .Screen ) + 1
463
+ if screen > int (store .Workplace .ScreenCount )- 1 {
464
+ return false
465
+ }
466
+ tr .Handlers .Reset ()
467
+
468
+ return c .MoveToScreen (uint32 (screen ))
459
469
}
460
470
461
- func DecreaseProportion (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
471
+ func PreviousScreen (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
462
472
if ws .TilingDisabled () {
463
473
return false
464
474
}
465
- ws .ActiveLayout ().DecreaseProportion ()
475
+ c := tr .ActiveClient ()
476
+ if c == nil {
477
+ return false
478
+ }
479
+
480
+ screen := int (c .Latest .Location .Screen ) - 1
481
+ if screen < 0 {
482
+ return false
483
+ }
484
+ tr .Handlers .Reset ()
485
+
486
+ return c .MoveToScreen (uint32 (screen ))
487
+ }
488
+
489
+ func MakeMaster (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
490
+ if ws .TilingDisabled () {
491
+ return false
492
+ }
493
+ c := ws .ActiveLayout ().ActiveClient ()
494
+ if c == nil {
495
+ return false
496
+ }
497
+
498
+ ws .ActiveLayout ().MakeMaster (c )
466
499
tr .Tile (ws )
467
500
468
501
return true
469
502
}
470
503
471
- func NextWindow (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
504
+ func MakeMasterNext (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
472
505
if ws .TilingDisabled () {
473
506
return false
474
507
}
@@ -477,12 +510,13 @@ func NextWindow(tr *desktop.Tracker, ws *desktop.Workspace) bool {
477
510
return false
478
511
}
479
512
480
- store .ActiveWindowSet (store .X , c .Window )
513
+ ws .ActiveLayout ().MakeMaster (c )
514
+ tr .Tile (ws )
481
515
482
- return true
516
+ return NextWindow ( tr , ws )
483
517
}
484
518
485
- func PreviousWindow (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
519
+ func MakeMasterPrevious (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
486
520
if ws .TilingDisabled () {
487
521
return false
488
522
}
@@ -491,20 +525,28 @@ func PreviousWindow(tr *desktop.Tracker, ws *desktop.Workspace) bool {
491
525
return false
492
526
}
493
527
494
- store .ActiveWindowSet (store .X , c .Window )
528
+ ws .ActiveLayout ().MakeMaster (c )
529
+ tr .Tile (ws )
495
530
496
- return true
531
+ return PreviousWindow ( tr , ws )
497
532
}
498
533
499
- func Reset (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
534
+ func IncreaseProportion (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
500
535
if ws .TilingDisabled () {
501
536
return false
502
537
}
503
- ws .ResetLayouts ()
538
+ ws .ActiveLayout (). IncreaseProportion ()
504
539
tr .Tile (ws )
505
540
506
- ui .ShowLayout (ws )
507
- ui .UpdateIcon (ws )
541
+ return true
542
+ }
543
+
544
+ func DecreaseProportion (tr * desktop.Tracker , ws * desktop.Workspace ) bool {
545
+ if ws .TilingDisabled () {
546
+ return false
547
+ }
548
+ ws .ActiveLayout ().DecreaseProportion ()
549
+ tr .Tile (ws )
508
550
509
551
return true
510
552
}
0 commit comments