1
0

Accepting request 539426 from home:xiaoguang_wang:branches:GNOME:Factory

- Move SLE-Classic function in gnome-shell to
  gnome-shell-extensions (bsc#1065611).
  + Update gnome-shell-add-app-to-desktop.patch
  + Update gse-sle-classic-ext.patch
  + Update sle-classic-favorites-menu-at-end.patch
  + Update sle-classic-xorg.desktop
  + Update sle-classic.desktop
  + Add sle-classic.json
  + Add sle-classic@suse.com.tar.gz

OBS-URL: https://build.opensuse.org/request/show/539426
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-shell-extensions?expand=0&rev=152
This commit is contained in:
Dominique Leuenberger 2017-11-07 09:42:17 +00:00 committed by Git OBS Bridge
parent ab0fe324fc
commit f826bb2e1d
9 changed files with 278 additions and 598 deletions

View File

@ -1,7 +1,7 @@
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js Index: gnome-shell-extensions-3.26.1/extensions/apps-menu/extension.js
index 2f4002a..ed51e0c 100644 ===================================================================
--- a/extensions/apps-menu/extension.js --- gnome-shell-extensions-3.26.1.orig/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js +++ gnome-shell-extensions-3.26.1/extensions/apps-menu/extension.js
@@ -7,6 +7,8 @@ const Lang = imports.lang; @@ -7,6 +7,8 @@ const Lang = imports.lang;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const St = imports.gi.St; const St = imports.gi.St;
@ -11,7 +11,7 @@ index 2f4002a..ed51e0c 100644
const Main = imports.ui.main; const Main = imports.ui.main;
const Meta = imports.gi.Meta; const Meta = imports.gi.Meta;
const PanelMenu = imports.ui.panelMenu; const PanelMenu = imports.ui.panelMenu;
@@ -68,9 +70,20 @@ const ApplicationMenuItem = new Lang.Class({ @@ -68,9 +70,20 @@ const ApplicationMenuItem = new Lang.Cla
let textureCache = St.TextureCache.get_default(); let textureCache = St.TextureCache.get_default();
let iconThemeChangedId = textureCache.connect('icon-theme-changed', let iconThemeChangedId = textureCache.connect('icon-theme-changed',
Lang.bind(this, this._updateIcon)); Lang.bind(this, this._updateIcon));
@ -32,7 +32,7 @@ index 2f4002a..ed51e0c 100644
})); }));
this._updateIcon(); this._updateIcon();
@@ -92,6 +105,106 @@ const ApplicationMenuItem = new Lang.Class({ @@ -92,6 +105,105 @@ const ApplicationMenuItem = new Lang.Cla
}); });
}, },
@ -108,8 +108,7 @@ index 2f4002a..ed51e0c 100644
+ destDirPath = Glib.build_filenamev([GLib.get_home_dir(), "Desktop"]); + destDirPath = Glib.build_filenamev([GLib.get_home_dir(), "Desktop"]);
+ } + }
+ let destFile = Gio.File.new_for_path(destDirPath + '/' + sourceFile.get_basename()); + let destFile = Gio.File.new_for_path(destDirPath + '/' + sourceFile.get_basename());
+ if (sourceFile.copy(destFile, Gio.FileCopyFlags.OVERWRITE, + if (sourceFile.copy(destFile, Gio.FileCopyFlags.OVERWRITE, null, null)) {
+ null, null, null)) {
+ // In order to make the general monitor recognize the setting of metadata, + // In order to make the general monitor recognize the setting of metadata,
+ // this function call should before the setting of unix mode. + // this function call should before the setting of unix mode.
+ destFile.set_attribute_string("metadata::trusted", + destFile.set_attribute_string("metadata::trusted",

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon Nov 6 01:20:01 UTC 2017 - xwang@suse.com
- Move SLE-Classic function in gnome-shell to
gnome-shell-extensions (bsc#1065611).
+ Update gnome-shell-add-app-to-desktop.patch
+ Update gse-sle-classic-ext.patch
+ Update sle-classic-favorites-menu-at-end.patch
+ Update sle-classic-xorg.desktop
+ Update sle-classic.desktop
+ Add sle-classic.json
+ Add sle-classic@suse.com.tar.gz
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Nov 4 03:09:18 UTC 2017 - luc14n0@linuxmail.org Sat Nov 4 03:09:18 UTC 2017 - luc14n0@linuxmail.org

View File

@ -30,6 +30,8 @@ Source1: README.SUSE
Source2: sle-classic.desktop Source2: sle-classic.desktop
Source3: SLE-theme.tar.gz Source3: SLE-theme.tar.gz
Source4: sle-classic-xorg.desktop Source4: sle-classic-xorg.desktop
Source5: sle-classic.json
Source6: sle-classic@suse.com.tar.gz
# PATCH-FEATURE-OPENSUSE gnome-shell-add-app-to-desktop.patch bnc#870580 dliang@suse.com -- allow adding app shortcut to desktop easily. # PATCH-FEATURE-OPENSUSE gnome-shell-add-app-to-desktop.patch bnc#870580 dliang@suse.com -- allow adding app shortcut to desktop easily.
Patch1: gnome-shell-add-app-to-desktop.patch Patch1: gnome-shell-add-app-to-desktop.patch
# PATCH-FEATURE-SLE sle-classic-favorites-menu-at-end.patch bnc#890989 cxiong@suse.com -- put the favorites at the end of the app catogories for accessibility reason -- cxiong@suse.com bnc#890989 # PATCH-FEATURE-SLE sle-classic-favorites-menu-at-end.patch bnc#890989 cxiong@suse.com -- put the favorites at the end of the app catogories for accessibility reason -- cxiong@suse.com bnc#890989
@ -128,12 +130,19 @@ make %{?_smp_mflags}
%if !0%{?is_opensuse} %if !0%{?is_opensuse}
install -m0644 %{SOURCE2} %{buildroot}/%{_datadir}/xsessions/sle-classic.desktop install -m0644 %{SOURCE2} %{buildroot}/%{_datadir}/xsessions/sle-classic.desktop
install -m0644 %{SOURCE4} %{buildroot}/%{_datadir}/xsessions/sle-classic-xorg.desktop install -m0644 %{SOURCE4} %{buildroot}/%{_datadir}/xsessions/sle-classic-xorg.desktop
cp %{buildroot}/%{_datadir}/gnome-shell/extensions/window-list@gnome-shell-extensions.gcampax.github.com/classic.css \
%{buildroot}/%{_datadir}/gnome-shell/extensions/window-list@gnome-shell-extensions.gcampax.github.com/sle-classic.css
install -m0644 %{SOURCE5} %{buildroot}/%{_datadir}/gnome-shell/modes/sle-classic.json
install -d -m755 %{buildroot}%{_datadir}/wayland-sessions install -d -m755 %{buildroot}%{_datadir}/wayland-sessions
install -m0644 %{SOURCE2} %{buildroot}/%{_datadir}/wayland-sessions/sle-classic.desktop install -m0644 %{SOURCE2} %{buildroot}/%{_datadir}/wayland-sessions/sle-classic.desktop
# Install SLE theme # Install SLE theme
tar -xzvf %{SOURCE3} tar -xzvf %{SOURCE3}
install -d %{buildroot}%{_datadir}/gnome-shell/theme install -d %{buildroot}%{_datadir}/gnome-shell/theme
cp SLE-theme/theme/* %{buildroot}%{_datadir}/gnome-shell/theme cp SLE-theme/theme/* %{buildroot}%{_datadir}/gnome-shell/theme
#Install sle-classic@suse.com extension
tar -xzvf %{SOURCE6}
install -d %{buildroot}%{_datadir}/gnome-shell/extensions/sle-classic@suse.com
cp sle-classic@suse.com/* %{buildroot}%{_datadir}/gnome-shell/extensions/sle-classic@suse.com
# Prepare for 'default.desktop' being update-alternative handled, boo#1039756 # Prepare for 'default.desktop' being update-alternative handled, boo#1039756
mkdir -p %{buildroot}%{_sysconfdir}/alternatives mkdir -p %{buildroot}%{_sysconfdir}/alternatives
@ -191,6 +200,9 @@ ln -s %{_sysconfdir}/alternatives/default-waylandsession.desktop %{buildroot}%{_
%{_datadir}/xsessions/default.desktop %{_datadir}/xsessions/default.desktop
%{_datadir}/xsessions/sle-classic.desktop %{_datadir}/xsessions/sle-classic.desktop
%{_datadir}/xsessions/sle-classic-xorg.desktop %{_datadir}/xsessions/sle-classic-xorg.desktop
%{_datadir}/gnome-shell/extensions/window-list@gnome-shell-extensions.gcampax.github.com/sle-classic.css
%{_datadir}/gnome-shell/modes/sle-classic.json
%{_datadir}/gnome-shell/extensions/sle-classic@suse.com/
%dir %{_datadir}/wayland-sessions %dir %{_datadir}/wayland-sessions
%{_datadir}/wayland-sessions/default.desktop %{_datadir}/wayland-sessions/default.desktop
%{_datadir}/wayland-sessions/sle-classic.desktop %{_datadir}/wayland-sessions/sle-classic.desktop

View File

@ -1,7 +1,7 @@
diff --git a/data/gnome-classic.css b/data/gnome-classic.css Index: gnome-shell-extensions-3.26.1/data/gnome-classic.css
index 5331df9..dcda0db 100644 ===================================================================
--- a/data/gnome-classic.css --- gnome-shell-extensions-3.26.1.orig/data/gnome-classic.css
+++ b/data/gnome-classic.css +++ gnome-shell-extensions-3.26.1/data/gnome-classic.css
@@ -500,7 +500,12 @@ StScrollBar { @@ -500,7 +500,12 @@ StScrollBar {
color: rgba(46, 52, 54, 0.5); } color: rgba(46, 52, 54, 0.5); }
.popup-menu.panel-menu { .popup-menu.panel-menu {
@ -106,10 +106,10 @@ index 5331df9..dcda0db 100644
#panel .popup-menu-arrow { #panel .popup-menu-arrow {
width: 0; width: 0;
height: 0; } height: 0; }
diff --git a/extensions/window-list/classic.css b/extensions/window-list/classic.css Index: gnome-shell-extensions-3.26.1/extensions/window-list/classic.css
index f3c44a3..8096d27 100644 ===================================================================
--- a/extensions/window-list/classic.css --- gnome-shell-extensions-3.26.1.orig/extensions/window-list/classic.css
+++ b/extensions/window-list/classic.css +++ gnome-shell-extensions-3.26.1/extensions/window-list/classic.css
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
height: 2.25em ; height: 2.25em ;
} }
@ -151,77 +151,36 @@ index f3c44a3..8096d27 100644
color: #888; color: #888;
box-shadow: inset -1px -1px 1px rgba(0,0,0,0.5); box-shadow: inset -1px -1px 1px rgba(0,0,0,0.5);
} }
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js Index: gnome-shell-extensions-3.26.1/extensions/window-list/extension.js
index f01b872..6bd8709 100644 ===================================================================
--- a/extensions/window-list/extension.js --- gnome-shell-extensions-3.26.1.orig/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js +++ gnome-shell-extensions-3.26.1/extensions/window-list/extension.js
@@ -22,6 +22,8 @@ const _ = Gettext.gettext; @@ -28,6 +28,401 @@ const GroupingMode = {
const ICON_TEXTURE_SIZE = 24; ALWAYS: 2
const DND_ACTIVATE_TIMEOUT = 500; };
+const SLEClassicExt = imports.ui.SLEClassicExt; +function isSLEClassicMode() {
+ return Main.sessionMode.currentMode == "sle-classic" ? true : false;
+}
+ +
const GroupingMode = {
NEVER: 0,
AUTO: 1,
@@ -64,6 +66,9 @@ function _getAppStableSequence(app) {
}
+// TODO: not critical, but with `gnome-shell -r` there are `St-CRITICAL` errors
+// shown in stdout, 3 warnings for each existing window. Wrong initialization
+// order?
const WindowContextMenu = new Lang.Class({
Name: 'WindowContextMenu',
Extends: PopupMenu.PopupMenu,
@@ -113,6 +118,9 @@ const WindowContextMenu = new Lang.Class({
}));
this.addMenuItem(this._closeItem);
+ // NOTE add `-boxpointer-gap` to the menu, to align with `PanelMenu`,
+ // totally optional.
+ this.actor.add_style_class_name('bottom-panel-menu');
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this.connect('open-state-changed', () => {
@@ -678,6 +686,8 @@ const WorkspaceIndicator = new Lang.Class({
this.parent(0.0, _("Workspace Indicator"), true);
this.setMenu(new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.BOTTOM));
this.actor.add_style_class_name('window-list-workspace-indicator');
+ // NOTE: add `-boxpointer-gap`, totally optional
+ this.menu.actor.add_style_class_name('bottom-panel-menu');
this.menu.actor.remove_style_class_name('panel-menu');
let container = new St.Widget({ layout_manager: new Clutter.BinLayout(),
@@ -782,88 +792,52 @@ const WorkspaceIndicator = new Lang.Class({
}
});
-const WindowList = new Lang.Class({
- Name: 'WindowList',
+// NOTE: call `initializeWindowList` explicitly to finish initialization. +// NOTE: call `initializeWindowList` explicitly to finish initialization.
+const PureWinList = new Lang.Class({ +var PureWinList = new Lang.Class({
+ Name: 'PureWinList', + Name: 'PureWinList',
+
- _init: function(perMonitor, monitor) {
+ _init: function(perMonitor, monitor, maxWidthFunc) { + _init: function(perMonitor, monitor, maxWidthFunc) {
+ // NOTE: in SLE Classic `PureWinList` will NOT use any multiple monitor + // NOTE: in SLE Classic `PureWinList` will NOT use any multiple monitor
+ // support, the following is kept for use in GNOME Classic as we try to + // support, the following is kept for use in GNOME Classic as we try to
+ // unify code for two sides. + // unify code for two sides.
this._perMonitor = perMonitor; + this._perMonitor = perMonitor;
this._monitor = monitor; + this._monitor = monitor;
+ // NOTE: callback function given by the employer of this PureWinList. + // NOTE: callback function given by the employer of this PureWinList.
+ // Since PureWinList can be used various widgets hierarchy, we have to + // Since PureWinList can be used various widgets hierarchy, we have to
+ // leave the calculation of max available width to the employer. + // leave the calculation of max available width to the employer.
+ this._getMaxWindowListWidth = maxWidthFunc; + this._getMaxWindowListWidth = maxWidthFunc;
+
- this.actor = new St.Widget({ name: 'panel',
- style_class: 'bottom-panel solid',
+ let layout = new Clutter.BoxLayout({ homogeneous: true }); + let layout = new Clutter.BoxLayout({ homogeneous: true });
+ this.actor = new St.Widget({ style_class: 'window-list', + this.actor = new St.Widget({ style_class: 'window-list',
reactive: true, + reactive: true,
- track_hover: true,
- layout_manager: new Clutter.BinLayout()});
+ layout_manager: layout, + layout_manager: layout,
+ x_align: Clutter.ActorAlign.START, + x_align: Clutter.ActorAlign.START,
+ x_expand: true, + x_expand: true,
@ -233,75 +192,13 @@ index f01b872..6bd8709 100644
+ this.actor.layout_manager.spacing = spacing; + this.actor.layout_manager.spacing = spacing;
+ })); + }));
+ this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); + this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); + this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+
- let box = new St.BoxLayout({ x_expand: true, y_expand: true }); + this._appSystem = Shell.AppSystem.get_default();
- this.actor.add_actor(box); + this._appStateChangedId =
- + this._appSystem.connect('app-state-changed',
- let layout = new Clutter.BoxLayout({ homogeneous: true }); + Lang.bind(this, this._onAppStateChanged));
- this._windowList = new St.Widget({ style_class: 'window-list', +
- reactive: true,
- layout_manager: layout,
- x_align: Clutter.ActorAlign.START,
- x_expand: true,
- y_expand: true });
- box.add(this._windowList, { expand: true });
-
- this._windowList.connect('style-changed', Lang.bind(this,
- function() {
- let node = this._windowList.get_theme_node();
- let spacing = node.get_length('spacing');
- this._windowList.layout_manager.spacing = spacing;
- }));
- this._windowList.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
-
- let indicatorsBox = new St.BoxLayout({ x_align: Clutter.ActorAlign.END });
- box.add(indicatorsBox);
-
- this._workspaceIndicator = new WorkspaceIndicator();
- indicatorsBox.add(this._workspaceIndicator.container, { expand: false, y_fill: true });
-
- this._mutterSettings = new Gio.Settings({ schema_id: 'org.gnome.mutter' });
- this._workspaceSettings = this._getWorkspaceSettings();
- this._workspacesOnlyOnPrimaryChangedId =
- this._workspaceSettings.connect('changed::workspaces-only-on-primary',
- Lang.bind(this, this._updateWorkspaceIndicatorVisibility));
- this._dynamicWorkspacesSettings = this._getDynamicWorkspacesSettings();
- this._dynamicWorkspacesChangedId =
- this._dynamicWorkspacesSettings.connect('changed::dynamic-workspaces',
- Lang.bind(this, this._updateWorkspaceIndicatorVisibility));
- this._updateWorkspaceIndicatorVisibility();
-
- this._menuManager = new PopupMenu.PopupMenuManager(this);
- this._menuManager.addMenu(this._workspaceIndicator.menu);
-
- Main.layoutManager.addChrome(this.actor, { affectsStruts: true,
- trackFullscreen: true });
- Main.uiGroup.set_child_above_sibling(this.actor, Main.layoutManager.panelBox);
- Main.ctrlAltTabManager.addGroup(this.actor, _("Window List"), 'start-here-symbolic');
-
- this.actor.width = this._monitor.width;
- this.actor.connect('notify::height', Lang.bind(this, this._updatePosition));
- this._updatePosition();
-
this._appSystem = Shell.AppSystem.get_default();
this._appStateChangedId =
this._appSystem.connect('app-state-changed',
Lang.bind(this, this._onAppStateChanged));
- this._keyboardVisiblechangedId =
- Main.layoutManager.connect('keyboard-visible-changed',
- Lang.bind(this, function(o, state) {
- Main.layoutManager.keyboardBox.visible = state;
- let keyboardBox = Main.layoutManager.keyboardBox;
- keyboardBox.visible = state;
- if (state)
- Main.uiGroup.set_child_above_sibling(this.actor, keyboardBox);
- else
- Main.uiGroup.set_child_above_sibling(this.actor,
- Main.layoutManager.panelBox);
- this._updateKeyboardAnchor();
- }));
+ this._settings = Convenience.getSettings(); + this._settings = Convenience.getSettings();
+ +
+ // Grouping + // Grouping
@ -310,171 +207,101 @@ index f01b872..6bd8709 100644
+ Lang.bind(this, this._groupingModeChanged)); + Lang.bind(this, this._groupingModeChanged));
+ this._grouped = undefined; + this._grouped = undefined;
+ // NOTE: do NOT `_checkGrouping` here + // NOTE: do NOT `_checkGrouping` here
+
+ // workspace related + // workspace related
this._workspaceSignals = new Map(); + this._workspaceSignals = new Map();
this._nWorkspacesChangedId = + this._nWorkspacesChangedId =
global.screen.connect('notify::n-workspaces', + global.screen.connect('notify::n-workspaces',
@@ -874,42 +848,18 @@ const WindowList = new Lang.Class({ + Lang.bind(this, this._onWorkspacesChanged));
global.window_manager.connect('switch-workspace', + this._onWorkspacesChanged();
Lang.bind(this, this._checkGrouping)); +
+ this._switchWorkspaceId =
+ global.window_manager.connect('switch-workspace',
+ Lang.bind(this, this._checkGrouping));
+
+ // Hide and Show with Overview + // Hide and Show with Overview
this._overviewShowingId = + this._overviewShowingId =
Main.overview.connect('showing', Lang.bind(this, function() { + Main.overview.connect('showing', Lang.bind(this, function() {
this.actor.hide(); + this.actor.hide();
- this._updateKeyboardAnchor(); + }));
})); +
+ this._overviewHidingId =
this._overviewHidingId = + Main.overview.connect('hiding', Lang.bind(this, function() {
Main.overview.connect('hiding', Lang.bind(this, function() {
- this.actor.visible = !Main.layoutManager.primaryMonitor.inFullscreen;
- this._updateKeyboardAnchor();
- }));
-
- this._fullscreenChangedId =
- global.screen.connect('in-fullscreen-changed', Lang.bind(this, function() {
- this._updateKeyboardAnchor();
+ this.actor.show(); + this.actor.show();
})); + }));
+
- this._dragBeginId =
- Main.xdndHandler.connect('drag-begin',
- Lang.bind(this, this._onDragBegin));
- this._dragEndId =
- Main.xdndHandler.connect('drag-end',
- Lang.bind(this, this._onDragEnd));
- this._dragMonitor = {
- dragMotion: Lang.bind(this, this._onDragMotion)
- };
-
- this._dndTimeoutId = 0;
- this._dndWindow = null;
-
- this._settings = Convenience.getSettings();
- this._groupingModeChangedId =
- this._settings.connect('changed::grouping-mode',
- Lang.bind(this, this._groupingModeChanged));
- this._grouped = undefined;
- this._groupingModeChanged();
+ this._groupingMode = this._settings.get_enum('grouping-mode'); + this._groupingMode = this._settings.get_enum('grouping-mode');
}, + },
+
_getDynamicWorkspacesSettings: function() { + _getDynamicWorkspacesSettings: function() {
@@ -918,77 +868,77 @@ const WindowList = new Lang.Class({ + if (this._workspaceSettings.list_keys().indexOf('dynamic-workspaces') > -1)
return this._mutterSettings; + return this._workspaceSettings;
}, + return this._mutterSettings;
+ },
- _getWorkspaceSettings: function() { +
- let settings = global.get_overrides_settings();
- if (settings.list_keys().indexOf('workspaces-only-on-primary') > -1)
- return settings;
- return this._mutterSettings;
+ // NOTE: an API for parent panel to refresh the window list. This is + // NOTE: an API for parent panel to refresh the window list. This is
+ // necessary as window/app buttons require its parents having allocation and + // necessary as window/app buttons require its parents having allocation and
+ // positioning *completed* before being properly allocated and positioned + // positioning *completed* before being properly allocated and positioned
+ initializeWindowList: function() { + initializeWindowList: function() {
+ this._groupingModeChanged(); + this._groupingModeChanged();
}, + },
+
+ // NOTE: support scrolling in window list s.t. scrolling activate window + // NOTE: support scrolling in window list s.t. scrolling activate window
+ // buttons sequentially. + // buttons sequentially.
+ // + //
+ // *Code is rewritten*. + // *Code is rewritten*.
_onScrollEvent: function(actor, event) { + _onScrollEvent: function(actor, event) {
let direction = event.get_scroll_direction(); + let direction = event.get_scroll_direction();
let diff = 0; + let diff = 0;
- if (direction == Clutter.ScrollDirection.DOWN)
+ if (direction === Clutter.ScrollDirection.DOWN) + if (direction === Clutter.ScrollDirection.DOWN)
diff = 1; + diff = 1;
- else if (direction == Clutter.ScrollDirection.UP)
+ else if (direction === Clutter.ScrollDirection.UP) + else if (direction === Clutter.ScrollDirection.UP)
diff = -1; + diff = -1;
else + else
return; + return;
+
- let children = this._windowList.get_children().map(function(actor) {
+ let buttons = this.actor.get_children().map(function(actor) { + let buttons = this.actor.get_children().map(function(actor) {
return actor._delegate; + return actor._delegate;
}); + });
- let active = 0;
- for (let i = 0; i < children.length; i++) {
- if (children[i].active) {
- active = i;
+ let totalBtnNum = buttons.length; + let totalBtnNum = buttons.length;
+ +
+ let activeBtnIdx = 0 + let activeBtnIdx = 0
+ for (let i = 0; i < totalBtnNum; i++) { + for (let i = 0; i < totalBtnNum; i++) {
+ if (buttons[i].active) { + if (buttons[i].active) {
+ activeBtnIdx = i + activeBtnIdx = i
break; + break;
} + }
} + }
+
- active = Math.max(0, Math.min(active + diff, children.length-1));
- children[active].activate();
- },
+ // NOTE: bound by `0` and `totalBtnNum - 1`, no wrapping for + // NOTE: bound by `0` and `totalBtnNum - 1`, no wrapping for
+ // scrolling. + // scrolling.
+ activeBtnIdx = activeBtnIdx + diff; + activeBtnIdx = activeBtnIdx + diff;
+ let noScrollActionNeeded = ( (activeBtnIdx < 0) || (activeBtnIdx >= totalBtnNum) ); + let noScrollActionNeeded = ( (activeBtnIdx < 0) || (activeBtnIdx >= totalBtnNum) );
+ if (noScrollActionNeeded) + if (noScrollActionNeeded)
+ return; + return;
+
- _updatePosition: function() {
- this.actor.set_position(this._monitor.x,
- this._monitor.y + this._monitor.height - this.actor.height);
+ // TODO: no need to call `deactivate` for old `active button` ? + // TODO: no need to call `deactivate` for old `active button` ?
+ buttons[activeBtnIdx].activate(); + buttons[activeBtnIdx].activate();
}, + },
+
- _updateWorkspaceIndicatorVisibility: function() {
- let hasWorkspaces = this._dynamicWorkspacesSettings.get_boolean('dynamic-workspaces') ||
- global.screen.n_workspaces > 1;
- let workspacesOnMonitor = this._monitor == Main.layoutManager.primaryMonitor ||
- !this._workspaceSettings.get_boolean('workspaces-only-on-primary');
+ _onAppStateChanged: function(appSys, app) { + _onAppStateChanged: function(appSys, app) {
+ if (!this._grouped) + if (!this._grouped)
+ return; + return;
+
- this._workspaceIndicator.actor.visible = hasWorkspaces && workspacesOnMonitor;
+ if (app.state == Shell.AppState.RUNNING) + if (app.state == Shell.AppState.RUNNING)
+ this._addApp(app); + this._addApp(app);
+ else if (app.state == Shell.AppState.STOPPED) + else if (app.state == Shell.AppState.STOPPED)
+ this._removeApp(app); + this._removeApp(app);
}, + },
+
- _getPreferredUngroupedWindowListWidth: function() {
- if (this._windowList.get_n_children() == 0)
- return this._windowList.get_preferred_width(-1)[1];
-
- let children = this._windowList.get_children();
- let [, childWidth] = children[0].get_preferred_width(-1);
- let spacing = this._windowList.layout_manager.spacing;
-
- let workspace = global.screen.get_active_workspace();
- let windows = global.display.get_tab_list(Meta.TabList.NORMAL, workspace);
- if (this._perMonitor) {
- windows = windows.filter(Lang.bind(this, function(window) {
- return window.get_monitor() == this._monitor.index;
- }));
- }
- let nWindows = windows.length;
- if (nWindows == 0)
- return this._windowList.get_preferred_width(-1)[1];
-
- return nWindows * childWidth + (nWindows - 1) * spacing;
+ _addApp: function(app) { + _addApp: function(app) {
+ let button = new AppButton(app, this._perMonitor, this._monitor.index); + let button = new AppButton(app, this._perMonitor, this._monitor.index);
+ this.actor.layout_manager.pack(button.actor, + this.actor.layout_manager.pack(button.actor,
+ true, true, true, + true, true, true,
+ Clutter.BoxAlignment.START, + Clutter.BoxAlignment.START,
+ Clutter.BoxAlignment.START) + Clutter.BoxAlignment.START)
}, + },
+
- _getMaxWindowListWidth: function() {
- let indicatorsBox = this._workspaceIndicator.actor.get_parent();
- return this.actor.width - indicatorsBox.get_preferred_width(-1)[1];
+ _removeApp: function(app) { + _removeApp: function(app) {
+ let children = this.actor.get_children(); + let children = this.actor.get_children();
+ for (let i = 0; i < children.length; i++) { + for (let i = 0; i < children.length; i++) {
@ -483,22 +310,23 @@ index f01b872..6bd8709 100644
+ return; + return;
+ } + }
+ } + }
}, + },
+
_groupingModeChanged: function() { + _groupingModeChanged: function() {
@@ -997,7 +947,7 @@ const WindowList = new Lang.Class({ + this._groupingMode = this._settings.get_enum('grouping-mode');
if (this._groupingMode == GroupingMode.AUTO) { +
this._checkGrouping(); + if (this._groupingMode == GroupingMode.AUTO) {
} else { + this._checkGrouping();
- this._grouped = this._groupingMode == GroupingMode.ALWAYS; + } else {
+ this._grouped = ( this._groupingMode === GroupingMode.ALWAYS ); + this._grouped = ( this._groupingMode === GroupingMode.ALWAYS );
this._populateWindowList(); + this._populateWindowList();
} + }
}, + },
@@ -1006,6 +956,26 @@ const WindowList = new Lang.Class({ +
if (this._groupingMode != GroupingMode.AUTO) + _checkGrouping: function() {
return; + if (this._groupingMode != GroupingMode.AUTO)
+ return;
+
+ // TODO `_getMaxWindowListWidth` is known to depend on parent + // TODO `_getMaxWindowListWidth` is known to depend on parent
+ // conditions. However the following call seems to get the right parent + // conditions. However the following call seems to get the right parent
+ // value. So an option to avoid timing issue is to use the following + // value. So an option to avoid timing issue is to use the following
@ -519,106 +347,84 @@ index f01b872..6bd8709 100644
+ // not need to send re-allocation request up.). Then the re-allocation + // not need to send re-allocation request up.). Then the re-allocation
+ // signal is sent down to its origin. (downward propagation is necessary + // signal is sent down to its origin. (downward propagation is necessary
+ // as much of the positioning and allocation depends on one's parent) + // as much of the positioning and allocation depends on one's parent)
let maxWidth = this._getMaxWindowListWidth(); + let maxWidth = this._getMaxWindowListWidth();
let natWidth = this._getPreferredUngroupedWindowListWidth(); + let natWidth = this._getPreferredUngroupedWindowListWidth();
+
@@ -1017,7 +987,7 @@ const WindowList = new Lang.Class({ + let grouped = (maxWidth < natWidth);
}, + if (this._grouped !== grouped) {
+ this._grouped = grouped;
_populateWindowList: function() { + this._populateWindowList();
- this._windowList.destroy_all_children(); + }
+ },
+
+ _populateWindowList: function() {
+ this.actor.destroy_all_children(); + this.actor.destroy_all_children();
+
if (!this._grouped) { + if (!this._grouped) {
let windows = global.get_window_actors().sort( + let windows = global.get_window_actors().sort(
@@ -1038,42 +1008,8 @@ const WindowList = new Lang.Class({ + function(w1, w2) {
} + return w1.metaWindow.get_stable_sequence() -
}, + w2.metaWindow.get_stable_sequence();
+ });
- _updateKeyboardAnchor: function() { + for (let i = 0; i < windows.length; i++)
- if (!Main.keyboard.actor) + this._onWindowAdded(null, windows[i].metaWindow);
- return; + } else {
- + let apps = this._appSystem.get_running().sort(
- let anchorY = Main.overview.visible ? 0 : this.actor.height; + function(a1, a2) {
- Main.keyboard.actor.anchor_y = anchorY; + return _getAppStableSequence(a1) -
- }, + _getAppStableSequence(a2);
- + });
- _onAppStateChanged: function(appSys, app) { + for (let i = 0; i < apps.length; i++)
- if (!this._grouped) + this._addApp(apps[i]);
- return; + }
- + },
- if (app.state == Shell.AppState.RUNNING) +
- this._addApp(app);
- else if (app.state == Shell.AppState.STOPPED)
- this._removeApp(app);
- },
-
- _addApp: function(app) {
- let button = new AppButton(app, this._perMonitor, this._monitor.index);
- this._windowList.layout_manager.pack(button.actor,
- true, true, true,
- Clutter.BoxAlignment.START,
- Clutter.BoxAlignment.START);
- },
-
- _removeApp: function(app) {
- let children = this._windowList.get_children();
- for (let i = 0; i < children.length; i++) {
- if (children[i]._delegate.app == app) {
- children[i].destroy();
- return;
- }
- }
- },
-
+ // NOTE the `ws` params in the following two are not used (necessarily be + // NOTE the `ws` params in the following two are not used (necessarily be
+ // here as the event handler Interface dictates). + // here as the event handler Interface dictates).
_onWindowAdded: function(ws, win) { + _onWindowAdded: function(ws, win) {
if (win.skip_taskbar) + if (win.skip_taskbar)
return; + return;
@@ -1084,30 +1020,32 @@ const WindowList = new Lang.Class({ +
if (this._grouped) + if (!this._grouped)
return; + this._checkGrouping();
+
- let children = this._windowList.get_children(); + if (this._grouped)
+ return;
+
+ let children = this.actor.get_children(); + let children = this.actor.get_children();
for (let i = 0; i < children.length; i++) { + for (let i = 0; i < children.length; i++) {
if (children[i]._delegate.metaWindow == win) + if (children[i]._delegate.metaWindow == win)
return; + return;
} + }
+
let button = new WindowButton(win, this._perMonitor, this._monitor.index); + let button = new WindowButton(win, this._perMonitor, this._monitor.index);
- this._windowList.layout_manager.pack(button.actor,
- true, true, true,
- Clutter.BoxAlignment.START,
- Clutter.BoxAlignment.START);
+ this.actor.layout_manager.pack(button.actor, + this.actor.layout_manager.pack(button.actor,
+ true, true, true, + true, true, true,
+ Clutter.BoxAlignment.START, + Clutter.BoxAlignment.START,
+ Clutter.BoxAlignment.START); + Clutter.BoxAlignment.START);
}, + },
+
_onWindowRemoved: function(ws, win) { + _onWindowRemoved: function(ws, win) {
if (this._grouped) + if (this._grouped)
this._checkGrouping(); + this._checkGrouping();
+
+ // NOTE: if it's still grouped after `checking`, do nothing, window + // NOTE: if it's still grouped after `checking`, do nothing, window
+ // removal is managed by `AppButton` anyway. + // removal is managed by `AppButton` anyway.
if (this._grouped) + if (this._grouped)
return; + return;
+
if (win.get_compositor_private()) + if (win.get_compositor_private())
return; // not actually removed, just moved to another workspace + return; // not actually removed, just moved to another workspace
+
- let children = this._windowList.get_children();
+ let children = this.actor.get_children(); + let children = this.actor.get_children();
for (let i = 0; i < children.length; i++) { + for (let i = 0; i < children.length; i++) {
if (children[i]._delegate.metaWindow == win) { + if (children[i]._delegate.metaWindow == win) {
children[i].destroy(); + children[i].destroy();
@@ -1116,6 +1054,28 @@ const WindowList = new Lang.Class({ + return;
} + }
}, + }
+ },
+
+ _getPreferredUngroupedWindowListWidth: function() { + _getPreferredUngroupedWindowListWidth: function() {
+ if (this.actor.get_n_children() == 0) + if (this.actor.get_n_children() == 0)
+ return this.actor.get_preferred_width(-1)[1]; + return this.actor.get_preferred_width(-1)[1];
@ -641,22 +447,35 @@ index f01b872..6bd8709 100644
+ return nWindows * childWidth + (nWindows - 1) * spacing; + return nWindows * childWidth + (nWindows - 1) * spacing;
+ }, + },
+ +
_onWorkspacesChanged: function() { + _onWorkspacesChanged: function() {
let numWorkspaces = global.screen.n_workspaces; + let numWorkspaces = global.screen.n_workspaces;
for (let i = 0; i < numWorkspaces; i++) { + for (let i = 0; i < numWorkspaces; i++) {
@@ -1132,8 +1092,6 @@ const WindowList = new Lang.Class({ + let workspace = global.screen.get_workspace_by_index(i);
Lang.bind(this, this._onWindowRemoved)); + if (this._workspaceSignals.has(workspace))
this._workspaceSignals.set(workspace, signals); + continue;
} +
- + let signals = { windowAddedId: 0, windowRemovedId: 0 };
- this._updateWorkspaceIndicatorVisibility(); + signals._windowAddedId =
}, + workspace.connect_after('window-added',
+ Lang.bind(this, this._onWindowAdded));
_disconnectWorkspaceSignals: function() { + signals._windowRemovedId =
@@ -1147,6 +1105,157 @@ const WindowList = new Lang.Class({ + workspace.connect('window-removed',
} + Lang.bind(this, this._onWindowRemoved));
}, + this._workspaceSignals.set(workspace, signals);
+ }
+ },
+
+ _disconnectWorkspaceSignals: function() {
+ let numWorkspaces = global.screen.n_workspaces;
+ for (let i = 0; i < numWorkspaces; i++) {
+ let workspace = global.screen.get_workspace_by_index(i);
+ let signals = this._workspaceSignals.get(workspace);
+ this._workspaceSignals.delete(workspace);
+ workspace.disconnect(signals._windowAddedId);
+ workspace.disconnect(signals._windowRemovedId);
+ }
+ },
+
+ _onDestroy: function() { + _onDestroy: function() {
+ Main.overview.disconnect(this._overviewHidingId); + Main.overview.disconnect(this._overviewHidingId);
+ this._overviewHidingId = 0; + this._overviewHidingId = 0;
@ -681,191 +500,7 @@ index f01b872..6bd8709 100644
+ } + }
+}); +});
+ +
+// NOTE: the following so-called `WindowList` is actually a bottom panel. The +var SCExtension = new Lang.Class({
+// "list of windows" part is going to be factored out into `PureWinList`,
+// specially designed to adapt this extension for use with `SLE-Classic` mode.
+const WindowList = new Lang.Class({
+ Name: 'WindowList',
+
+ _init: function(perMonitor, monitor) {
+ this._perMonitor = perMonitor;
+ this._monitor = monitor;
+
+ this.actor = new St.Widget({ name: 'panel',
+ style_class: 'bottom-panel',
+ reactive: true,
+ track_hover: true,
+ layout_manager: new Clutter.BinLayout()});
+ this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
+
+ let box = new St.BoxLayout({ x_expand: true, y_expand: true });
+ this.actor.add_actor(box);
+
+ let maxWinListWidthFunc = () => {
+ let indicatorsBox = this._workspaceIndicator.actor.get_parent();
+ return this.actor.width - indicatorsBox.get_preferred_width(-1)[1];
+ };
+ this._windowList = new PureWinList(perMonitor, monitor, maxWinListWidthFunc);
+ box.add(this._windowList.actor, { expand: true });
+ let _windowListInitId = this.actor.connect('allocation-changed',
+ () => {
+ this._windowList.initializeWindowList();
+ this.actor.disconnect(_windowListInitId);
+ });
+
+ let indicatorsBox = new St.BoxLayout({ x_align: Clutter.ActorAlign.END });
+ box.add(indicatorsBox);
+ this._workspaceIndicator = new WorkspaceIndicator();
+ indicatorsBox.add(this._workspaceIndicator.container, { expand: false, y_fill: true });
+
+ this._workspaceSettings = this._getWorkspaceSettings();
+ this._workspacesOnlyOnPrimaryChangedId =
+ this._workspaceSettings.connect('changed::workspaces-only-on-primary',
+ Lang.bind(this, this._updateWorkspaceIndicatorVisibility));
+ this._updateWorkspaceIndicatorVisibility();
+
+ this._menuManager = new PopupMenu.PopupMenuManager(this);
+ this._menuManager.addMenu(this._workspaceIndicator.menu);
+
+ Main.layoutManager.addChrome(this.actor, { affectsStruts: true,
+ trackFullscreen: true });
+ Main.uiGroup.set_child_above_sibling(this.actor, Main.layoutManager.panelBox);
+ Main.ctrlAltTabManager.addGroup(this.actor, _("Window List"), 'start-here-symbolic');
+
+ this.actor.width = this._monitor.width;
+ this.actor.connect('notify::height', Lang.bind(this, this._updatePosition));
+ this._updatePosition();
+
+ this._keyboardVisiblechangedId =
+ Main.layoutManager.connect('keyboard-visible-changed',
+ Lang.bind(this, function(o, state) {
+ Main.layoutManager.keyboardBox.visible = state;
+ let keyboardBox = Main.layoutManager.keyboardBox;
+ keyboardBox.visible = state;
+ if (state)
+ Main.uiGroup.set_child_above_sibling(this.actor, keyboardBox);
+ else
+ Main.uiGroup.set_child_above_sibling(this.actor,
+ Main.layoutManager.panelBox);
+ this._updateKeyboardAnchor();
+ }));
+
+ this._overviewShowingId =
+ Main.overview.connect('showing', Lang.bind(this, function() {
+ this.actor.hide();
+ this._updateKeyboardAnchor();
+ }));
+
+ this._overviewHidingId =
+ Main.overview.connect('hiding', Lang.bind(this, function() {
+ this.actor.visible = !Main.layoutManager.primaryMonitor.inFullscreen;
+ this._updateKeyboardAnchor();
+ }));
+
+ this._fullscreenChangedId =
+ global.screen.connect('in-fullscreen-changed', Lang.bind(this, function() {
+ this._updateKeyboardAnchor();
+ }));
+
+ this._dragBeginId =
+ Main.xdndHandler.connect('drag-begin',
+ Lang.bind(this, this._onDragBegin));
+ this._dragEndId =
+ Main.xdndHandler.connect('drag-end',
+ Lang.bind(this, this._onDragEnd));
+ this._dragMonitor = {
+ dragMotion: Lang.bind(this, this._onDragMotion)
+ };
+
+ this._dndTimeoutId = 0;
+ this._dndWindow = null;
+ },
+
+ _getWorkspaceSettings: function() {
+ let settings = global.get_overrides_settings();
+ if (settings.list_keys().indexOf('workspaces-only-on-primary') > -1)
+ return settings;
+ return new Gio.Settings({ schema_id: 'org.gnome.mutter' });
+ },
+
+ _updatePosition: function() {
+ this.actor.set_position(this._monitor.x,
+ this._monitor.y + this._monitor.height - this.actor.height);
+ },
+
+ _updateWorkspaceIndicatorVisibility: function() {
+ this._workspaceIndicator.actor.visible =
+ this._monitor == Main.layoutManager.primaryMonitor ||
+ !this._workspaceSettings.get_boolean('workspaces-only-on-primary');
+ },
+
+
+ _updateKeyboardAnchor: function() {
+ if (!Main.keyboard.actor)
+ return;
+
+ let anchorY = Main.overview.visible ? 0 : this.actor.height;
+ Main.keyboard.actor.anchor_y = anchorY;
+ },
+
_onDragBegin: function() {
DND.addDragMonitor(this._dragMonitor);
},
@@ -1202,28 +1311,16 @@ const WindowList = new Lang.Class({
_onDestroy: function() {
this._workspaceSettings.disconnect(this._workspacesOnlyOnPrimaryChangedId);
- this._dynamicWorkspacesSettings.disconnect(this._dynamicWorkspacesChangedId);
this._workspaceIndicator.destroy();
Main.ctrlAltTabManager.removeGroup(this.actor);
- this._appSystem.disconnect(this._appStateChangedId);
- this._appStateChangedId = 0;
-
Main.layoutManager.disconnect(this._keyboardVisiblechangedId);
this._keyboardVisiblechangedId = 0;
Main.layoutManager.hideKeyboard();
- this._disconnectWorkspaceSignals();
- global.screen.disconnect(this._nWorkspacesChangedId);
- this._nWorkspacesChangedId = 0;
-
- global.window_manager.disconnect(this._switchWorkspaceId);
- this._switchWorkspaceId = 0;
-
-
Main.overview.disconnect(this._overviewShowingId);
Main.overview.disconnect(this._overviewHidingId);
@@ -1231,12 +1328,6 @@ const WindowList = new Lang.Class({
Main.xdndHandler.disconnect(this._dragBeginId);
Main.xdndHandler.disconnect(this._dragEndId);
-
- this._settings.disconnect(this._groupingModeChangedId);
-
- let windows = global.get_window_actors();
- for (let i = 0; i < windows.length; i++)
- windows[i].metaWindow.set_icon_geometry(null);
}
});
@@ -1245,7 +1336,6 @@ const Extension = new Lang.Class({
_init: function() {
this._windowLists = null;
- this._injections = {};
},
enable: function() {
@@ -1301,6 +1391,73 @@ const Extension = new Lang.Class({
}
});
+const SCExtension = new Lang.Class({
+ Name: 'SCExtension', + Name: 'SCExtension',
+ _init: function() { + _init: function() {
+ this._pureWinList = null; + this._pureWinList = null;
@ -902,19 +537,12 @@ index f01b872..6bd8709 100644
+ // NOTE: IMO, no need to rebuild `_pureWinList` when monitors changed. + // NOTE: IMO, no need to rebuild `_pureWinList` when monitors changed.
+ // No need for `showOnAllMonitors` change either even this option + // No need for `showOnAllMonitors` change either even this option
+ // changes. + // changes.
+
+ this._heightChangeId =
+ Main.panel.actor.connect('notify::height', Lang.bind(this, function() {
+ Main.layoutManager.panelBox.set_position(this._pureWinList._monitor.x,
+ this._pureWinList._monitor.y + this._pureWinList._monitor.height - Main.panel.actor.height);
+ }));
+ }, + },
+ +
+ disable: function() { + disable: function() {
+ if (!this._pureWinList) + if (!this._pureWinList)
+ return; + return;
+ +
+ Main.panel.actor.disconnect(this._heightChangeId);
+ this._pureWinList.actor.hide(); + this._pureWinList.actor.hide();
+ this._pureWinList.actor.destroy(); + this._pureWinList.actor.destroy();
+ +
@ -926,20 +554,25 @@ index f01b872..6bd8709 100644
+ return false; + return false;
+ } + }
+}); +});
+
function _minimizeOrActivateWindow(window) {
let focusWindow = global.display.focus_window;
@@ -1302,5 +1697,10 @@ const Extension = new Lang.Class({
});
function init() { function init() {
- return new Extension(); - return new Extension();
+ if ( SLEClassicExt.isSLEClassicMode() ){ + if ( isSLEClassicMode() ){
+ return new SCExtension(); + return new SCExtension();
+ } + }
+ else { + else {
+ return new Extension(); + return new Extension();
+ } + }
} }
diff --git a/extensions/window-list/stylesheet.css b/extensions/window-list/stylesheet.css Index: gnome-shell-extensions-3.26.1/extensions/window-list/stylesheet.css
index f5285cb..c207078 100644 ===================================================================
--- a/extensions/window-list/stylesheet.css --- gnome-shell-extensions-3.26.1.orig/extensions/window-list/stylesheet.css
+++ b/extensions/window-list/stylesheet.css +++ gnome-shell-extensions-3.26.1/extensions/window-list/stylesheet.css
@@ -79,6 +79,10 @@ @@ -79,6 +79,10 @@
border: 1px solid #cccccc; border: 1px solid #cccccc;
} }

View File

@ -1,18 +1,20 @@
Index: gnome-shell-extensions-3.26.0/extensions/apps-menu/extension.js Index: gnome-shell-extensions-3.26.1/extensions/apps-menu/extension.js
=================================================================== ===================================================================
--- gnome-shell-extensions-3.26.0.orig/extensions/apps-menu/extension.js --- gnome-shell-extensions-3.26.1.orig/extensions/apps-menu/extension.js
+++ gnome-shell-extensions-3.26.0/extensions/apps-menu/extension.js +++ gnome-shell-extensions-3.26.1/extensions/apps-menu/extension.js
@@ -22,6 +22,8 @@ const Pango = imports.gi.Pango; @@ -33,6 +33,10 @@ const HORIZ_FACTOR = 5;
const Gettext = imports.gettext.domain('gnome-shell-extensions'); const MENU_HEIGHT_OFFSET = 132;
const _ = Gettext.gettext; const NAVIGATION_REGION_OVERSHOOT = 50;
+const SLEClassicExt = imports.ui.SLEClassicExt; +function isSLEClassicMode() {
+ return Main.sessionMode.currentMode == "sle-classic" ? true : false;
+}
+ +
const ExtensionUtils = imports.misc.extensionUtils; const ActivitiesMenuItem = new Lang.Class({
const Me = ExtensionUtils.getCurrentExtension(); Name: 'ActivitiesMenuItem',
const Convenience = Me.imports.convenience; Extends: PopupMenu.PopupBaseMenuItem,
@@ -785,8 +787,6 @@ const ApplicationsButton = new Lang.Clas @@ -790,8 +794,6 @@ const ApplicationsButton = new Lang.Clas
let tree = new GMenu.Tree({ menu_basename: 'applications.menu' }); let tree = new GMenu.Tree({ menu_basename: 'applications.menu' });
tree.load_sync(); tree.load_sync();
let root = tree.get_root_directory(); let root = tree.get_root_directory();
@ -21,13 +23,13 @@ Index: gnome-shell-extensions-3.26.0/extensions/apps-menu/extension.js
let iter = root.iter(); let iter = root.iter();
let nextType; let nextType;
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) { while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
@@ -804,6 +804,10 @@ const ApplicationsButton = new Lang.Clas @@ -809,6 +811,10 @@ const ApplicationsButton = new Lang.Clas
} }
} }
+ let categoryMenuItem = new CategoryMenuItem(this, null); + let categoryMenuItem = new CategoryMenuItem(this, null);
+ this.categoriesBox.insert_child_at_index(categoryMenuItem.actor, + this.categoriesBox.insert_child_at_index(categoryMenuItem.actor,
+ SLEClassicExt.isSLEClassicMode() ? -1 : 0); + isSLEClassicMode() ? -1 : 0);
+ +
//Load applications //Load applications
this._displayButtons(this._listApplications(null)); this._displayButtons(this._listApplications(null));

View File

@ -135,7 +135,7 @@ Comment[vi]=Phiên làm việc này đăng nhập bạn vào SLE Cổ điển
Comment[zh_CN]=SLE Comment[zh_CN]=SLE
Comment[zh_HK]= SLE Classic Comment[zh_HK]= SLE Classic
Comment[zh_TW]= SLE Classic Comment[zh_TW]= SLE Classic
Exec=env GNOME_SHELL_SESSION_MODE=classic SLE_CLASSIC_MODE=1 gnome-session --session gnome-classic Exec=env GNOME_SHELL_SESSION_MODE=sle-classic gnome-session --session gnome-classic
TryExec=gnome-session TryExec=gnome-session
Icon= Icon=
Type=Application Type=Application

View File

@ -135,7 +135,7 @@ Comment[vi]=Phiên làm việc này đăng nhập bạn vào SLE Cổ điển
Comment[zh_CN]=SLE Comment[zh_CN]=SLE
Comment[zh_HK]= SLE Classic Comment[zh_HK]= SLE Classic
Comment[zh_TW]= SLE Classic Comment[zh_TW]= SLE Classic
Exec=env GNOME_SHELL_SESSION_MODE=classic SLE_CLASSIC_MODE=1 gnome-session --session gnome-classic Exec=env GNOME_SHELL_SESSION_MODE=sle-classic gnome-session --session gnome-classic
TryExec=gnome-session TryExec=gnome-session
Icon= Icon=
Type=Application Type=Application

18
sle-classic.json Normal file
View File

@ -0,0 +1,18 @@
{
"parentMode": "user",
"stylesheetName": "gnome-classic.css",
"enabledExtensions": [
"apps-menu@gnome-shell-extensions.gcampax.github.com",
"places-menu@gnome-shell-extensions.gcampax.github.com",
"alternate-tab@gnome-shell-extensions.gcampax.github.com",
"launch-new-instance@gnome-shell-extensions.gcampax.github.com",
"window-list@gnome-shell-extensions.gcampax.github.com",
"workspace-indicator@gnome-shell-extensions.gcampax.github.com",
"sle-classic@suse.com"
],
"panel": {
"left": ["activities"],
"center": [],
"right": ["a11y", "keyboard", "dateMenu", "aggregateMenu"]
}
}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c1165506ed6e9a4d79d3573cbe9f1e617bf12b2f15f744444ffad15f99d13684
size 6969