Xorg: Add option to disable transparency (workaround for broken graphics stacks; issues 432, 435, 439)
git-svn-id: http://tint2.googlecode.com/svn/trunk@675 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
45cc690167
commit
28d726626d
4 changed files with 25 additions and 11 deletions
|
@ -283,6 +283,9 @@ void add_entry (char *key, char *value)
|
||||||
else
|
else
|
||||||
panel_layer = NORMAL_LAYER;
|
panel_layer = NORMAL_LAYER;
|
||||||
}
|
}
|
||||||
|
else if (strcmp (key, "disable_transparency") == 0) {
|
||||||
|
server.disable_transparency = atoi (value);
|
||||||
|
}
|
||||||
|
|
||||||
/* Battery */
|
/* Battery */
|
||||||
else if (strcmp (key, "battery_low_status") == 0) {
|
else if (strcmp (key, "battery_low_status") == 0) {
|
||||||
|
|
|
@ -125,6 +125,7 @@ void cleanup_server()
|
||||||
free(server.monitor);
|
free(server.monitor);
|
||||||
}
|
}
|
||||||
if (server.gc) XFreeGC(server.dsp, server.gc);
|
if (server.gc) XFreeGC(server.dsp, server.gc);
|
||||||
|
server.disable_transparency = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -408,7 +409,7 @@ void server_init_visual()
|
||||||
server.colormap32 = XCreateColormap(server.dsp, server.root_win, visual, AllocNone);
|
server.colormap32 = XCreateColormap(server.dsp, server.root_win, visual, AllocNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visual && server.composite_manager != None && snapshot_path == 0) {
|
if (!server.disable_transparency && visual && server.composite_manager != None && snapshot_path == 0) {
|
||||||
XSetWindowAttributes attrs;
|
XSetWindowAttributes attrs;
|
||||||
attrs.event_mask = StructureNotifyMask;
|
attrs.event_mask = StructureNotifyMask;
|
||||||
XChangeWindowAttributes (server.dsp, server.composite_manager, CWEventMask, &attrs);
|
XChangeWindowAttributes (server.dsp, server.composite_manager, CWEventMask, &attrs);
|
||||||
|
|
|
@ -106,6 +106,7 @@ typedef struct
|
||||||
Window root_win;
|
Window root_win;
|
||||||
Window composite_manager;
|
Window composite_manager;
|
||||||
int real_transparency;
|
int real_transparency;
|
||||||
|
int disable_transparency;
|
||||||
// current desktop
|
// current desktop
|
||||||
int desktop;
|
int desktop;
|
||||||
int screen;
|
int screen;
|
||||||
|
|
29
src/tint.c
29
src/tint.c
|
@ -171,7 +171,7 @@ static gint cmp_ptr(gconstpointer a, gconstpointer b) {
|
||||||
|
|
||||||
#endif // HAVE_SN
|
#endif // HAVE_SN
|
||||||
|
|
||||||
void init_X11()
|
void init_X11_pre_config()
|
||||||
{
|
{
|
||||||
server.dsp = XOpenDisplay (NULL);
|
server.dsp = XOpenDisplay (NULL);
|
||||||
if (!server.dsp) {
|
if (!server.dsp) {
|
||||||
|
@ -182,6 +182,20 @@ void init_X11()
|
||||||
server.screen = DefaultScreen (server.dsp);
|
server.screen = DefaultScreen (server.dsp);
|
||||||
server.root_win = RootWindow(server.dsp, server.screen);
|
server.root_win = RootWindow(server.dsp, server.screen);
|
||||||
server.desktop = server_get_current_desktop ();
|
server.desktop = server_get_current_desktop ();
|
||||||
|
|
||||||
|
setlocale (LC_ALL, "");
|
||||||
|
// config file use '.' as decimal separator
|
||||||
|
setlocale(LC_NUMERIC, "POSIX");
|
||||||
|
|
||||||
|
// get monitor and desktop config
|
||||||
|
get_monitors();
|
||||||
|
get_desktops();
|
||||||
|
|
||||||
|
server.disable_transparency = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void init_X11_post_config()
|
||||||
|
{
|
||||||
server_init_visual();
|
server_init_visual();
|
||||||
XSetErrorHandler ((XErrorHandler) server_catch_error);
|
XSetErrorHandler ((XErrorHandler) server_catch_error);
|
||||||
|
|
||||||
|
@ -205,10 +219,6 @@ void init_X11()
|
||||||
/* Catch events */
|
/* Catch events */
|
||||||
XSelectInput (server.dsp, server.root_win, PropertyChangeMask|StructureNotifyMask);
|
XSelectInput (server.dsp, server.root_win, PropertyChangeMask|StructureNotifyMask);
|
||||||
|
|
||||||
setlocale (LC_ALL, "");
|
|
||||||
// config file use '.' as decimal separator
|
|
||||||
setlocale(LC_NUMERIC, "POSIX");
|
|
||||||
|
|
||||||
// load default icon
|
// load default icon
|
||||||
gchar *path;
|
gchar *path;
|
||||||
const gchar * const *data_dirs;
|
const gchar * const *data_dirs;
|
||||||
|
@ -220,10 +230,6 @@ void init_X11()
|
||||||
default_icon = imlib_load_image(path);
|
default_icon = imlib_load_image(path);
|
||||||
g_free(path);
|
g_free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get monitor and desktop config
|
|
||||||
get_monitors();
|
|
||||||
get_desktops();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1023,7 +1029,8 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
start:
|
start:
|
||||||
init (argc, argv);
|
init (argc, argv);
|
||||||
init_X11();
|
|
||||||
|
init_X11_pre_config();
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
if (config_path)
|
if (config_path)
|
||||||
|
@ -1036,6 +1043,8 @@ start:
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init_X11_post_config();
|
||||||
|
|
||||||
init_panel();
|
init_panel();
|
||||||
if (snapshot_path) {
|
if (snapshot_path) {
|
||||||
get_snapshot(snapshot_path);
|
get_snapshot(snapshot_path);
|
||||||
|
|
Loading…
Reference in a new issue