projects
/
dana
/
dcompmgr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
13de99e
)
make sure that when a window is shown it stops being a zombie
author
Dana Jansens
<danakj@orodu.net>
Thu, 6 Mar 2008 16:08:29 +0000
(11:08 -0500)
committer
Dana Jansens
<danakj@orodu.net>
Thu, 6 Mar 2008 16:08:29 +0000
(11:08 -0500)
fade.c
patch
|
blob
|
history
window.c
patch
|
blob
|
history
diff --git
a/fade.c
b/fade.c
index
9ba6c49
..
3ce8ab3
100644
(file)
--- a/
fade.c
+++ b/
fade.c
@@
-36,7
+36,8
@@
typedef struct {
static void fade_window_show(d_window_t *w);
static void fade_window_hide(d_window_t *w);
static void fade_window_show(d_window_t *w);
static void fade_window_hide(d_window_t *w);
-static void start_fade(d_window_t *w, uint16_t start, uint16_t end);
+static void start_fade(d_window_t *w, uint16_t start_alpha, uint16_t end_alpha,
+ gboolean refalways);
void
fade_init(d_screen_t *sc, int id)
void
fade_init(d_screen_t *sc, int id)
@@
-53,7
+54,7
@@
fade_init(d_screen_t *sc, int id)
d->fades = list_new();
d->fade_step_time = 5000; /* 5 milliseconds */
d->fades = list_new();
d->fade_step_time = 5000; /* 5 milliseconds */
- d->fade_total_time = 1
66000; /* 0.15
seconds */
+ d->fade_total_time = 1
80000; /* 0.18
seconds */
}
void
}
void
@@
-80,12
+81,24
@@
static void
fade_window_show(d_window_t *w)
{
data_t *d;
fade_window_show(d_window_t *w)
{
data_t *d;
-
- if (!window_is_input_only(w))
- start_fade(w, 0x0000, 0xffff);
+ d_list_it_t *it;
d = screen_find_plugin_data(w->sc, plugin_id);
d = screen_find_plugin_data(w->sc, plugin_id);
+
+ /* kill the zombies off cuz a new copy is being shown */
+ for (it = list_top(d->fades); it; it = it->next) {
+ fade_t *fade = it->data;
+ if (fade->w == w) {
+ window_zombie_unref(w);
+ window_unref(w);
+ break;
+ }
+ }
+
d->window_show(w);
d->window_show(w);
+
+ if (!window_is_input_only(w))
+ start_fade(w, 0x2000, 0xffff, TRUE);
}
static void
}
static void
@@
-94,14
+107,15
@@
fade_window_hide(d_window_t *w)
data_t *d;
if (!window_is_input_only(w))
data_t *d;
if (!window_is_input_only(w))
- start_fade(w, 0xffff, 0x000
0
);
+ start_fade(w, 0xffff, 0x000
2, FALSE
);
d = screen_find_plugin_data(w->sc, plugin_id);
d->window_hide(w);
}
static void
d = screen_find_plugin_data(w->sc, plugin_id);
d->window_hide(w);
}
static void
-start_fade(d_window_t *w, uint16_t start_alpha, uint16_t end_alpha)
+start_fade(d_window_t *w, uint16_t start_alpha, uint16_t end_alpha,
+ gboolean refalways)
{
data_t *d;
d_list_it_t *it;
{
data_t *d;
d_list_it_t *it;
@@
-142,9
+156,6
@@
start_fade(d_window_t *w, uint16_t start_alpha, uint16_t end_alpha)
fade->current_alpha = start_alpha;
window_set_opacity(w, fade->current_alpha);
fade->current_alpha = start_alpha;
window_set_opacity(w, fade->current_alpha);
-
- window_ref(w);
- window_zombie_ref(w);
}
else {
/* figure out how far we have to go to finish the fade from where
}
else {
/* figure out how far we have to go to finish the fade from where
@@
-165,6
+176,10
@@
start_fade(d_window_t *w, uint16_t start_alpha, uint16_t end_alpha)
fade->end_time = now;
time_add(&fade->end_time, percent*d->fade_total_time);
}
fade->end_time = now;
time_add(&fade->end_time, percent*d->fade_total_time);
}
+ if (newfade || refalways) {
+ window_zombie_ref(w);
+ window_ref(w);
+ }
}
int
}
int
diff --git
a/window.c
b/window.c
index
cc579a5
..
0662acf
100644
(file)
--- a/
window.c
+++ b/
window.c
@@
-202,6
+202,8
@@
window_show(d_window_t *pubw)
xcb_change_window_attributes(w->sc->dpy->conn, w->id,
XCB_CW_EVENT_MASK, &mask);
xcb_change_window_attributes(w->sc->dpy->conn, w->id,
XCB_CW_EVENT_MASK, &mask);
+ assert(w->zombieref == 0);
+
window_update_pixmap(w);
window_update_region(w);
window_update_user_opacity(pubw);
window_update_pixmap(w);
window_update_region(w);
window_update_user_opacity(pubw);