Skip to content
This repository

window-list applet: prevent mouse-wheel scroll from grabbing windows from other workspaces #1152

Merged
merged 1 commit into from over 1 year ago

3 participants

Michael Webster imarkskinner Clement Lefebvre
Michael Webster
Collaborator

Fixes #1150

imarkskinner

I'm also noticing this issue, to replicate it:

  1. In Cinnamon settings > Windows, select "Enable mouse-wheel scrolling in Window List applet"
  2. Move some open windows across multiple workspaces
  3. Use the mouse wheel on the window list applet

Notice how all of your windows from various workspaces get forcibly moved into one workspace

Clement Lefebvre clefebvre merged commit 111160d into from September 27, 2012
Clement Lefebvre clefebvre closed this September 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 18, 2012
Michael Webster window-list applet: prevent mouse-wheel scroll from grabbing windows …
…from

other workspaces
eefd64e
This page is out of date. Refresh to see the latest.
12  files/usr/share/cinnamon/applets/window-list@cinnamon.org/applet.js
@@ -354,9 +354,15 @@ AppMenuButton.prototype = {
354 354
     _onScrollEvent: function(actor, event) {
355 355
         let direction = event.get_scroll_direction();
356 356
         let current;
357  
-        let num_windows = this.window_list.length;
  357
+        let vis_windows = new Array();
  358
+        for (let i = 0; i < this.window_list.length; i++) {
  359
+            if (this.window_list[i].actor.visible) {
  360
+                vis_windows.push(i);
  361
+            }
  362
+        }
  363
+        let num_windows = vis_windows.length;
358 364
         for (let i = 0; i < num_windows; i++) {
359  
-            if (this.window_list[i].metaWindow.has_focus()) {
  365
+            if (this.window_list[vis_windows[i]].metaWindow.has_focus()) {
360 366
                 current = i;
361 367
                 break;
362 368
             }
@@ -368,7 +374,7 @@ AppMenuButton.prototype = {
368 374
         if (direction == 0) {
369 375
             target = ((current + 1) <= num_windows - 1) ? (current + 1) : 0;
370 376
         }
371  
-        this.window_list[target].metaWindow.activate(global.get_current_time());
  377
+        this.window_list[vis_windows[target]].metaWindow.activate(global.get_current_time());
372 378
     },
373 379
 
374 380
     _onDragBegin: function() {
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.