[california/wip/729029-stutter] Potential fix
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [california/wip/729029-stutter] Potential fix
- Date: Wed, 24 Sep 2014 01:25:29 +0000 (UTC)
commit c276361130ee27e6c2ddad522063c6a435c30e68
Author: Jim Nelson <jim yorba org>
Date: Tue Sep 23 18:25:17 2014 -0700
Potential fix
src/toolkit/toolkit-stack-model.vala | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/toolkit/toolkit-stack-model.vala b/src/toolkit/toolkit-stack-model.vala
index 5eb3afe..aa95dc3 100644
--- a/src/toolkit/toolkit-stack-model.vala
+++ b/src/toolkit/toolkit-stack-model.vala
@@ -34,6 +34,7 @@ public class StackModel<G> : BaseObject {
* Transition type for spatial transitions according to ordering.
*/
public enum OrderedTransitionType {
+ NONE,
CROSSFADE,
SLIDE_LEFT_RIGHT,
SLIDE_UP_DOWN;
@@ -51,6 +52,9 @@ public class StackModel<G> : BaseObject {
return (this == CROSSFADE) ? Gtk.StackTransitionType.CROSSFADE :
Gtk.StackTransitionType.NONE;
switch (this) {
+ case NONE:
+ return Gtk.StackTransitionType.NONE;
+
case CROSSFADE:
return Gtk.StackTransitionType.CROSSFADE;
@@ -116,7 +120,6 @@ public class StackModel<G> : BaseObject {
private Gee.HashMap<G, Gtk.Widget?> items;
private bool in_balance_cache = false;
private bool stack_destroyed = false;
- private Scheduled? scheduled_balance_cache = null;
public StackModel(Gtk.Stack stack,
OrderedTransitionType ordered_transition_type,
@@ -138,12 +141,14 @@ public class StackModel<G> : BaseObject {
stack.remove.connect(on_stack_removed);
stack.notify["visible-child"].connect(on_stack_child_visible);
+ stack.notify["transition-running"].connect(on_stack_transition_running);
stack.destroy.connect(on_stack_destroyed);
}
~StackModel() {
stack.remove.disconnect(on_stack_removed);
stack.notify["visible-child"].disconnect(on_stack_child_visible);
+ stack.notify["transition-running"].disconnect(on_stack_transition_running);
stack.destroy.disconnect(on_stack_destroyed);
}
@@ -253,14 +258,6 @@ public class StackModel<G> : BaseObject {
if (iter.get_value() == stack.visible_child) {
visible_item = iter.get_key();
- // to avoid stutter, only balance the cache when the transition has completed,
- // which (apparently) it has not when this change is made (probably made at start
- // of transition, not the end) ... "transition-running" property would be useful
- // here, but that's not available until GTK 3.12
- scheduled_balance_cache = new Scheduled.once_at_idle(() => {
- balance_cache("on_stack_child_visible");
- }, Priority.LOW);
-
return;
}
}
@@ -269,6 +266,13 @@ public class StackModel<G> : BaseObject {
visible_item = null;
}
+ // to avoid stutter, only balance the cache when the transition has completed,
+ private void on_stack_transition_running() {
+ // don't care if it is running, want to known when it's not
+ if (!stack.transition_running)
+ balance_cache("!on_stack_transition_running");
+ }
+
private void on_stack_destroyed() {
stack_destroyed = true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]