Dominique Leuenberger 2016-09-01 12:03:54 +00:00 committed by Git OBS Bridge
commit 527b3594b4
6 changed files with 1449 additions and 5 deletions

View File

@ -0,0 +1,137 @@
Index: gnome-shell-extensions-3.20.0/extensions/apps-menu/extension.js
===================================================================
--- gnome-shell-extensions-3.20.0.orig/extensions/apps-menu/extension.js
+++ gnome-shell-extensions-3.20.0/extensions/apps-menu/extension.js
@@ -6,10 +6,13 @@ const Lang = imports.lang;
const Shell = imports.gi.Shell;
const St = imports.gi.St;
const Clutter = imports.gi.Clutter;
+const BoxPointer = imports.ui.boxpointer;
+const AppFavorites = imports.ui.appFavorites;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Gtk = imports.gi.Gtk;
+const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Signals = imports.signals;
const Pango = imports.gi.Pango;
@@ -65,13 +68,118 @@ const ApplicationMenuItem = new Lang.Cla
let textureCache = St.TextureCache.get_default();
let iconThemeChangedId = textureCache.connect('icon-theme-changed',
Lang.bind(this, this._updateIcon));
+
+ this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress));
+ this.actor.connect('popup-menu', Lang.bind(this, this._onKeyboardPopupMenu));
+ this._menu = null;
+ this._menuManager = new PopupMenu.PopupMenuManager(this);
+
this.actor.connect('destroy', Lang.bind(this,
function() {
textureCache.disconnect(iconThemeChangedId);
+ if (this._menu) {
+ this._menu.destroy();
+ this._menu = null;
+ this._menuManager = null;
+ }
}));
this._updateIcon();
},
+ _onKeyboardPopupMenu: function() {
+ this.popupMenu();
+ this._menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
+ },
+
+ _onButtonPress: function(actor, event) {
+ // close any opened menu to avoid input focus grab
+ if (this._menu && this._menu.isOpen) {
+ this._menu.close();
+ return;
+ }
+
+ let button = event.get_button();
+ if (button == 3) {
+ this.popupMenu();
+ return true;
+ }
+ return false;
+ },
+
+ popupMenu: function() {
+ if (!this._menu) {
+ this._menu = new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.TOP, 0);
+ let openItem = new PopupMenu.PopupMenuItem(_("Open"));
+ this._menu.addMenuItem(openItem);
+ openItem.connect('activate', Lang.bind(this, function() {
+ this._app.open_new_window(-1);
+ this._button.selectCategory(null, null);
+ this._button.menu.toggle();
+ }));
+
+ let sepItem = new PopupMenu.PopupSeparatorMenuItem();
+ this._menu.addMenuItem(sepItem);
+
+ let isFavorite = AppFavorites.getAppFavorites().isFavorite(this._app.get_id());
+ let favText = null;
+ if (isFavorite)
+ favText = _("Remove from Favorites");
+ else
+ favText = _("Add to Favorites");
+
+ let favItem = new PopupMenu.PopupMenuItem(favText);
+ this._menu.addMenuItem(favItem);
+ favItem.connect('activate', Lang.bind(this, function() {
+ let favs = AppFavorites.getAppFavorites();
+ let isFavorite = favs.isFavorite(this._app.get_id());
+ if (isFavorite)
+ favs.removeFavorite(this._app.get_id());
+ else
+ favs.addFavorite(this._app.get_id());
+
+ /*As the item text changes, we need to re-generate the menu */
+ this._menu.destroy();
+ this._menu = null;
+
+ this._button.selectCategory(null, null);
+ this._button.menu.toggle();
+ }));
+
+ let desktopItem = new PopupMenu.PopupMenuItem(_("Add to Desktop"));
+ this._menu.addMenuItem(desktopItem);
+ desktopItem.connect('activate', Lang.bind(this, function() {
+ let desktopApp = this._app.get_app_info();
+ let sourcePath = desktopApp.get_filename();
+ let sourceFile = Gio.File.new_for_path(sourcePath);
+ let destDirPath = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DESKTOP);
+ let destDir = Gio.File.new_for_path(destDirPath);
+
+ if (!destDir.query_exists(null)) {
+ destDirPath = Glib.build_filenamev([GLib.get_home_dir(), "Desktop"]);
+ }
+ let destFile = Gio.File.new_for_path(destDirPath + '/' + sourceFile.get_basename());
+ if (sourceFile.copy(destFile, Gio.FileCopyFlags.OVERWRITE,
+ null, null, null)) {
+ destFile.set_attribute_uint32(
+ Gio.FILE_ATTRIBUTE_UNIX_MODE, 0755,
+ Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS,
+ null);
+ }
+ this._button.selectCategory(null, null);
+ this._button.menu.toggle();
+ }));
+
+ Main.uiGroup.add_actor(this._menu.actor);
+
+ this._menuManager.addMenu(this._menu);
+ }
+
+ this._menu.open(BoxPointer.PopupAnimation.NONE);
+ this._menuManager.ignoreRelease();
+
+ return false;
+ },
+
activate: function(event) {
this._app.open_new_window(-1);
this._button.selectCategory(null, null);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon May 23 16:18:24 CST 2016 - cxiong@suse.com
- Update to GNOME 3.20.2 fate#318572
+ gse-sle-classic-ext.patch updated.
-------------------------------------------------------------------
Wed May 11 08:41:10 UTC 2016 - zaitor@opensuse.org
@ -5,6 +11,50 @@ Wed May 11 08:41:10 UTC 2016 - zaitor@opensuse.org
+ Update classic style.
+ Updated translations.
-------------------------------------------------------------------
Mon May 9 15:51:02 CST 2016 - cxiong@suse.com
- SLE Classic (REBASING DONE)
+ DROPPED places-menu-use-nautilus-for-links.patch (Invalid)
+ Add workspace-indicator to the build
+ Fix the gap between bottom menu and its button.
+ Fix windows auto-grouping.
+ Hide window list in Overview
+ Clean up spec file.
-------------------------------------------------------------------
Wed May 4 20:51:08 CST 2016 - cxiong@suse.com
- Rebasing SLE Classic (basic) (Fate#318572)
- Add source sle-classic.desktop: xsession file
- Add patch gse-sle-classic-ext.patch: add sle classic support
- DROPPED: Invalid
+ gnome-classic-exts-arrow-fix.patch
+ gnome-sle-classic-ext-build.patch
+ sle-classic.tar.bz2
-------------------------------------------------------------------
Tue Apr 19 19:07:38 CST 2016 - cxiong@suse.com
- Patches(none-SLE-classic) reviewing for SP2 GNOME 3.20
- REBASED:
+ gnome-shell-add-app-to-desktop.patch
- DROPPED: Upstreamed
+ gnome-shell-use-env-var-for-mode.patch
+ place-menu-handle-special-user-dirs-update.patch
+ 0001-window-list-import-gettext-for-the-right-domain.patch
+ gnome-shell-extensions-bnc872820-wm-button-layout.patch
+ bnc947381-Application-menu-selections-stop-working.patch
- DROPPED: Invalid
+ gnome-classic-move-notification-widget-above.patch
-------------------------------------------------------------------
Fri Apr 15 21:51:23 CEST 2016 - hpj@suse.com
- Update to GNOME 3.20 -- Fate#318572.
- Temporarily disable SLE patches and theming. It will be
re-enabled in a later update.
-------------------------------------------------------------------
Wed Mar 23 08:26:49 UTC 2016 - dimstar@opensuse.org
@ -63,12 +113,28 @@ Sun Jan 10 13:06:20 UTC 2016 - zaitor@opensuse.org
- Update to version 3.18.3:
+ apps-menu: Fix .desktop entries in subdirectories.
-------------------------------------------------------------------
Mon Nov 16 07:45:02 UTC 2015 - cxiong@suse.com
- Add bnc947381-Application-menu-selections-stop-working.patch:
Fix application menu open issue. Upstream has this fixed but no
related bug report (bnc947381).
-------------------------------------------------------------------
Thu Nov 12 16:12:43 UTC 2015 - zaitor@opensuse.org
- Update to version 3.18.2:
+ Fix classic style issues.
-------------------------------------------------------------------
Tue Nov 3 10:02:47 UTC 2015 - cxiong@suse.com
- Fix skewed icons in SLE Classic (bnc#948793)
+ There was a mismatch between the available space and declared
icon size.
+ SPECFILE: a minor fix to avoid double unpacking the first
source tarball.
-------------------------------------------------------------------
Thu Oct 15 20:54:28 UTC 2015 - zaitor@opensuse.org
@ -105,6 +171,16 @@ Thu Aug 20 15:11:03 UTC 2015 - zaitor@opensuse.org
+ window-list: Improve application ordering.
+ workspace-indicator: Use consistent workspace numbering.
-------------------------------------------------------------------
Thu Aug 6 08:48:00 UTC 2015 - cxiong@suse.com
- Fix multiple issues related to windows grouping (bnc#933183) in
SLE Classic
+ The old code contains multiple bugs for windows grouping
display.
+ Fix missing AppButton for applications without desktop file
in SLE Classic.
-------------------------------------------------------------------
Thu Jul 23 15:36:29 UTC 2015 - zaitor@opensuse.org
@ -139,6 +215,15 @@ Thu Jul 2 17:29:16 UTC 2015 - zaitor@opensuse.org
+ classic: Update theme.
+ Updated translations.
-------------------------------------------------------------------
Wed Apr 22 12:37:23 UTC 2015 - cxiong@suse.com
- Fix click event "missing" for window buttons in SLE Classic (bnc#913204)
+ No separate patch file, changes are in sle-classic.tar.bz2
+ "clicked" event in St.Button is not compatible with Clutter's event model.
Though an upstream bug, but the exact cause is still unknown yet. Resort back
to Clutter's native "button-press-event" to fix this for SLE Classic.
-------------------------------------------------------------------
Wed Apr 15 07:20:58 UTC 2015 - dimstar@opensuse.org
@ -230,7 +315,7 @@ Wed Dec 19 17:10:33 UTC 2014 - zaitor@opensuse.org
Wed Dec 19 17:09:33 UTC 2014 - badshah400@gmail.com
- Fix build failure by having the package own the directory
/usr/share/gnome-shell/theme.
/usr/share/gnome-shell/theme.
-------------------------------------------------------------------
Wed Dec 19 17:08:33 UTC 2014 - zaitor@opensuse.org
@ -247,6 +332,14 @@ Fri Dec 19 15:20:42 UTC 2014 - zaitor@opensuse.org
up.
+ window-list: Update for gnome-shell changes.
-------------------------------------------------------------------
Wed Nov 26 10:14:29 UTC 2014 - cxiong@suse.com
- Fix gnome-shell-add-app-to-desktop.patch
+ (bnc#899923). A dangled open menu would grab the focus and
leave the system in a useless state. Close any open menus
before any other action.
-------------------------------------------------------------------
Wed Nov 12 21:03:30 UTC 2014 - zaitor@opensuse.org
@ -262,12 +355,28 @@ Wed Oct 15 06:21:29 UTC 2014 - dimstar@opensuse.org
no flash when closing windows with auto-grouping).
+ Updated translations.
-------------------------------------------------------------------
Thu Sep 25 21:04:27 CDT 2014 - federico@suse.com
- Added gnome-shell-extensions-bnc872820-wm-button-layout.patch for
bnc872820. This lets us have the correct defaults for the window
manager's button layout, for the classic session mode.
-------------------------------------------------------------------
Tue Sep 23 10:29:01 UTC 2014 - dimstar@opensuse.org
- Update to version 3.14.0:
+ Updated translations.
-------------------------------------------------------------------
Thu Sep 18 09:26:30 UTC 2014 - cxiong@suse.com
- Fine-tune window button style, particularly the hovering effect.
+ (bnc#862615) Thanks Marcus Moeller (m.moeller@opensuse.org)
for offering highlighting patch.
+ Highlight buttons when hovering (lighter color and darker text)
+ Add extra box shadow to make buttons more visible.
-------------------------------------------------------------------
Wed Sep 17 10:02:07 UTC 2014 - dimstar@opensuse.org
@ -276,6 +385,18 @@ Wed Sep 17 10:02:07 UTC 2014 - dimstar@opensuse.org
+ window-list: Don't add sticky windows more than once.
+ Updated translations.
-------------------------------------------------------------------
Wed Sep 10 08:03:22 UTC 2014 - cxiong@suse.com
- Add places-menu-use-nautilus-for-links.patch
+ (bnc#891919) Use Nautilus for all links in places menu and
such avoids all unnecessary issues.
-------------------------------------------------------------------
Tue Sep 9 10:56:20 UTC 2014 - cxiong@suse.com
- Force a monitors update to avoid background failure (bnc#893979)
-------------------------------------------------------------------
Mon Sep 8 09:16:24 UTC 2014 - dimstar@opensuse.org
@ -284,12 +405,52 @@ Mon Sep 8 09:16:24 UTC 2014 - dimstar@opensuse.org
+ Updated for gnome-shell changes.
+ Updated translations.
-------------------------------------------------------------------
Thu Sep 4 10:53:13 UTC 2014 - cxiong@suse.com
- Add gnome-classic-move-notification-widget-above.patch
+ (bnc#877898) move notifications above the panel such that it
doesn't cover part of the main panel.
- SLE Classic multiple fixes
+ Add callbacks for overview, fullscreen, monitor change event,
such that the positioning&visibility of on-screen keyboard,
message tray&widgets and panels are adapted accordingly
(bnc#891560).
+ Offer a hack for restoring of xsettings.overrides. The
counterpart is installed in Main._sessionLoaded (bnc#894048).
+ Hide the bottom panel so that the overview hiding animation
works smoothly now. At least before we figure out why it
doesn't work with the bottom panel. (improvement)
+ Adjust the positioning of LookingGlass. (improvement)
+ Other small changes.
-------------------------------------------------------------------
Wed Aug 27 10:03:32 UTC 2014 - fcrozat@suse.com
- Add 0001-window-list-import-gettext-for-the-right-domain.patch:
properly define gettext domain for window-list extension
(bnc#893598).
-------------------------------------------------------------------
Fri Aug 22 07:19:11 UTC 2014 - cxiong@suse.com
- Add place-menu-handle-special-user-dirs-update.patch:
Let place menu handles changes of special user directories
properly (bnc#885490).
-------------------------------------------------------------------
Wed Aug 20 13:27:24 UTC 2014 - dimstar@opensuse.org
- Update to version 3.13.90:
+ Updated translations.
-------------------------------------------------------------------
Tue Aug 12 09:09:33 UTC 2014 - cxiong@suse.com
- Add sle-classic-favorites-menu-at-end.patch:
put the favorites at the end of the app catogories for
accessibility reason (bnc#890989).
-------------------------------------------------------------------
Thu Jul 24 17:58:02 UTC 2014 - dimstar@opensuse.org
@ -297,6 +458,12 @@ Thu Jul 24 17:58:02 UTC 2014 - dimstar@opensuse.org
+ Updated for gnome-shell changes.
+ Updated translations.
-------------------------------------------------------------------
Mon Jul 21 01:55:06 UTC 2014 - dliang@suse.com
- Update gnome-shell-add-app-to-desktop.patch to use system libs.
(bnc#882421)
-------------------------------------------------------------------
Sat Jul 12 21:55:23 UTC 2014 - dimstar@opensuse.org
@ -311,6 +478,31 @@ Sat Jul 12 21:55:23 UTC 2014 - dimstar@opensuse.org
+ window-list: don't shift message tray on other monitors.
+ Updated translations.
-------------------------------------------------------------------
Fri Jul 11 05:30:17 UTC 2014 - cxiong@suse.com
- Remove Avatar symbol from system indicators (bnc#886569)
+ No separate patch file, changes are in sle-classic.tar.bz2
+ It's not considered a good indication for log out
-------------------------------------------------------------------
Wed Jul 2 09:46:01 UTC 2014 - fcrozat@suse.com
- Fix typo in gnome-shell-add-app-to-desktop.patch.
-------------------------------------------------------------------
Wed Jul 2 05:47:52 UTC 2014 - cxiong@suse.com
- Add Logout symbol into system indicators, using 'sle-avatar' in SLE theme.
(bnc#862615)
+ No separate patch file, changes are in sle-classic.tar.bz2
-------------------------------------------------------------------
Tue Jun 17 01:38:15 UTC 2014 - dliang@suse.com
- Update gnome-shell-add-app-to-desktop.patch:
add translate-update-upstream (bnc#882421).
-------------------------------------------------------------------
Sat May 17 10:57:08 UTC 2014 - zaitor@opensuse.org
@ -322,6 +514,41 @@ Sat May 17 10:57:08 UTC 2014 - zaitor@opensuse.org
+ launch-new-instances: updates for api changes.
+ Updated translations.
-------------------------------------------------------------------
Wed Apr 2 11:55:01 UTC 2014 - cxiong@suse.com
- Bring back the official style for workspace indicator
A continued improvement on (bnc#862615)
-------------------------------------------------------------------
Wed Apr 2 03:37:47 UTC 2014 - dliang@suse.com
- Add gnome-shell-add-app-to-desktop.patch:
Add 'open' 'Add to Favoriate' 'Add to Desktop' menu item to the
app-menu (bnc#870580).
-------------------------------------------------------------------
Fri Mar 28 10:29:02 UTC 2014 - cxiong@suse.com
- Implement SLE Classic Mode (bnc#862615)
+ Split changes for SLE Classic out of 'window-list' extension
+ SLE Classic is now implemented as a separate extension +
session mode files.
A fork of 'window-list' extension combined with other SLE
specific tweaks.
+ "SLE Classic" is now a option for choice in Login.
TODO translation for this part is unfinished.
+ GNOME Classic is now in vanilla state and can be selected in
Login.
+ Various changes
Conditional arrow patch, code refactoring.
+ NOTE: this depends on SLE Classic extension patch for GNOME
Shell, see (request#35065).
+ add gnome-classic-exts-arrow-fix.patch
+ add patch gnome-sle-classic-ext-build.patch
+ add sle-classic.tar.bz2
+ add suse-gnome-classic.patch
-------------------------------------------------------------------
Wed Mar 26 19:43:34 UTC 2014 - zaitor@opensuse.org
@ -334,12 +561,41 @@ Fri Mar 21 12:59:48 UTC 2014 - dimstar@opensuse.org
- Update to version 3.11.92:
+ Nothing to see here, move on.
-------------------------------------------------------------------
Wed Mar 19 15:53:38 UTC 2014 - fcrozat@suse.com
- Replace openSUSE by SUSE Linux Enterprise in README.SUSE
- Add a Recommends on gnome-shell-extensions-common-lang in
gnome-shell-classic.
-------------------------------------------------------------------
Thu Mar 6 08:48:45 UTC 2014 - dimstar@opensuse.org
- Update to version 3.11.91:
+ Updated translations.
-------------------------------------------------------------------
Mon Mar 3 08:09:52 UTC 2014 - cxiong@novell.com
- Add gnome-shell-use-env-var-for-mode.patch:
use environment variable instead of command line to specify
mode so that the session saving can work as expected (bnc#863709,
bgo#720894).
-------------------------------------------------------------------
Thu Feb 27 13:49:02 UTC 2014 - cxiong@novell.com
- Various fixes and some minor tweaks. (bnc#865977, bnc#862615)
+ improve indicators consistency in lock screen.
+ see comment 13 of the second bug
-------------------------------------------------------------------
Wed Feb 26 06:44:16 UTC 2014 - cxiong@novell.com
- Various fixes (#862615)
+ This commit only some of all issues listed there.
Plus some enhancements in window list style.
-------------------------------------------------------------------
Thu Feb 20 10:01:46 UTC 2014 - zaitor@opensuse.org
@ -361,6 +617,15 @@ Wed Feb 5 11:46:54 UTC 2014 - dimstar@opensuse.org
+ window-list: update for gnome-shell changes.
+ Updated translations.
-------------------------------------------------------------------
Thu Jan 23 14:37:32 UTC 2014 - cxiong@novell.com
- Feature: Implement SUSE Classic GNOME style
+ This is a preview for review purpose mainly.
+ Only one panel that resides in the bottom.
+ Application menus, workspace&message indicators, window list
switcher are all integrated on this panel.
-------------------------------------------------------------------
Fri Jan 17 19:58:14 UTC 2014 - zaitor@opensuse.org
@ -780,10 +1045,10 @@ Fri Oct 29 09:31:01 UTC 2011 - rbrownccb@opensuse.org
that was bringing the main subpackage, which in term was
bringing all extensions through Recommends.
+ Create a gnome-shell-extensions-common subpackage and use it
as a basis for the translations, by renaming the lang
as a basis for the translations, by renaming the lang
subpackage to gnome-shell-extensions-common-lang.
+ Replace gnome-shell Requires and lang Recommends in all
extensions subpackages with a Requires on
+ Replace gnome-shell Requires and lang Recommends in all
extensions subpackages with a Requires on
gnome-shell-extensions-common which leads to the same result.
-------------------------------------------------------------------

View File

@ -26,13 +26,23 @@ Group: System/GUI/GNOME
Url: http://live.gnome.org/GnomeShell/Extensions
Source: http://download.gnome.org/sources/gnome-shell-extensions/3.20/%{name}-%{version}.tar.xz
Source1: README.SUSE
Source2: sle-classic.desktop
# PATCH-FEATURE-SLE 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
# 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
Patch2: sle-classic-favorites-menu-at-end.patch
## NOTE keep SLE Classic patch at the bottom
# PATCH-FIX-SLE gse-sle-classic-ext.patch Fate#318572 cxiong@suse.com -- add sle classic support
Patch1000: gse-sle-classic-ext.patch
# Needed because we build a tarball generated with "git archive"
BuildRequires: gnome-common
# Needed for directory ownership
BuildRequires: gnome-shell
# gobject-introspection is needed for the typelib() rpm magic.
BuildRequires: gnome-patch-translation
BuildRequires: gobject-introspection
BuildRequires: intltool
BuildRequires: translation-update-upstream
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@ -80,12 +90,26 @@ and also installs the required session files.
%lang_package -n %{name}-common
%prep
%setup -q
%if !0%{?is_opensuse}
translation-update-upstream
gnome-patch-translation-prepare
%patch1 -p1
%patch2 -p1
%patch1000 -p1
%endif
##gnome-patch-translation-update
# In openSUSE GNOME, we don't launch gnome-session directly, but wrap this through a shell script, /usr/bin/gnome
sed -i "s:Exec=gnome-session:Exec=gnome:g" data/gnome-classic.desktop.in
cp %{S:1} .
%if !0%{?is_opensuse}
sed -i -e 's/openSUSE/SUSE Linux Enterprise/g' README.SUSE
%endif
%build
CLASSIC_EXTENSIONS=$(grep -e 'CLASSIC_EXTENSIONS=".*"' configure.ac | sed -e "s:CLASSIC_EXTENSIONS=::" -e 's:"::g')
CLASSIC_EXTENSIONS=$(awk -F\" '/^CLASSIC_EXTENSIONS=/{ print $2 }' configure.ac)
%if !0%{?is_opensuse}
CLASSIC_EXTENSIONS="${CLASSIC_EXTENSIONS} workspace-indicator"
%endif
%configure \
--enable-classic-mode \
--enable-extensions="$CLASSIC_EXTENSIONS"
@ -94,6 +118,9 @@ make %{?_smp_mflags}
%install
%make_install
%find_lang %{name} %{?no_lang_C}
%if !0%{?is_opensuse}
install -m0644 %{S:2} %{buildroot}/%{_datadir}/xsessions/sle-classic.desktop
%endif
%post -n gnome-shell-classic
%glib2_gsettings_schema_post
@ -115,6 +142,9 @@ make %{?_smp_mflags}
%{_datadir}/gnome-shell/extensions/apps-menu@gnome-shell-extensions.gcampax.github.com/
%{_datadir}/gnome-shell/extensions/launch-new-instance@gnome-shell-extensions.gcampax.github.com/
%{_datadir}/gnome-shell/extensions/places-menu@gnome-shell-extensions.gcampax.github.com/
%if !0%{?is_opensuse}
%{_datadir}/gnome-shell/extensions/workspace-indicator@gnome-shell-extensions.gcampax.github.com/
%endif
%{_datadir}/gnome-shell/extensions/window-list@gnome-shell-extensions.gcampax.github.com/
%dir %{_datadir}/gnome-shell/modes
%{_datadir}/gnome-shell/modes/classic.json
@ -128,6 +158,9 @@ make %{?_smp_mflags}
%{_datadir}/gnome-shell/theme/gnome-classic.css
%{_datadir}/gnome-shell/theme/gnome-classic-high-contrast.css
%{_datadir}/xsessions/gnome-classic.desktop
%if !0%{?is_opensuse}
%{_datadir}/xsessions/sle-classic.desktop
%endif
%files common-lang -f %{name}.lang

833
gse-sle-classic-ext.patch Normal file
View File

@ -0,0 +1,833 @@
diff --git a/data/gnome-classic.css b/sp2-rebasing/gnome-shell-extensions-3.20.0/data/gnome-classic.css
index 7e1b253..80333e2 100644
--- a/data/gnome-classic.css
+++ b/data/gnome-classic.css
@@ -441,7 +441,12 @@ StScrollBar {
color: rgba(46, 52, 54, 0.5); }
.popup-menu.panel-menu {
-boxpointer-gap: 4px;
- margin-bottom: 1.75em; }
+ /* TODO was 1.75em, no idea of its use */
+ /* NOTE: the following creates an ugly gap between menu and its source actor
+when the PanelMenu's source actor is at the bottom. Preferrably for bottom menu,
+`margin-top` might be a better choice. However, since we have no idea about its
+use so reset to 0 for now. */
+ margin-bottom: 0em; }
.popup-menu-ornament {
text-align: right;
diff -pur a/extensions/window-list/classic.css b/extensions/window-list/classic.css
--- a/extensions/window-list/classic.css 2016-05-23 16:41:51.603370114 +0800
+++ b/extensions/window-list/classic.css 2016-05-23 16:44:37.024370114 +0800
@@ -6,7 +6,7 @@
height: 2.25em ;
}
- .bottom-panel .window-button > StWidget {
+ .window-button > StWidget {
background-gradient-drection: vertical;
background-color: #fff;
background-gradient-start: #fff;
@@ -22,29 +22,29 @@
text-shadow: 0 0 transparent;
}
- .bottom-panel .window-button:hover > StWidget {
+ .window-button:hover > StWidget {
background-color: #f9f9f9;
}
- .bottom-panel .window-button:active > StWidget,
- .bottom-panel .window-button:focus > StWidget {
+ .window-button:active > StWidget,
+ .window-button:focus > StWidget {
box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
}
- .bottom-panel .window-button.focused > StWidget {
+ .window-button.focused > StWidget {
background-color: #ddd;
box-shadow: inset 1px 1px 1px rgba(0,0,0,0.5);
}
- .bottom-panel .window-button.focused:hover > StWidget {
+ .window-button.focused:hover > StWidget {
background-color: #e9e9e9;
}
- .bottom-panel .window-button.minimized > StWidget {
+ .window-button.minimized > StWidget {
color: #888;
box-shadow: inset -1px -1px 1px rgba(0,0,0,0.5);
}
- .bottom-panel .window-button.minimized > StWidget {
+ .window-button.minimized > StWidget {
box-shadow: inset 1px 1px 1px rgba(0,0,0,0.5);
}
diff --git a/extensions/window-list/extension.js b/sp2-rebasing/gnome-shell-extensions-3.20.0/extensions/window-list/extension.js
index bdd4680..2419547 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -22,6 +22,8 @@ const _ = Gettext.gettext;
const ICON_TEXTURE_SIZE = 24;
const DND_ACTIVATE_TIMEOUT = 500;
+const SLEClassicExt = imports.ui.SLEClassicExt;
+
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(item);
+ // 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));
},
@@ -661,6 +669,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(),
@@ -765,199 +775,143 @@ const WorkspaceIndicator = new Lang.Class({
}
});
-const WindowList = new Lang.Class({
- Name: 'WindowList',
+// NOTE: call `initializeWindowList` explicitly to finish initialization.
+const PureWinList = new Lang.Class({
+ Name: 'PureWinList',
- _init: function(perMonitor, monitor) {
+ _init: function(perMonitor, monitor, maxWidthFunc) {
+ // 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
+ // unify code for two sides.
this._perMonitor = perMonitor;
this._monitor = monitor;
+ // NOTE: callback function given by the employer of this PureWinList.
+ // Since PureWinList can be used various widgets hierarchy, we have to
+ // leave the calculation of max available width to the employer.
+ this._getMaxWindowListWidth = maxWidthFunc;
- this.actor = new St.Widget({ name: 'panel',
- style_class: 'bottom-panel',
+ let layout = new Clutter.BoxLayout({ homogeneous: true });
+ this.actor = new St.Widget({ style_class: 'window-list',
reactive: true,
- track_hover: true,
- layout_manager: new Clutter.BinLayout()});
+ layout_manager: layout,
+ x_align: Clutter.ActorAlign.START,
+ x_expand: true,
+ y_expand: true });
+
+ this.actor.connect('style-changed', Lang.bind(this, function() {
+ let node = this.actor.get_theme_node();
+ let spacing = node.get_length('spacing');
+ this.actor.layout_manager.spacing = spacing;
+ }));
+ this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
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 layout = new Clutter.BoxLayout({ homogeneous: true });
- 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._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._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();
+ // Grouping
+ this._groupingModeChangedId =
+ this._settings.connect('changed::grouping-mode',
+ Lang.bind(this, this._groupingModeChanged));
+ this._grouped = undefined;
+ // NOTE: do NOT `_checkGrouping` here
+
+ // workspace related
this._workspaceSignals = new Map();
this._nWorkspacesChangedId =
global.screen.connect('notify::n-workspaces',
Lang.bind(this, this._onWorkspacesChanged));
this._onWorkspacesChanged();
-
this._switchWorkspaceId =
global.window_manager.connect('switch-workspace',
Lang.bind(this, this._checkGrouping));
+ // Hide and Show with Overview
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.actor.show();
}));
-
- 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;
-
- this._settings = Convenience.getSettings();
- this._groupingModeChangedId =
- this._settings.connect('changed::grouping-mode',
- Lang.bind(this, this._groupingModeChanged));
- this._grouped = undefined;
- this._groupingModeChanged();
},
- _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' });
+ // NOTE: an API for parent panel to refresh the window list. This is
+ // necessary as window/app buttons require its parents having allocation and
+ // positioning *completed* before being properly allocated and positioned
+ initializeWindowList: function() {
+ this._groupingModeChanged();
},
+ // NOTE: support scrolling in window list s.t. scrolling activate window
+ // buttons sequentially.
+ //
+ // *Code is rewritten*.
_onScrollEvent: function(actor, event) {
let direction = event.get_scroll_direction();
let diff = 0;
- if (direction == Clutter.ScrollDirection.DOWN)
+ if (direction === Clutter.ScrollDirection.DOWN)
diff = 1;
- else if (direction == Clutter.ScrollDirection.UP)
+ else if (direction === Clutter.ScrollDirection.UP)
diff = -1;
else
return;
- let children = this._windowList.get_children().map(function(actor) {
+ let buttons = this.actor.get_children().map(function(actor) {
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 activeBtnIdx = 0;
+ for (let i = 0; i < totalBtnNum; i++) {
+ if (buttons[i].active) {
+ activeBtnIdx = i;
break;
}
}
- active = Math.max(0, Math.min(active + diff, children.length-1));
- children[active].activate();
- },
-
- _updatePosition: function() {
- this.actor.set_position(this._monitor.x,
- this._monitor.y + this._monitor.height - this.actor.height);
- },
+ // NOTE: bound by `0` and `totalBtnNum - 1`, no wrapping for
+ // scrolling.
+ activeBtnIdx = activeBtnIdx + diff;
+ let noScrollActionNeeded = ( (activeBtnIdx < 0) || (activeBtnIdx >= totalBtnNum) );
+ if (noScrollActionNeeded)
+ return;
- _updateWorkspaceIndicatorVisibility: function() {
- this._workspaceIndicator.actor.visible =
- this._monitor == Main.layoutManager.primaryMonitor ||
- !this._workspaceSettings.get_boolean('workspaces-only-on-primary');
+ // TODO: no need to call `deactivate` for old `active button` ?
+ buttons[activeBtnIdx].activate();
},
- _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;
+ _onAppStateChanged: function(appSys, app) {
+ if (!this._grouped)
+ return;
- 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];
+ if (app.state == Shell.AppState.RUNNING)
+ this._addApp(app);
+ else if (app.state == Shell.AppState.STOPPED)
+ this._removeApp(app);
+ },
- return nWindows * childWidth + (nWindows - 1) * spacing;
+ _addApp: function(app) {
+ let button = new AppButton(app, this._perMonitor, this._monitor.index);
+ this.actor.layout_manager.pack(button.actor,
+ true, true, true,
+ 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) {
+ let children = this.actor.get_children();
+ for (let i = 0; i < children.length; i++) {
+ if (children[i]._delegate.app === app) {
+ children[i].destroy();
+ return;
+ }
+ }
},
_groupingModeChanged: function() {
@@ -966,7 +920,7 @@ const WindowList = new Lang.Class({
if (this._groupingMode == GroupingMode.AUTO) {
this._checkGrouping();
} else {
- this._grouped = this._groupingMode == GroupingMode.ALWAYS;
+ this._grouped = ( this._groupingMode === GroupingMode.ALWAYS );
this._populateWindowList();
}
},
@@ -975,6 +929,26 @@ const WindowList = new Lang.Class({
if (this._groupingMode != GroupingMode.AUTO)
return;
+ // TODO `_getMaxWindowListWidth` is known to depend on 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
+ // callback.
+ //
+ // this.actor.connect('allocation-changed', () => {
+ // log('parent width: ' + this.actor.get_parent().width);
+ // });
+ //
+ // The legitimacy can be explained in the (guessed) algorithm of
+ // allocation: Bubble up then propagate down (like DOM Events?). In
+ // details: changes that would alter the geometric properties of a
+ // widget would trigger a re-allocation to its parent AFTER some initial
+ // allocation calculation of its own (for queries like
+ // `_get_preferred_width` work for its parents). The `re-allocation`
+ // would bubble up the widget hierarchy till one widget stops it (e.g. a
+ // widget that has fixed size and absolute positioning and thus it does
+ // not need to send re-allocation request up.). Then the re-allocation
+ // signal is sent down to its origin. (downward propagation is necessary
+ // as much of the positioning and allocation depends on one's parent)
let maxWidth = this._getMaxWindowListWidth();
let natWidth = this._getPreferredUngroupedWindowListWidth();
@@ -986,7 +960,7 @@ const WindowList = new Lang.Class({
},
_populateWindowList: function() {
- this._windowList.destroy_all_children();
+ this.actor.destroy_all_children();
if (!this._grouped) {
let windows = global.get_window_actors().sort(
@@ -1007,42 +981,8 @@ const WindowList = new Lang.Class({
}
},
- _updateKeyboardAnchor: function() {
- if (!Main.keyboard.actor)
- return;
-
- let anchorY = Main.overview.visible ? 0 : this.actor.height;
- Main.keyboard.actor.anchor_y = anchorY;
- },
-
- _onAppStateChanged: function(appSys, app) {
- if (!this._grouped)
- 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
+ // here as the event handler Interface dictates).
_onWindowAdded: function(ws, win) {
if (win.skip_taskbar)
return;
@@ -1053,30 +993,32 @@ const WindowList = new Lang.Class({
if (this._grouped)
return;
- let children = this._windowList.get_children();
+ let children = this.actor.get_children();
for (let i = 0; i < children.length; i++) {
if (children[i]._delegate.metaWindow == win)
return;
}
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,
+ true, true, true,
+ Clutter.BoxAlignment.START,
+ Clutter.BoxAlignment.START);
},
_onWindowRemoved: function(ws, win) {
if (this._grouped)
this._checkGrouping();
+ // NOTE: if it's still grouped after `checking`, do nothing, window
+ // removal is managed by `AppButton` anyway.
if (this._grouped)
return;
if (win.get_compositor_private())
return; // not actually removed, just moved to another workspace
- let children = this._windowList.get_children();
+ let children = this.actor.get_children();
for (let i = 0; i < children.length; i++) {
if (children[i]._delegate.metaWindow == win) {
children[i].destroy();
@@ -1085,6 +1027,28 @@ const WindowList = new Lang.Class({
}
},
+ _getPreferredUngroupedWindowListWidth: function() {
+ if (this.actor.get_n_children() == 0)
+ return this.actor.get_preferred_width(-1)[1];
+
+ let children = this.actor.get_children();
+ let [, childWidth] = children[0].get_preferred_width(-1);
+ let spacing = this.actor.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.actor.get_preferred_width(-1)[1];
+
+ return nWindows * childWidth + (nWindows - 1) * spacing;
+ },
+
_onWorkspacesChanged: function() {
let numWorkspaces = global.screen.n_workspaces;
for (let i = 0; i < numWorkspaces; i++) {
@@ -1114,6 +1078,157 @@ const WindowList = new Lang.Class({
}
},
+ _onDestroy: function() {
+ Main.overview.disconnect(this._overviewHidingId);
+ this._overviewHidingId = 0;
+ Main.overview.disconnect(this._overviewShowingId);
+ this._overviewShowingId = 0;
+
+ global.screen.disconnect(this._nWorkspacesChangedId);
+ this._nWorkspacesChangedId = 0;
+ global.window_manager.disconnect(this._switchWorkspaceId);
+ this._switchWorkspaceId = 0;
+ this._disconnectWorkspaceSignals();
+
+ this._settings.disconnect(this._groupingModeChangedId);
+ this._groupingModeChangedId = 0;
+
+ this._appSystem.disconnect(this._appStateChangedId);
+ this._appStateChangedId = 0;
+
+ let windows = global.get_window_actors();
+ for (let i = 0; i < windows.length; i++)
+ windows[i].metaWindow.set_icon_geometry(null);
+ }
+});
+
+// NOTE: the following so-called `WindowList` is actually a bottom panel. The
+// "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);
},
@@ -1174,22 +1289,11 @@ const WindowList = new Lang.Class({
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);
@@ -1197,12 +1301,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);
}
});
@@ -1211,7 +1309,6 @@ const Extension = new Lang.Class({
_init: function() {
this._windowLists = null;
- this._injections = {};
},
enable: function() {
@@ -1267,6 +1364,63 @@ const Extension = new Lang.Class({
}
});
+const SCExtension = new Lang.Class({
+ Name: 'SCExtension',
+ _init: function() {
+ this._pureWinList = null;
+ },
+
+ enable: function() {
+ // NOTE For SLE Classic, a window list is shown on Main panel ONLY
+ let showOnAllMonitors = false;
+ // NOTE Use a guessed value passed to `PureWinList` as `checkGrouping`
+ // is run at a time the allocation of the panel boxes might not complete
+ // yet (and thus we get almost random width value). The other options
+ // are to duplicate the centerbox width calculation or change the order
+ // of grouping check code (way more complicated).
+ //
+ // This value is guessed *conservatively*. Further this value is used by
+ // AUTO grouping only.
+ //
+ // NOTE: no Promise is available
+ let panelCenterBoxWidth = Main.panel.actor.width * 0.8;
+
+ this._pureWinList = new PureWinList(showOnAllMonitors,
+ Main.layoutManager.primaryMonitor,
+ () => panelCenterBoxWidth );
+ Main.panel._centerBox.add(this._pureWinList.actor, {expand: true});
+ let _winListRefreshId = Main.panel._centerBox.connect(
+ 'allocation-changed',
+ () => {
+ this._pureWinList.initializeWindowList();
+ Main.panel._centerBox.disconnect(_winListRefreshId);
+ });
+ // NOTE: IMO, no need to rebuild `_pureWinList` when monitors changed.
+ // No need for `showOnAllMonitors` change either even this option
+ // changes.
+ },
+
+ disable: function() {
+ if (!this._pureWinList)
+ return;
+
+ this._pureWinList.actor.hide();
+ this._pureWinList.actor.destroy();
+
+ this._pureWinList = null;
+ },
+
+ // NOTE: this function is used for multiple window list situations, invalid for SCExtension case, let's return false.
+ someWindowListContains: function(actor) {
+ return false;
+ }
+});
+
function init() {
- return new Extension();
+ if ( SLEClassicExt.isSLEClassicMode() ){
+ return new SCExtension();
+ }
+ else {
+ return new Extension();
+ }
}
diff --git a/extensions/window-list/stylesheet.css b/sp2-rebasing/gnome-shell-extensions-3.20.0/extensions/window-list/stylesheet.css
index f5285cb..c207078 100644
--- a/extensions/window-list/stylesheet.css
+++ b/extensions/window-list/stylesheet.css
@@ -79,6 +79,10 @@
border: 1px solid #cccccc;
}
+.bottom-panel-menu {
+ -boxpointer-gap: 4px;
+}
+
.notification {
font-weight: normal;
}

View File

@ -0,0 +1,34 @@
Index: gnome-shell-extensions-3.20.1/extensions/apps-menu/extension.js
===================================================================
--- gnome-shell-extensions-3.20.1.orig/extensions/apps-menu/extension.js
+++ gnome-shell-extensions-3.20.1/extensions/apps-menu/extension.js
@@ -20,6 +20,8 @@ const Pango = imports.gi.Pango;
const Gettext = imports.gettext.domain('gnome-shell-extensions');
const _ = Gettext.gettext;
+const SLEClassicExt = imports.ui.SLEClassicExt;
+
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
@@ -609,8 +611,6 @@ const ApplicationsButton = new Lang.Clas
let tree = new GMenu.Tree({ menu_basename: 'applications.menu' });
tree.load_sync();
let root = tree.get_root_directory();
- let categoryMenuItem = new CategoryMenuItem(this, null);
- this.categoriesBox.add_actor(categoryMenuItem.actor);
let iter = root.iter();
let nextType;
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
@@ -628,6 +628,10 @@ const ApplicationsButton = new Lang.Clas
}
}
+ let categoryMenuItem = new CategoryMenuItem(this, null);
+ this.categoriesBox.insert_child_at_index(categoryMenuItem.actor,
+ SLEClassicExt.isSLEClassicMode() ? -1 : 0);
+
//Load applications
this._displayButtons(this._listApplications(null));

142
sle-classic.desktop Normal file
View File

@ -0,0 +1,142 @@
[Desktop Entry]
Name=SLE Classic
Name[af]=SLE Klassiek
Name[an]=SLE clasico
Name[ar]=جنوم تقليدية
Name[as]=SLE ি
Name[bg]=Класически SLE
Name[bn_IN]=SLE ি
Name[bs]=Klasični SLE
Name[ca]=SLE clàssic
Name[ca@valencia]=SLE clàssic
Name[cs]=SLE klasik
Name[da]=SLE Classic
Name[de]=SLE Classic
Name[el]=SLE Classic
Name[en_GB]=SLE Classic
Name[eo]=SLE-klasika
Name[es]=SLE clásico
Name[et]=Klassikaline SLE
Name[eu]=SLE Klasikoa
Name[fa]=گنوم کلاسیک
Name[fi]=Perinteinen Gnome
Name[fr]=SLE Classique
Name[fur]=SLE Classic
Name[gd]=SLE clasaigeach
Name[gl]=SLE clasico
Name[gu]=SLE િ
Name[he]=SLE קלסי
Name[hi]=SLE ि
Name[hu]=Klasszikus SLE
Name[id]=SLE Klasik
Name[is]=SLE Klassík
Name[it]=SLE classico
Name[ja]=SLE
Name[kk]=Классикалық SLE
Name[km]=SLE Classic
Name[kn]=SLE ಿ
Name[ko]=
Name[lt]=Klasikinis SLE
Name[lv]=Klasiskais SLE
Name[ml]= ി
Name[mr]=SLE ि
Name[ms]=SLE Klasik
Name[nb]=Klassisk SLE
Name[ne]=ि ि
Name[nl]=Gnome klassiek
Name[oc]=SLE Classic
Name[or]=SLE ି
Name[pa]= ਿ
Name[pl]=Klasyczne SLE
Name[pt]=SLE clássico
Name[pt_BR]=SLE Clássico
Name[ro]=SLE Clasic
Name[ru]=Классический SLE
Name[sk]=Klasické prostredie SLE
Name[sl]=Običajno namizje SLE
Name[sr]=Класичан Гном
Name[sr@latin]=Klasičan Gnom
Name[sv]=SLE Klassisk
Name[ta]=SLE ிி
Name[te]= ి
Name[tg]=SLE-и классикӣ
Name[th]=SLE
Name[tr]=SLE Klasik
Name[uk]=Класичний SLE
Name[vi]=SLE c đin
Name[zh_CN]=SLE
Name[zh_HK]=SLE Classic
Name[zh_TW]=SLE Classic
Comment=This session logs you into SLE Classic
Comment[af]=Hierdie sessie laat mens aanmeld by SLE Klassiek
Comment[an]=Ista sesión encieta lo SLE clasico
Comment[ar]=تولجك هذه الجلسة في جنوم التقليدية
Comment[as]= ি SLE ি
Comment[bg]=Работната среда изглежда като класическия SLE (2.x)
Comment[bn_IN]= SLE ি
Comment[bs]=Ova sesija vas prijavljuje na klasični SLE
Comment[ca]=Aquesta sessió us permet utilitzar el SLE clàssic
Comment[ca@valencia]=Esta sessió vos permet utilitzar el SLE clàssic
Comment[cs]=Toto sezení vás přihlásí do SLE klasik
Comment[da]=Denne session logger dig ind i SLE Classic
Comment[de]=Diese Sitzung meldet Sie in SLE Classic an
Comment[el]=Αυτή η συνεδρία σας συνδέει στο SLE Classic
Comment[en_GB]=This session logs you into SLE Classic
Comment[eo]=Ĉi seanco ensalutas vin SLE-klasiken
Comment[es]=Esta sesión inicia SLE clásico
Comment[et]=See on klassikalise SLE seanss
Comment[eu]=Saio honek SLE Klasikoa hasten du
Comment[fa]=این نشست شما را به گنوم کلاسیک وارد میکند
Comment[fi]=Tämä istunto kirjaa sinut perinteiseen Gnomeen
Comment[fr]=Cette session vous connnecte à SLE Classique
Comment[fur]=Cheste session a si invie cun SLE classic
Comment[gd]=Clàraidh an seisean seo a-steach gu SLE clasaigeach thu
Comment[gl]=Esta sesión iniciarao en SLE clásico
Comment[gu]= SLE િ
Comment[he]=הפעלה זו מכניסה אותך למצב הקלסי של SLE
Comment[hi]= ि
Comment[hu]=Bejelentkezés a klasszikus SLE környezetbe
Comment[id]=Sesi ini memasukkan Anda ke SLE Klasik
Comment[is]=Þessi seta skráir þig inn í klassískt SLE
Comment[it]=Questa sessione si avvia con SLE classico
Comment[ja]=SLE
Comment[kk]=Бұл сессия арқылы классикалық SLE ішіне кіресіз
Comment[km]= SLE Classic
Comment[kn]= ಿ ಿ SLE ಿ ಿ
Comment[ko]=
Comment[lt]=Šis seansas prijungs jus prie klasikinio SLE
Comment[lv]=Šī sesija ieraksta jūs klasiskajā SLE vidē
Comment[ml]= ി ിി
Comment[mr]= SLE ि
Comment[ms]=Sesi ini log masukkan anda ke SLE Klasik
Comment[nb]=Denne økten logger inn i klassisk SLE
Comment[ne]= ि ि
Comment[nl]=Deze sessie meldt u aan bij Gnome klassiek
Comment[oc]=Aquesta session vos connècta a SLE Classic
Comment[or]=ି ି SLE ି
Comment[pa]= ਿ ਿ
Comment[pl]=Ta sesja loguje do klasycznego środowiska SLE
Comment[pt]=Esta sessão liga-o ao SLE clássico
Comment[pt_BR]=Essa sessão se inicia como SLE Clássico
Comment[ro]=Această sesiune vă autentifică în SLE Clasic
Comment[ru]=Данный сеанс использует классический рабочий стол SLE
Comment[sk]=Táto relácia vás prihlási do klasického prostredia SLE
Comment[sl]=Seja omogoča prijavo v običajno namizje SLE.
Comment[sr]=Ова сесија вас пријављује у класичан Гном
Comment[sr@latin]=Ova sesija vas prijavljuje u klasičan Gnom
Comment[sv]=Denna session loggar in dig till SLE Klassisk
Comment[ta]= SLE ிிி ி
Comment[te]= ి ిి ి
Comment[tg]=Ин ҷаласа шуморо ба SLE-и классикӣ ворид мекунад
Comment[th]= SLE
Comment[tr]=Bu oturum, SLE Klasik sürümüne giriş yapmanızı sağlar.
Comment[uk]=Це сеанс входу в класичний SLE
Comment[vi]=Phiên làm vic này đăng nhp bn vào SLE C đin
Comment[zh_CN]=SLE
Comment[zh_HK]= SLE Classic
Comment[zh_TW]= SLE Classic
Exec=env GNOME_SHELL_SESSION_MODE=classic SLE_CLASSIC_MODE=1 gnome-session --session gnome-classic
TryExec=gnome-session
Icon=
Type=Application
DesktopNames=GNOME-Classic;GNOME