Skip to content

Instantly share code, notes, and snippets.

@pcworld
Last active November 10, 2018 11:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcworld/8086599 to your computer and use it in GitHub Desktop.
Save pcworld/8086599 to your computer and use it in GitHub Desktop.
Ubuntu 13.10 Unity patches (minimize on click, remove trash and device icons)
To get the source code of 13.10's Unity:
apt-get source unity
Then compile as outlined here: https://web.archive.org/web/20170818041556/https://unity.ubuntu.com/getinvolved/development/unity/
For the patches that remove icons, empty the following file:
unity-7.1.2+13.10.20131014.1/tests/test_launcher_controller.cpp
(or rewrite the test, or figure out how to properly disable tests)
# Dirty port of http://bazaar.launchpad.net/~ojno/unity/minimize-on-click/revision/2129 (thanks Jonathan French!)
# Though I've only ported the case when there's only one window in a group (as that's my use case).
# The other cases should be trivial to port though.
--- unity-7.1.2+13.10.20131014.1/launcher/ApplicationLauncherIcon.cpp
+++ unity-7.1.2+13.10.20131014.1/launcher/ApplicationLauncherIcon.cpp
@@ -401,7 +401,11 @@
{
if (arg.source != ActionArg::Source::SWITCHER)
{
- Spread(true, 0, false);
+ WindowList windowList = GetWindows(WindowFilter::ON_CURRENT_DESKTOP);
+ if (windowList.size() == 1)
+ WindowManager::Default().Minimize(windowList[0]->window_id());
+ else
+ Spread(true, 0, false);
}
}
}
# Second hunk probably not needed.
--- unity-7.1.2+13.10.20131014.1/launcher/LauncherController.cpp
+++ unity-7.1.2+13.10.20131014.1/launcher/LauncherController.cpp
@@ -726,6 +724,9 @@
if (!icon)
return;
+ if (icon->GetIconType() == AbstractLauncherIcon::IconType::DEVICE)
+ return;
+
std::string const& icon_uri = icon->RemoteUri();
if (model_->IconIndex(icon) >= 0)
@@ -842,7 +843,6 @@
void Controller::Impl::OnDeviceIconAdded(AbstractLauncherIcon::Ptr const& icon)
{
- RegisterIcon(icon, GetLastIconPriority<VolumeLauncherIcon>(local::DEVICES_URI));
}
AbstractLauncherIcon::Ptr Controller::Impl::CreateFavoriteIcon(std::string const& icon_uri, bool emit_signal)
--- unity-7.1.2+13.10.20131014.1/launcher/LauncherController.cpp
+++ unity-7.1.2+13.10.20131014.1/launcher/LauncherController.cpp
@@ -140,8 +140,6 @@
HudLauncherIcon* hud = new HudLauncherIcon(hide_mode);
RegisterIcon(AbstractLauncherIcon::Ptr(hud));
- TrashLauncherIcon* trash = new TrashLauncherIcon();
- RegisterIcon(AbstractLauncherIcon::Ptr(trash));
parent_->options()->hide_mode.changed.connect([bfb, hud](LauncherHideMode mode) {
bfb->SetHideMode(mode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment