From 095b311edc9080f1980f460c866526824ebf46a3 Mon Sep 17 00:00:00 2001 From: o9000 Date: Fri, 6 Nov 2015 11:46:15 +0100 Subject: [PATCH] Mouse effects: changed defaults + disabled pixmap caching --- src/config.c | 8 ++++---- src/taskbar/taskbar.c | 14 +++++++++++--- src/taskbar/taskbarname.c | 3 ++- src/tint2conf/properties_rw.c | 4 ++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/config.c b/src/config.c index a45c3db..e99167c 100644 --- a/src/config.c +++ b/src/config.c @@ -217,9 +217,9 @@ void add_entry (char *key, char *value) if (!read_border_color_hover) memcpy(&bg->border_hover, &bg->border, sizeof(Color)); if (!read_bg_color_press) - memcpy(&bg->back_pressed, &bg->back, sizeof(Color)); + memcpy(&bg->back_pressed, &bg->back_hover, sizeof(Color)); if (!read_border_color_press) - memcpy(&bg->border_pressed, &bg->border, sizeof(Color)); + memcpy(&bg->border_pressed, &bg->border_hover, sizeof(Color)); } Background bg; init_background(&bg); @@ -1043,9 +1043,9 @@ int config_read_file (const char *path) if (!read_border_color_hover) memcpy(&bg->border_hover, &bg->border, sizeof(Color)); if (!read_bg_color_press) - memcpy(&bg->back_pressed, &bg->back, sizeof(Color)); + memcpy(&bg->back_pressed, &bg->back_hover, sizeof(Color)); if (!read_border_color_press) - memcpy(&bg->border_pressed, &bg->border, sizeof(Color)); + memcpy(&bg->border_pressed, &bg->border_hover, sizeof(Color)); } return 1; diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index 0d79edc..946d9ed 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -377,7 +377,9 @@ void set_taskbar_state(Taskbar *tskbar, int state) tskbar->area.pix = tskbar->state_pix[state]; if (taskbarname_enabled) { tskbar->bar_name.area.bg = panel1[0].g_taskbar.background_name[state]; - tskbar->bar_name.area.pix = tskbar->bar_name.state_pix[state]; + if (!panel_config.mouse_effects) { + tskbar->bar_name.area.pix = tskbar->bar_name.state_pix[state]; + } } if (panel_mode != MULTI_DESKTOP) { if (state == TASKBAR_NORMAL) @@ -388,8 +390,14 @@ void set_taskbar_state(Taskbar *tskbar, int state) if (tskbar->area.on_screen == 1) { if (tskbar->state_pix[state] == 0) tskbar->area.redraw = 1; - if (taskbarname_enabled && tskbar->bar_name.state_pix[state] == 0) - tskbar->bar_name.area.redraw = 1; + if (taskbarname_enabled) { + if (!panel_config.mouse_effects) { + if (tskbar->bar_name.state_pix[state] == 0) + tskbar->bar_name.area.redraw = 1; + } else { + tskbar->bar_name.area.redraw = 1; + } + } if (panel_mode == MULTI_DESKTOP && panel1[0].g_taskbar.background[TASKBAR_NORMAL] != panel1[0].g_taskbar.background[TASKBAR_ACTIVE]) { GList *l = tskbar->area.children; if (taskbarname_enabled) l = l->next; diff --git a/src/taskbar/taskbarname.c b/src/taskbar/taskbarname.c index 15ab929..933a33d 100644 --- a/src/taskbar/taskbarname.c +++ b/src/taskbar/taskbarname.c @@ -119,7 +119,8 @@ void draw_taskbarname (void *obj, cairo_t *c) Color *config_text = (taskbar->desktop == server.desktop) ? &taskbarname_active_font : &taskbarname_font; int state = (taskbar->desktop == server.desktop) ? TASKBAR_ACTIVE : TASKBAR_NORMAL; - taskbar_name->state_pix[state] = taskbar_name->area.pix; + if (!panel_config.mouse_effects) + taskbar_name->state_pix[state] = taskbar_name->area.pix; // draw content layout = pango_cairo_create_layout (c); diff --git a/src/tint2conf/properties_rw.c b/src/tint2conf/properties_rw.c index 14be3bc..cd27ac7 100644 --- a/src/tint2conf/properties_rw.c +++ b/src/tint2conf/properties_rw.c @@ -767,9 +767,9 @@ void finalize_bg() } if (!read_border_color_press) { GdkColor fillColor; - gtk_color_button_get_color(GTK_COLOR_BUTTON(background_border_color), &fillColor); + gtk_color_button_get_color(GTK_COLOR_BUTTON(background_border_color_over), &fillColor); gtk_color_button_set_color(GTK_COLOR_BUTTON(background_border_color_press), &fillColor); - int fillOpacity = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_border_color)); + int fillOpacity = gtk_color_button_get_alpha(GTK_COLOR_BUTTON(background_border_color_over)); gtk_color_button_set_alpha(GTK_COLOR_BUTTON(background_border_color_press), fillOpacity); background_force_update(); }