projects
/
dana
/
dcompmgr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ad446a8
)
make fading optional
author
Dana Jansens
<danakj@orodu.net>
Sun, 16 Mar 2008 16:58:56 +0000
(12:58 -0400)
committer
Dana Jansens
<danakj@orodu.net>
Sun, 16 Mar 2008 16:58:56 +0000
(12:58 -0400)
dcompmgr.c
patch
|
blob
|
history
fade.c
patch
|
blob
|
history
diff --git
a/dcompmgr.c
b/dcompmgr.c
index
b114cbf
..
bcc7ce1
100644
(file)
--- a/
dcompmgr.c
+++ b/
dcompmgr.c
@@
-29,6
+29,7
@@
typedef enum {
typedef struct {
render_type_t render;
typedef struct {
render_type_t render;
+ gboolean fade;
} d_options_t;
static gboolean quit = FALSE;
} d_options_t;
static gboolean quit = FALSE;
@@
-44,6
+45,8
@@
print_help(void)
"Options:\n"
" --gl Use OpenGL for drawing\n"
" --xrender Use XRender for drawing (the default)\n"
"Options:\n"
" --gl Use OpenGL for drawing\n"
" --xrender Use XRender for drawing (the default)\n"
+" --fade Fade windows in and out of existence (the default)\n"
+" --no-fade Don't fade windows in and out\n"
"\n"
"Copyright (C) 2008 Dana Jansens\n"
"\n"
"\n"
"Copyright (C) 2008 Dana Jansens\n"
"\n"
@@
-57,12
+60,17
@@
read_options(int argc, char **argv, d_options_t *opts)
int i;
opts->render = USE_RENDER;
int i;
opts->render = USE_RENDER;
+ opts->fade = TRUE;
for (i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--gl") == 0)
opts->render = USE_OPENGL;
else if (strcmp(argv[i], "--xrender") == 0)
opts->render = USE_RENDER;
for (i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--gl") == 0)
opts->render = USE_OPENGL;
else if (strcmp(argv[i], "--xrender") == 0)
opts->render = USE_RENDER;
+ else if (strcmp(argv[i], "--fade") == 0)
+ opts->fade = TRUE;
+ else if (strcmp(argv[i], "--no-fade") == 0)
+ opts->fade = FALSE;
else if (strcmp(argv[i], "--help") == 0) {
print_help();
exit(0);
else if (strcmp(argv[i], "--help") == 0) {
print_help();
exit(0);
@@
-459,7
+467,8
@@
setup_functions(d_display_t *dpy, d_options_t *opts)
else
glxrender_init(sc, id++);
else
glxrender_init(sc, id++);
- fade_init(sc, id++);
+ if (opts->fade)
+ fade_init(sc, id++);
}
}
}
}
diff --git
a/fade.c
b/fade.c
index
74308e4
..
e2946e7
100644
(file)
--- a/
fade.c
+++ b/
fade.c
@@
-69,15
+69,17
@@
fade_free(d_screen_t *sc)
d = screen_find_plugin_data(sc, plugin_id);
screen_remove_plugin_data(sc, plugin_id);
d = screen_find_plugin_data(sc, plugin_id);
screen_remove_plugin_data(sc, plugin_id);
- for (it = list_top(d->fades); it; it = it->next) {
- fade_t *fade = it->data;
- window_set_opacity(fade->w, 0xffff);
- window_zombie_unref(fade->w);
- window_unref(fade->w);
- free(fade);
+ if (d) {
+ for (it = list_top(d->fades); it; it = it->next) {
+ fade_t *fade = it->data;
+ window_set_opacity(fade->w, 0xffff);
+ window_zombie_unref(fade->w);
+ window_unref(fade->w);
+ free(fade);
+ }
+ list_unref(d->fades);
+ free(d);
}
}
- list_unref(d->fades);
- free(d);
}
static void
}
static void
@@
-198,7
+200,7
@@
fade_next_timeout(struct d_screen *sc, struct timeval *tv)
d = screen_find_plugin_data(sc, plugin_id);
d = screen_find_plugin_data(sc, plugin_id);
- if (list_length(d->fades) == 0)
+ if (
!d ||
list_length(d->fades) == 0)
return FALSE;
else {
*tv = d->next_timeout;
return FALSE;
else {
*tv = d->next_timeout;