summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorQue Quotion2018-09-19 14:09:48 +0900
committerQue Quotion2018-09-19 14:09:48 +0900
commitf73380dee5d9cc8bc4d2920cb95c6343a000b081 (patch)
treedf1584f377f787a44173432f602f4429149c9ff6
parentbc99640a581234f74a6f6c8d7aaa7be098b18fb1 (diff)
downloadaur-f73380dee5d9cc8bc4d2920cb95c6343a000b081.tar.gz
Various improvements:
-Reduce show/hide bouncing on mouse jiggle; looks a little more stable -Simplify dodge code; no need to check window geometry -Remove show/hide delay from dodge, keep for mouseover. -Scrap animate_panel; break update_struts out of update_panel_dimensions -More optimally connect & disconnect triggers; animations more responsive
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD10
-rw-r--r--autohide.patch298
3 files changed, 127 insertions, 183 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 773134be18f..747f58db07b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -52,7 +52,7 @@ pkgbase = wingpanel-standalone-git
sha256sums = 7f972d79b4d72f7b274a96e1a5150cba0e3869ad85215ae01ad2bc19802cdbb9
sha256sums = 20ec1d51a6610bf0105c772e4d1d4ac8f35ea0ee33b066981db57dc19fe3bdc6
sha256sums = b1902c1d44ac546df63cd0224a7d2ef2cb6394ca556512c30c370d387db7bbab
- sha256sums = 259ff69bd7be5b0a3d8fe437f9313b7dda2636286ce8828e0d2ea51081bbf6ea
+ sha256sums = 33ab0e02839c31850437994d4f6a636890f758d78ebd592552b9372200669e96
sha256sums = 53bfa2220d14065ca848c36217abe812685c7d6e0d42251423d0faa2a0ac5394
pkgname = wingpanel-standalone-git
diff --git a/PKGBUILD b/PKGBUILD
index bfe95a26176..ec6d4330dd1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -34,7 +34,7 @@ sha256sums=('SKIP'
'7f972d79b4d72f7b274a96e1a5150cba0e3869ad85215ae01ad2bc19802cdbb9'
'20ec1d51a6610bf0105c772e4d1d4ac8f35ea0ee33b066981db57dc19fe3bdc6'
'b1902c1d44ac546df63cd0224a7d2ef2cb6394ca556512c30c370d387db7bbab'
- '259ff69bd7be5b0a3d8fe437f9313b7dda2636286ce8828e0d2ea51081bbf6ea'
+ '33ab0e02839c31850437994d4f6a636890f758d78ebd592552b9372200669e96'
'53bfa2220d14065ca848c36217abe812685c7d6e0d42251423d0faa2a0ac5394')
pkgver() {
@@ -46,15 +46,15 @@ pkgver() {
prepare() {
cd wingpanel
- #Reverse 105c1d0
- msg2 "Reverse commit 105c1d0"
- patch -Np1 < ../reverse-105c1d0.patch
-
#Autohide
msg2 "Autohide"
patch -Np2 < ../autohide.patch
#patch -Np2 < ../autohide-testing.patch
+ #Reverse 105c1d0
+ msg2 "Reverse commit 105c1d0"
+ patch -Np1 < ../reverse-105c1d0.patch
+
#Standalone patches
msg2 "Remove Gala dependecies"
rm -rf wingpanel-interface
diff --git a/autohide.patch b/autohide.patch
index 489e6e9427e..f49e6cafe3d 100644
--- a/autohide.patch
+++ b/autohide.patch
@@ -26,33 +26,74 @@ index c81abd5..890e277 100644
+ </key>
</schema>
</schemalist>
-diff --git a/wingpanel/src/PanelWindow.vala b/wingpanel-qq/src/PanelWindow.vala
-index c48b5ea..81ec2f2 100644
---- a/wingpanel/src/PanelWindow.vala
-+++ b/wingpanel-qq/src/PanelWindow.vala
-@@ -21,6 +21,9 @@ public class Wingpanel.PanelWindow : Gtk.Window {
- public Services.PopoverManager popover_manager;
+--- a/wingpanel/src/Services/Settings.vala
++++ b/wingpanel-qq/src/Services/Settings.vala
+@@ -23,6 +23,10 @@ namespace Wingpanel.Services {
+
+ public bool use_transparency { get; set; }
- private Widgets.Panel panel;
++ public string autohide { get; set; }
+
-+ uint timeout;
++ public int delay { get; set; }
+
- private int monitor_number;
- private int monitor_width;
- private int monitor_height;
-@@ -30,6 +33,11 @@ public class Wingpanel.PanelWindow : Gtk.Window {
+ public PanelSettings () {
+ base ("io.elementary.desktop.wingpanel");
+ }
+--- src/wingpanel/CMakeLists.txt~ 2018-09-17 00:14:55.430071710 +0900
++++ src/wingpanel/CMakeLists.txt 2018-09-17 00:34:08.600075830 +0900
+@@ -76,6 +76,7 @@
+ gee-0.8
+ gmodule-2.0
+ gtk+-3.0
++ libwnck-3.0
+ )
+
+ set (LIB_PKG
+@@ -84,11 +85,15 @@
+ gee-0.8
+ gmodule-2.0
+ gtk+-3.0>=3.22
++ libwnck-3.0>=3.24
+ )
+ find_package(PkgConfig)
+
+ pkg_check_modules (LIB REQUIRED ${LIB_PKG})
+
++add_definitions (-DWNCK_I_KNOW_THIS_IS_UNSTABLE ${WNCK_CFLAGS})
++link_libraries (${WNCK_LIBRARIES})
++
+ set (GLOBAL_VALAC_OPTIONS
+ --vapidir=${CMAKE_BINARY_DIR}/lib
+ --vapidir=vapi
+diff --git a/.travis.yml b/.travis.yml
+index dddddf1..4efb6c0 100644
+--- src/wingpanel/.travis.yml
++++ src/wingpanel/.travis.yml
+@@ -4,7 +4,7 @@ services:
+ - docker
+
+ env:
+- - DEPENDENCY_PACKAGES="cmake libgala-dev libgee-0.8-dev libgirepository1.0-dev libglib2.0-dev libgranite-dev libgtk-3-dev valac"
++ - DEPENDENCY_PACKAGES="cmake libgala-dev libgee-0.8-dev libgirepository1.0-dev libglib2.0-dev libgranite-dev libgtk-3-dev libwnck-3-dev valac"
+
+ install:
+ - docker pull elementary/docker:juno-unstable
+--- src/wingpanel/src/PanelWindow.vala~ 2018-09-18 22:59:21.301597018 +0900
++++ src/wingpanel/src/PanelWindow.vala 2018-09-18 23:08:18.654947952 +0900
+@@ -30,6 +30,12 @@
private bool expanded = false;
private int panel_displacement;
private uint shrink_timeout = 0;
++ private uint timeout;
+ private bool hiding = false;
-+ private bool strut = true;
++ private bool delay = false;
+ private string autohide = Services.PanelSettings.get_default ().autohide;
+ private int autohide_delay = Services.PanelSettings.get_default ().delay;
+ private Wnck.Screen wnck_screen = Wnck.Screen.get_default ();
public PanelWindow (Gtk.Application application) {
Object (
-@@ -71,17 +79,40 @@ public class Wingpanel.PanelWindow : Gtk.Window {
+@@ -71,16 +77,65 @@
application.add_accelerator ("<Control>Tab", "app.cycle", null);
application.add_accelerator ("<Control><Shift>Tab", "app.cycle-back", null);
@@ -72,19 +113,45 @@ index c48b5ea..81ec2f2 100644
- if (panel_displacement <= panel_height * (-1)) {
- return false;
+ if (hiding) {
-+ if (panel_displacement >= -1 || popover_manager.current_indicator != null) {
++ if (popover_manager.current_indicator != null) {
+ timeout = 0;
-+ if (strut == true) {
-+ update_panel_dimensions ();
-+ }
++ return false;
++ }
++ if (panel_displacement >= -1) {
++ timeout = 0;
++ update_struts ();
++ this.enter_notify_event.connect (show_panel);
++ this.motion_notify_event.connect (show_panel);
++ delay = true;
+ return false;
+ }
+ panel_displacement++;
+ } else {
+ if (panel_displacement <= panel_height * (-1)) {
+ timeout = 0;
-+ if (strut == true) {
-+ update_panel_dimensions ();
++ switch (autohide) {
++ case "Autohide":
++ update_struts ();
++ this.leave_notify_event.connect (hide_panel);
++ break;
++ case "Float":
++ this.leave_notify_event.connect (hide_panel);
++ break;
++ case "Dodge":
++ update_struts ();
++ if (should_hide_active_change (wnck_screen.get_active_window()))
++ this.leave_notify_event.connect (hide_panel);
++
++ break;
++ case "Dodge-Float":
++ if (should_hide_active_change (wnck_screen.get_active_window()))
++ this.leave_notify_event.connect (hide_panel);
++
++ break;
++ default:
++ this.leave_notify_event.disconnect (hide_panel);
++ update_struts ();
++ break;
+ }
+ return false;
+ }
@@ -93,12 +160,10 @@ index c48b5ea..81ec2f2 100644
- panel_displacement--;
-
-- update_panel_dimensions ();
-+ animate_panel ();
+ update_panel_dimensions ();
return true;
- }
-@@ -91,7 +115,176 @@ public class Wingpanel.PanelWindow : Gtk.Window {
+@@ -91,7 +144,126 @@
Services.BackgroundManager.initialize (this.monitor_number, panel_height);
@@ -108,8 +173,7 @@ index c48b5ea..81ec2f2 100644
+
+ private void active_window_changed (Wnck.Window? prev_active_window) {
+ unowned Wnck.Window? active_window = wnck_screen.get_active_window();
-+ if (autohide == "Dodge" || autohide == "Dodge-Float")
-+ update_visibility_active_change (active_window);
++ update_visibility_active_change (active_window);
+
+ if (prev_active_window != null)
+ prev_active_window.state_changed.disconnect (active_window_state_changed);
@@ -119,33 +183,27 @@ index c48b5ea..81ec2f2 100644
+
+ private void active_workspace_changed (Wnck.Workspace? prev_active_workspace) {
+ unowned Wnck.Window? active_window = wnck_screen.get_active_window();
-+ if (autohide == "Dodge" || autohide == "Dodge-Float")
-+ update_visibility_active_change (active_window);
++ update_visibility_active_change (active_window);
+ }
+
+ private void viewports_changed (Wnck.Screen? screen) {
+ unowned Wnck.Window? active_window = wnck_screen.get_active_window();
-+ if (autohide == "Dodge" || autohide == "Dodge-Float")
-+ update_visibility_active_change (active_window);
++ update_visibility_active_change (active_window);
+ }
+
+ private void active_window_state_changed (Wnck.Window? window,
+ Wnck.WindowState changed_mask, Wnck.WindowState new_state) {
-+ if (autohide == "Dodge" || autohide == "Dodge-Float")
-+ update_visibility_active_change (window);
++ update_visibility_active_change (window);
+ }
+
+ private void update_visibility_active_change (Wnck.Window? active_window) {
+ if (should_hide_active_change (active_window)) {
++ delay = false;
+ hide_panel ();
-+ this.enter_notify_event.connect (show_panel);
-+ this.motion_notify_event.connect (show_panel);
-+ this.leave_notify_event.connect (hide_panel);
+ } else {
-+ show_panel ();
-+ this.enter_notify_event.disconnect (show_panel);
-+ this.motion_notify_event.disconnect (show_panel);
+ this.leave_notify_event.disconnect (hide_panel);
++ delay = false;
++ show_panel ();
+ }
+ }
+
@@ -155,44 +213,7 @@ index c48b5ea..81ec2f2 100644
+ return ((active_window != null) && !active_window.is_minimized () && right_type (active_window)
+ && active_window.is_visible_on_workspace (active_workspace)
+ && active_window.is_in_viewport (active_workspace)
-+ && (active_window.get_window_type () == Wnck.WindowType.DIALOG) ?
-+ would_intersect_shown_panel (active_window) :
-+ (in_panel_x_range (active_window) && is_maximized_at_all (active_window)));
-+ }
-+
-+ private bool would_intersect_shown_panel (Wnck.Window? window) {
-+ Gdk.Rectangle shown_panel_rect = Gdk.Rectangle ();
-+ shown_panel_rect.x = monitor_x;
-+ shown_panel_rect.y = monitor_y;
-+ shown_panel_rect.width = monitor_width;
-+ shown_panel_rect.height = panel_height;
-+
-+ int xp, yp, widthp, heightp;
-+ window.get_geometry (out xp, out yp, out widthp, out heightp);
-+
-+ Gdk.Rectangle window_rect = Gdk.Rectangle ();
-+ window_rect.x = xp;
-+ window_rect.width = widthp;
-+ if (strut && is_maximized_at_all (window)) {
-+ window_rect.y = yp - panel_height;
-+ window_rect.height = heightp + panel_height;
-+ } else {
-+ window_rect.y = yp;
-+ window_rect.height = heightp;
-+ }
-+
-+ return window_rect.intersect (shown_panel_rect, null);
-+ }
-+
-+ private bool in_panel_x_range (Wnck.Window? window) {
-+ int xp, yp, widthp, heightp;
-+ window.get_geometry (out xp, out yp, out widthp, out heightp);
-+ if (xp > monitor_x)
-+ return (monitor_x + monitor_width > xp);
-+ else if (xp < monitor_x)
-+ return (xp + widthp > monitor_x);
-+ else
-+ return (xp + widthp > 0 && monitor_x + monitor_width > 0);
++ && is_maximized_at_all (active_window));
+ }
+
+ private bool right_type (Wnck.Window? active_window) {
@@ -212,8 +233,9 @@ index c48b5ea..81ec2f2 100644
+ Source.remove (timeout);
+ }
+ hiding = true;
-+ strut = true;
-+ Thread.usleep (autohide_delay * 1000);
++ if (delay) {
++ Thread.usleep (autohide_delay * 1000);
++ }
+ timeout = Timeout.add (100 / panel_height, animation_step);
+ return true;
+ }
@@ -222,24 +244,16 @@ index c48b5ea..81ec2f2 100644
+ if (timeout > 0) {
+ Source.remove (timeout);
+ }
++ this.enter_notify_event.disconnect (show_panel);
++ this.motion_notify_event.disconnect (show_panel);
+ hiding = false;
-+ switch (autohide) {
-+ case "Autohide":
-+ case "Dodge":
-+ strut = true;
-+ Thread.usleep (autohide_delay * 1000);
-+ timeout = Timeout.add (100 / panel_height, animation_step);
-+ break;
-+ case "Float":
-+ case "Dodge-Float":
-+ strut = false;
++ if (autohide != "Disabled") {
++ if (delay) {
+ Thread.usleep (autohide_delay * 1000);
-+ timeout = Timeout.add (100 / panel_height, animation_step);
-+ break;
-+ default:
-+ strut = true;
-+ timeout = Timeout.add (300 / panel_height, animation_step);
-+ break;
++ }
++ timeout = Timeout.add (100 / panel_height, animation_step);
++ } else {
++ timeout = Timeout.add (300 / panel_height, animation_step);
+ }
+ return true;
+ }
@@ -248,26 +262,27 @@ index c48b5ea..81ec2f2 100644
+ switch (autohide) {
+ case "Autohide":
+ case "Float":
++ delay = true;
+ hide_panel ();
-+ this.enter_notify_event.connect (show_panel);
-+ this.motion_notify_event.connect (show_panel);
-+ this.leave_notify_event.connect (hide_panel);
+ wnck_screen.active_window_changed.disconnect (active_window_changed);
+ wnck_screen.active_workspace_changed.disconnect (active_workspace_changed);
+ wnck_screen.viewports_changed.disconnect (viewports_changed);
+ break;
+ case "Dodge":
+ case "Dodge-Float":
-+ show_panel ();
++ delay = false;
++ if (!should_hide_active_change (wnck_screen.get_active_window())) {
++ show_panel ();
++ this.leave_notify_event.disconnect (hide_panel);
++ } else {
++ hide_panel ();
++ }
+ wnck_screen.active_window_changed.connect (active_window_changed);
+ wnck_screen.active_workspace_changed.connect (active_workspace_changed);
+ wnck_screen.viewports_changed.connect (viewports_changed);
+ break;
+ default:
+ show_panel ();
-+ this.enter_notify_event.disconnect (show_panel);
-+ this.motion_notify_event.disconnect (show_panel);
-+ this.leave_notify_event.disconnect (hide_panel);
+ wnck_screen.active_window_changed.disconnect (active_window_changed);
+ wnck_screen.active_workspace_changed.disconnect (active_workspace_changed);
+ wnck_screen.viewports_changed.disconnect (viewports_changed);
@@ -276,82 +291,11 @@ index c48b5ea..81ec2f2 100644
}
private void update_panel_dimensions () {
-@@ -114,6 +196,24 @@ public class Wingpanel.PanelWindow : Gtk.Window {
- update_struts ();
- }
-
-+ private void animate_panel () {
-+ panel_height = panel.get_allocated_height ();
-+
-+ monitor_number = screen.get_primary_monitor ();
-+ Gdk.Rectangle monitor_dimensions;
-+ this.screen.get_monitor_geometry (monitor_number, out monitor_dimensions);
-+
-+ monitor_width = monitor_dimensions.width;
-+ monitor_height = monitor_dimensions.height;
-+
-+ this.set_size_request (monitor_width, (popover_manager.current_indicator != null ? monitor_height : -1));
-+
-+ monitor_x = monitor_dimensions.x;
-+ monitor_y = monitor_dimensions.y;
-+
-+ this.move (monitor_x, monitor_y - (panel_height + panel_displacement));
-+ }
-+
- private void update_visual () {
- var visual = this.screen.get_rgba_visual ();
-
-diff --git a/wingpanel/src/Services/Settings.vala b/wingpanel-qq/src/Services/Settings.vala
-index 3bcd0a7..eeecbb8 100644
---- a/wingpanel/src/Services/Settings.vala
-+++ b/wingpanel-qq/src/Services/Settings.vala
-@@ -23,6 +23,10 @@ namespace Wingpanel.Services {
-
- public bool use_transparency { get; set; }
-
-+ public string autohide { get; set; }
-+
-+ public int delay { get; set; }
-+
- public PanelSettings () {
- base ("io.elementary.desktop.wingpanel");
- }
---- src/wingpanel/CMakeLists.txt~ 2018-09-17 00:14:55.430071710 +0900
-+++ src/wingpanel/CMakeLists.txt 2018-09-17 00:34:08.600075830 +0900
-@@ -76,6 +76,7 @@
- gee-0.8
- gmodule-2.0
- gtk+-3.0
-+ libwnck-3.0
- )
+@@ -111,7 +315,6 @@
- set (LIB_PKG
-@@ -84,11 +85,15 @@
- gee-0.8
- gmodule-2.0
- gtk+-3.0>=3.22
-+ libwnck-3.0>=3.24
- )
- find_package(PkgConfig)
+ this.move (monitor_x, monitor_y - (panel_height + panel_displacement));
- pkg_check_modules (LIB REQUIRED ${LIB_PKG})
-
-+add_definitions (-DWNCK_I_KNOW_THIS_IS_UNSTABLE ${WNCK_CFLAGS})
-+link_libraries (${WNCK_LIBRARIES})
-+
- set (GLOBAL_VALAC_OPTIONS
- --vapidir=${CMAKE_BINARY_DIR}/lib
- --vapidir=vapi
-diff --git a/.travis.yml b/.travis.yml
-index dddddf1..4efb6c0 100644
---- src/wingpanel/.travis.yml
-+++ src/wingpanel/.travis.yml
-@@ -4,7 +4,7 @@ services:
- - docker
-
- env:
-- - DEPENDENCY_PACKAGES="cmake libgala-dev libgee-0.8-dev libgirepository1.0-dev libglib2.0-dev libgranite-dev libgtk-3-dev valac"
-+ - DEPENDENCY_PACKAGES="cmake libgala-dev libgee-0.8-dev libgirepository1.0-dev libglib2.0-dev libgranite-dev libgtk-3-dev libwnck-3-dev valac"
+- update_struts ();
+ }
- install:
- - docker pull elementary/docker:juno-unstable
+ private void update_visual () {