diff options
author | Cem Kocagil | 2018-12-25 12:03:16 +0300 |
---|---|---|
committer | Cem Kocagil | 2018-12-25 12:08:02 +0300 |
commit | 80e541392d5d83f78116815fb90be84b8650d595 (patch) | |
tree | 1e134a281bd3d9f57172dc53c51b3852bf50a773 | |
download | aur-80e541392d5d83f78116815fb90be84b8650d595.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 32 | ||||
-rw-r--r-- | 01_make_struts_smaller.patch | 13 | ||||
-rw-r--r-- | 02_fix_restrict_to_workspace.patch | 159 | ||||
-rw-r--r-- | PKGBUILD | 45 |
4 files changed, 249 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ff0310699544 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = plank-git-patched + pkgdesc = Elegant, simple, clean dock + pkgver = 0.11.4.r24.0a842b4 + pkgrel = 1 + url = https://launchpad.net/plank + arch = x86_64 + license = GPL3 + makedepends = gnome-common + makedepends = git + makedepends = intltool + makedepends = vala + depends = atk + depends = bamf + depends = cairo + depends = gdk-pixbuf2 + depends = glib2 + depends = glibc + depends = gnome-menus + depends = gtk3 + depends = libgee + depends = libwnck3 + depends = libx11 + depends = libxfixes + depends = libxi + depends = pango + provides = plank + conflicts = plank + source = git+https://github.com/ricotz/plank.git + sha256sums = SKIP + +pkgname = plank-git-patched + diff --git a/01_make_struts_smaller.patch b/01_make_struts_smaller.patch new file mode 100644 index 000000000000..377f7f5c4622 --- /dev/null +++ b/01_make_struts_smaller.patch @@ -0,0 +1,13 @@ +diff --git a/lib/PositionManager.vala b/lib/PositionManager.vala +index 3f140e8..7929afe 100644 +--- a/lib/PositionManager.vala ++++ b/lib/PositionManager.vala +@@ -439,7 +439,7 @@ namespace Plank + height -= top_offset; + + // height of the dock window +- var dock_height = height + (screen_is_composited ? UrgentBounceHeight : 0); ++ var dock_height = height; // + (screen_is_composited ? UrgentBounceHeight : 0); + + var width = 0; + switch (Alignment) { diff --git a/02_fix_restrict_to_workspace.patch b/02_fix_restrict_to_workspace.patch new file mode 100644 index 000000000000..9dc336b49f34 --- /dev/null +++ b/02_fix_restrict_to_workspace.patch @@ -0,0 +1,159 @@ +diff --git a/lib/Items/ApplicationDockItem.vala b/lib/Items/ApplicationDockItem.vala +index a58dbed..2e871ad 100644 +--- a/lib/Items/ApplicationDockItem.vala ++++ b/lib/Items/ApplicationDockItem.vala +@@ -177,6 +177,39 @@ namespace Plank + + update_indicator (); + } ++ ++ GLib.List<unowned Bamf.View> get_windows () ++ { ++ GLib.List<unowned Bamf.View>? all_windows = App.get_windows(); ++ var res = new GLib.List<unowned Bamf.View>(); ++ unowned Wnck.Workspace? active_workspace = Wnck.Screen.get_default ().get_active_workspace (); ++ foreach (var view in all_windows) { ++ unowned Bamf.Window? window = (view as Bamf.Window); ++ if (window == null) ++ continue; ++ unowned Wnck.Window wnckwin = Wnck.Window.@get(window.get_xid()); ++ if (!wnckwin.is_on_workspace(active_workspace)) ++ continue; ++ res.append(view); ++ } ++ return res; ++ } ++ ++ Array<uint32> get_window_xids () ++ { ++ GLib.List<unowned Bamf.View>? all_windows = App.get_windows(); ++ var res = new Array<uint32>(); ++ unowned Wnck.Workspace? active_workspace = Wnck.Screen.get_default ().get_active_workspace (); ++ foreach (var view in all_windows) { ++ unowned Bamf.Window? window = (view as Bamf.Window); ++ if (window == null) ++ continue; ++ var xid = window.get_xid(); ++ if (Wnck.Window.@get(xid).is_on_workspace(active_workspace)) ++ res.append_val(xid); ++ } ++ return res; ++ } + + public bool is_running () + { +@@ -289,7 +322,7 @@ namespace Plank + return; + } + +- var window_count = App.get_windows ().length (); ++ var window_count = get_windows ().length (); + + if (window_count <= 1) { + if (Indicator != IndicatorState.SINGLE) +@@ -321,13 +354,13 @@ namespace Plank + { + if (!is_window ()) + if (button == PopupButton.MIDDLE +- || (button == PopupButton.LEFT && (App == null || App.get_windows ().length () == 0 ++ || (button == PopupButton.LEFT && (App == null || get_windows ().length () == 0 + || (mod & Gdk.ModifierType.CONTROL_MASK) == Gdk.ModifierType.CONTROL_MASK))) { + launch (); + return AnimationType.BOUNCE; + } + +- if (button == PopupButton.LEFT && App != null && App.get_windows ().length () > 0) { ++ if (button == PopupButton.LEFT && App != null && get_windows ().length () > 0) { + WindowControl.smart_focus (App, event_time); + return AnimationType.DARKEN; + } +@@ -340,7 +373,10 @@ namespace Plank + */ + protected override AnimationType on_scrolled (Gdk.ScrollDirection direction, Gdk.ModifierType mod, uint32 event_time) + { +- if (App == null || App.get_windows ().length () == 0) ++ if (App == null) ++ return AnimationType.NONE; ++ Array<uint32> xids = get_window_xids(); ++ if (xids.length == 0) + return AnimationType.NONE; + + if (GLib.get_monotonic_time () - LastScrolled < ITEM_SCROLL_DURATION * 1000) +@@ -349,9 +385,9 @@ namespace Plank + LastScrolled = GLib.get_monotonic_time (); + + if (direction == Gdk.ScrollDirection.UP || direction == Gdk.ScrollDirection.LEFT) +- WindowControl.focus_previous (App, event_time); ++ WindowControl.focus_previous_by_xid (xids, event_time); + else +- WindowControl.focus_next (App, event_time); ++ WindowControl.focus_next_by_xid (xids, event_time); + + return AnimationType.DARKEN; + } +@@ -399,7 +435,7 @@ namespace Plank + + GLib.List<unowned Bamf.View>? windows = null; + if (App != null) +- windows = App.get_windows (); ++ windows = get_windows (); + + var window_count = 0U; + if (windows != null) +@@ -456,12 +492,12 @@ namespace Plank + if (is_running () && window_count > 1) { + if (items.size > 0) + items.add (new Gtk.SeparatorMenuItem ()); +- ++ + foreach (var view in windows) { + unowned Bamf.Window? window = (view as Bamf.Window); + if (window == null || window.get_transient () != null) + continue; +- ++ + Gtk.MenuItem window_item; + var pbuf = WindowControl.get_window_icon (window); + var window_name = window.get_name (); +diff --git a/lib/Services/WindowControl.vala b/lib/Services/WindowControl.vala +index 51e422d..c602bff 100644 +--- a/lib/Services/WindowControl.vala ++++ b/lib/Services/WindowControl.vala +@@ -272,13 +272,7 @@ namespace Plank + if (xids == null) + return; + +- var i = find_active_xid_index (xids); +- i = i < xids.length ? i - 1 : 0; +- +- if (i < 0) +- i = (int) xids.length - 1; +- +- focus_window_by_xid (xids.index (i), event_time); ++ focus_previous_by_xid(xids, event_time); + } + + public static void focus_next (Bamf.Application app, uint32 event_time) +@@ -291,6 +285,22 @@ namespace Plank + if (xids == null) + return; + ++ focus_next_by_xid(xids, event_time); ++ } ++ ++ public static void focus_previous_by_xid (Array<uint32> xids, uint32 event_time) ++ { ++ var i = find_active_xid_index (xids); ++ i = i < xids.length ? i - 1 : 0; ++ ++ if (i < 0) ++ i = (int) xids.length - 1; ++ ++ focus_window_by_xid (xids.index (i), event_time); ++ } ++ ++ public static void focus_next_by_xid (Array<uint32> xids, uint32 event_time) ++ { + var i = find_active_xid_index (xids); + i = i < xids.length ? i + 1 : 0; + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..73b877cec259 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,45 @@ +# Maintainer: ckocagil <contact-me-via-aur> +# Contributor: Maxime Gauduin <alucryd@archlinux.org> +# Contributor: Ner0 <darkelfdarkelf666@yahoo.co.uk> +# Contributor: dcelasun <dcelasun@gmail.com> + +pkgname=plank-git-patched +pkgver=0.11.4.r24.0a842b4 +pkgrel=1 +pkgdesc='Elegant, simple, clean dock' +arch=('x86_64') +url='https://launchpad.net/plank' +license=('GPL3') +depends=('atk' 'bamf' 'cairo' 'gdk-pixbuf2' 'glib2' 'glibc' 'gnome-menus' + 'gtk3' 'libgee' 'libwnck3' 'libx11' 'libxfixes' 'libxi' 'pango') +makedepends=('gnome-common' 'git' 'intltool' 'vala') +provides=('plank') +conflicts=('plank') +source=('git+https://github.com/ricotz/plank.git') +sha256sums=('SKIP') + +pkgver() { + cd plank + + echo "$(git describe --tags | sed 's/^v//; s/-/.r/; s/-g/./')" +} + +build() { + cd plank + patch -p1 < ../../01_make_struts_smaller.patch + patch -p1 < ../../02_fix_restrict_to_workspace.patch + + ./autogen.sh \ + --prefix='/usr' \ + --sysconfdir='/etc' \ + --disable-apport + make +} + +package() { + cd plank + + make DESTDIR="${pkgdir}" install +} + +# vim: ts=2 sw=2 et: |