Skip to content

Commit

Permalink
Merge branch 'linuxmint:master' into feat/workspace-switcher/show-win…
Browse files Browse the repository at this point in the history
…dow-icon
  • Loading branch information
anaximeno committed Apr 27, 2023
2 parents 13a6fe0 + 4bfc268 commit c4f29b2
Show file tree
Hide file tree
Showing 53 changed files with 2,391 additions and 651 deletions.
6 changes: 5 additions & 1 deletion data/org.cinnamon.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@
<summary>Show all windows from all workspaces</summary>
</key>

<key type="b" name="alttab-switcher-warp-mouse-pointer">
<default>false</default>
<summary>Warp mouse pointer to the new focused window</summary>
</key>

<key name="bring-windows-to-current-workspace" type="b">
<default>false</default>
<summary>not used - lives in org.cinnamon.muffin now</summary>
Expand Down Expand Up @@ -506,7 +511,6 @@
<summary>The logo to use in the system info settings</summary>
<description>
An icon name or absolute path to an icon, which will be used for the system icon in the "System Info" settings app.
.
Disabled if no value is set.
</description>
</key>
Expand Down
10 changes: 6 additions & 4 deletions data/theme/cinnamon.css
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,11 @@ StScrollBar StButton#vhandle:hover {
padding-right: 7px;
padding-bottom: 7px;
}
.menu-category-button:hover {
background-color: rgba(128,128,128,0.2);
border-radius: 4px;
border-image: none;
}
.menu-category-button-greyed {
padding-top: 7px;
padding-left: 7px;
Expand Down Expand Up @@ -1272,9 +1277,6 @@ StScrollBar StButton#vhandle:hover {
}
.menu-category-button-label:rtl {
padding-right: 5px;

}
.menu-category-button-selected:hover {
}
/* Name and description of the currently hovered item in the menu
* This appears on the bottom right hand corner of the menu*/
Expand Down Expand Up @@ -2095,4 +2097,4 @@ StScrollBar StButton#vhandle:hover {
-pie-border-width: 1px;
-pie-border-color: rgba(200, 200, 200, 0.8);
-pie-background-color: rgba(140, 140, 140, 0.6);;
}
}
1 change: 1 addition & 0 deletions debian/cinnamon-common.install
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ etc/xdg/menus/cinnamon*
usr/share/cinnamon
usr/share/cinnamon-session
usr/share/desktop-directories
usr/share/gir-1.0
usr/share/glib-2.0
usr/share/icons
usr/share/polkit-1
Expand Down
45 changes: 45 additions & 0 deletions files/usr/share/cinnamon/applets/[email protected]/applet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Applet = imports.ui.applet;
const GLib = imports.gi.GLib;
const St = imports.gi.St;
const Lang = imports.lang;
const Clutter = imports.gi.Clutter;
Expand All @@ -9,6 +10,8 @@ const SignalManager = imports.misc.signalManager;
const Mainloop = imports.mainloop;
const Tweener = imports.ui.tweener;

const SCROLL_DELAY = 200;

class CinnamonBarApplet extends Applet.Applet {
constructor(orientation, panel_height, instance_id) {
super(orientation, panel_height, instance_id);
Expand All @@ -20,15 +23,20 @@ class CinnamonBarApplet extends Applet.Applet {
this.settings.bind("peek-blur", "peek_blur");
this.settings.bind("click-action", "click_action");
this.settings.bind("middle-click-action", "middle_click_action");
this.settings.bind("scroll-behavior", "scroll_behavior");

this.signals = new SignalManager.SignalManager(null);
this.actor.connect('enter-event', Lang.bind(this, this._on_enter));
this.actor.connect('leave-event', Lang.bind(this, this._on_leave));
this.signals.connect(global.stage, 'notify::key-focus', this._on_leave, this);
this.actor.connect('scroll-event', Lang.bind(this, this._on_scroll_event));

this._did_peek = false;
this._peek_timeout_id = 0;

this._last_scroll_time = 0;
this._last_scroll_direction = 0;

this.actor.style_class = 'applet-cornerbar-box';
this.setAllowedLayout(Applet.AllowedLayout.BOTH);

Expand Down Expand Up @@ -154,6 +162,43 @@ class CinnamonBarApplet extends Applet.Applet {
}
}

_on_scroll_event(actor,event) {
if (this.scroll_behavior == "nothing") {
return GLib.SOURCE_CONTINUE;
}

if (this._peek_timeout_id > 0) {
Mainloop.source_remove(this._peek_timeout_id);
this._peek_timeout_id = 0;
}

const edir = event.get_scroll_direction();
if (edir == Clutter.ScrollDirection.SMOOTH) {
return GLib.SOURCE_CONTINUE;
}

const etime = event.get_time();
if (etime > (this._last_scroll_time + SCROLL_DELAY) ||
edir !== this._last_scroll_direction) {

let index = global.screen.get_active_workspace_index();

if ((edir == Clutter.ScrollDirection.UP) == (this.scroll_behavior == "normal"))
index = index - 1;
else
index = index + 1;

if (global.screen.get_workspace_by_index(index) != null) {
global.screen.get_workspace_by_index(index).activate(global.get_current_time());
}

this._last_scroll_direction = edir;
this._last_scroll_time = etime;
}

return GLib.SOURCE_CONTINUE;
}

show_all_windows(time) {
let windows = global.get_window_actors();
for(let i = 0; i < windows.length; i++){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
"Show the window selector (Scale)": "show_scale"
}
},
"scroll-behavior": {
"type": "combobox",
"default": "none",
"description": "Scroll wheel behavior",
"tooltip": ".",
"options": {
"Nothing": "nothing",
"Switch workspaces": "normal",
"Switch workspaces (reversed)": "reversed"
}
},
"peek-at-desktop" : {
"type" : "switch",
"default" : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class AppGroup {
}

flashButton() {
if (!this._needsAttention || !this.actor || this._flashTimer)
if (!this._needsAttention || !this.actor || this.flashTimer)
return;

if (!this.groupState.groupReady && this.groupState.isFavoriteApp)
Expand Down Expand Up @@ -884,8 +884,8 @@ class AppGroup {
this.groupState.lastFocused.unminimize();
}
let ws = this.groupState.lastFocused.get_workspace().index();
if (ws !== global.screen.get_active_workspace_index()) {
global.screen.get_workspace_by_index(ws).activate(global.get_current_time());
if (ws !== global.workspace_manager.get_active_workspace_index()) {
global.workspace_manager.get_workspace_by_index(ws).activate(global.get_current_time());
}
Main.activateWindow(this.groupState.lastFocused, global.get_current_time());
this.actor.add_style_pseudo_class('focus');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AppList {
this.lastFocusedApp = null;

// Connect all the signals
this.signals.connect(global.screen, 'window-workspace-changed', (...args) => this.windowWorkspaceChanged(...args));
this.signals.connect(global.display, 'window-workspace-changed', (...args) => this.windowWorkspaceChanged(...args));
// Ugly change: refresh the removed app instances from all workspaces
this.signals.connect(this.metaWorkspace, 'window-removed', (...args) => this.windowRemoved(...args));
this.signals.connect(global.window_manager, 'switch-workspace' , (...args) => this.reloadList(...args));
Expand Down Expand Up @@ -235,7 +235,7 @@ class AppList {
&& this.state.monitorWatchList.indexOf(metaWindow.get_monitor()) > -1;
}

windowWorkspaceChanged(screen, metaWorkspace, metaWindow) {
windowWorkspaceChanged(display, metaWorkspace, metaWindow) {
this.windowAdded(metaWindow, metaWorkspace);
}

Expand Down
24 changes: 12 additions & 12 deletions files/usr/share/cinnamon/applets/[email protected]/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class GroupedWindowListApplet extends Applet.Applet {
instance_id,
monitorWatchList: [],
autoStartApps: [],
currentWs: global.screen.get_active_workspace_index(),
currentWs: global.workspace_manager.get_active_workspace_index(),
panelEditMode: global.settings.get_boolean('panel-edit-mode'),
menuOpen: false,
dragging: {
Expand Down Expand Up @@ -293,10 +293,10 @@ class GroupedWindowListApplet extends Applet.Applet {
this.signals.connect(this.actor, 'scroll-event', (c, e) => this.handleScroll(e));
this.signals.connect(global, 'scale-changed', (...args) => this.onUIScaleChange(...args));
this.signals.connect(global.window_manager, 'switch-workspace', (...args) => this.onSwitchWorkspace(...args));
this.signals.connect(global.screen, 'workspace-removed', (...args) => this.onWorkspaceRemoved(...args));
this.signals.connect(global.screen, 'window-monitor-changed', (...args) => this.onWindowMonitorChanged(...args));
this.signals.connect(global.workspace_manager, 'workspace-removed', (...args) => this.onWorkspaceRemoved(...args));
this.signals.connect(global.display, 'window-monitor-changed', (...args) => this.onWindowMonitorChanged(...args));
this.signals.connect(Main.panelManager, 'monitors-changed', (...args) => this._onMonitorsChanged(...args));
this.signals.connect(global.screen, 'window-skip-taskbar-changed', (...args) => this.onWindowSkipTaskbarChanged(...args));
this.signals.connect(global.display, 'window-skip-taskbar-changed', (...args) => this.onWindowSkipTaskbarChanged(...args));
this.signals.connect(global.display, 'window-marked-urgent', (...args) => this.updateAttentionState(...args));
this.signals.connect(global.display, 'window-demands-attention', (...args) => this.updateAttentionState(...args));
this.signals.connect(global.display, 'window-created', (...args) => this.onWindowCreated(...args));
Expand Down Expand Up @@ -446,7 +446,7 @@ class GroupedWindowListApplet extends Applet.Applet {
return false;
}

onWindowMonitorChanged(screen, metaWindow, metaWorkspace) {
onWindowMonitorChanged(display, metaWindow, metaWorkspace) {
if (this.state.monitorWatchList.length !== this.numberOfMonitors) {
let appList = this.getCurrentAppList();
if (appList !== null) {
Expand All @@ -459,11 +459,11 @@ class GroupedWindowListApplet extends Applet.Applet {
bindAppKeys() {
this.unbindAppKeys();

for (let i = 1; i < 10; i++) {
if (this.state.settings.SuperNumHotkeys) {
if (this.state.settings.SuperNumHotkeys) {
for (let i = 1; i < 10; i++) {
this.bindAppKey(i);
this.bindNewAppKey(i);
}
this.bindNewAppKey(i);
}
Main.keybindingManager.addHotKey('launch-show-apps-order', this.state.settings.showAppsOrderHotkey, () =>
this.showAppsOrder()
Expand Down Expand Up @@ -935,7 +935,7 @@ class GroupedWindowListApplet extends Applet.Applet {
return true;
}

onWorkspaceRemoved(metaScreen, index) {
onWorkspaceRemoved(workspaceManager, index) {
if (this.appLists.length <= index) {
return;
}
Expand All @@ -955,7 +955,7 @@ class GroupedWindowListApplet extends Applet.Applet {
for (let i = removedLists.length - 1; i >= 0; i--) {
this.appLists.splice(removedLists[i], 1);
}
this.state.set({currentWs: global.screen.get_active_workspace_index()});
this.state.set({currentWs: global.workspace_manager.get_active_workspace_index()});
}

onSwitchWorkspace() {
Expand All @@ -965,7 +965,7 @@ class GroupedWindowListApplet extends Applet.Applet {
_onSwitchWorkspace() {
if (!this.state) return;
this.state.set({currentWs: global.workspace_manager.get_active_workspace_index()});
let metaWorkspace = global.screen.get_workspace_by_index(this.state.currentWs);
let metaWorkspace = global.workspace_manager.get_workspace_by_index(this.state.currentWs);

// If the workspace we switched to isn't in our list,
// we need to create an AppList for it
Expand All @@ -990,7 +990,7 @@ class GroupedWindowListApplet extends Applet.Applet {
this.actor.queue_relayout();
}

onWindowSkipTaskbarChanged(screen, metaWindow) {
onWindowSkipTaskbarChanged(display, metaWindow) {
let appList = this.getCurrentAppList();

if (metaWindow.is_skip_taskbar()) {
Expand Down
Loading

0 comments on commit c4f29b2

Please sign in to comment.