fixed bug in taskbar drawing
git-svn-id: http://tint2.googlecode.com/svn/trunk@245 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
|
#include <pango/pangoxft.h>
|
||||||
#include <Imlib2.h>
|
#include <Imlib2.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
@@ -88,6 +89,11 @@ void init_config()
|
|||||||
// window manager's menu default value == false
|
// window manager's menu default value == false
|
||||||
wm_menu = 0;
|
wm_menu = 0;
|
||||||
max_tick_urgent = 7;
|
max_tick_urgent = 7;
|
||||||
|
|
||||||
|
// flush pango cache if possible
|
||||||
|
//pango_xft_shutdown_display(server.dsp, server.screen);
|
||||||
|
//PangoFontMap *font_map = pango_xft_get_font_map(server.dsp, server.screen);
|
||||||
|
//pango_fc_font_map_shutdown(font_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -222,12 +222,16 @@ void resize_taskbar(void *obj)
|
|||||||
Panel *panel = (Panel*)taskbar->area.panel;
|
Panel *panel = (Panel*)taskbar->area.panel;
|
||||||
Task *tsk;
|
Task *tsk;
|
||||||
GSList *l;
|
GSList *l;
|
||||||
int task_count;
|
int task_count, border_width;
|
||||||
|
|
||||||
//printf("resize_taskbar : posx et width des taches\n");
|
//printf("resize_taskbar : posx et width des taches\n");
|
||||||
|
|
||||||
taskbar->area.redraw = 1;
|
taskbar->area.redraw = 1;
|
||||||
|
|
||||||
|
if (taskbar->area.is_active && taskbar->area.use_active)
|
||||||
|
border_width = taskbar->area.pix_active.border.width;
|
||||||
|
else
|
||||||
|
border_width = taskbar->area.pix.border.width;
|
||||||
|
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
int pixel_width, modulo_width=0;
|
int pixel_width, modulo_width=0;
|
||||||
int x, taskbar_width;
|
int x, taskbar_width;
|
||||||
@@ -236,7 +240,7 @@ void resize_taskbar(void *obj)
|
|||||||
task_count = g_slist_length(taskbar->area.list);
|
task_count = g_slist_length(taskbar->area.list);
|
||||||
if (!task_count) pixel_width = panel->g_task.maximum_width;
|
if (!task_count) pixel_width = panel->g_task.maximum_width;
|
||||||
else {
|
else {
|
||||||
taskbar_width = taskbar->area.width - (2 * panel->g_taskbar.pix.border.width) - (2 * panel->g_taskbar.paddingxlr);
|
taskbar_width = taskbar->area.width - (2 * border_width) - (2 * panel->g_taskbar.paddingxlr);
|
||||||
if (task_count>1) taskbar_width -= ((task_count-1) * panel->g_taskbar.paddingx);
|
if (task_count>1) taskbar_width -= ((task_count-1) * panel->g_taskbar.paddingx);
|
||||||
|
|
||||||
pixel_width = taskbar_width / task_count;
|
pixel_width = taskbar_width / task_count;
|
||||||
@@ -246,16 +250,12 @@ void resize_taskbar(void *obj)
|
|||||||
modulo_width = taskbar_width % task_count;
|
modulo_width = taskbar_width % task_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((taskbar->task_width == pixel_width) && (taskbar->task_modulo == modulo_width)) {
|
taskbar->task_width = pixel_width;
|
||||||
}
|
taskbar->task_modulo = modulo_width;
|
||||||
else {
|
taskbar->text_width = pixel_width - panel->g_task.text_posx - panel->g_task.area.pix.border.width - panel->g_task.area.paddingx;
|
||||||
taskbar->task_width = pixel_width;
|
|
||||||
taskbar->task_modulo = modulo_width;
|
|
||||||
taskbar->text_width = pixel_width - panel->g_task.text_posx - panel->g_task.area.pix.border.width - panel->g_task.area.paddingx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// change pos_x and width for all tasks
|
// change pos_x and width for all tasks
|
||||||
x = taskbar->area.posx + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
|
x = taskbar->area.posx + border_width + taskbar->area.paddingxlr;
|
||||||
for (l = taskbar->area.list; l ; l = l->next) {
|
for (l = taskbar->area.list; l ; l = l->next) {
|
||||||
tsk = l->data;
|
tsk = l->data;
|
||||||
if (!tsk->area.on_screen) continue;
|
if (!tsk->area.on_screen) continue;
|
||||||
@@ -277,7 +277,7 @@ void resize_taskbar(void *obj)
|
|||||||
task_count = g_slist_length(taskbar->area.list);
|
task_count = g_slist_length(taskbar->area.list);
|
||||||
if (!task_count) pixel_height = panel->g_task.maximum_height;
|
if (!task_count) pixel_height = panel->g_task.maximum_height;
|
||||||
else {
|
else {
|
||||||
taskbar_height = taskbar->area.height - (2 * panel->g_taskbar.pix.border.width) - (2 * panel->g_taskbar.paddingxlr);
|
taskbar_height = taskbar->area.height - (2 * border_width) - (2 * panel->g_taskbar.paddingxlr);
|
||||||
if (task_count>1) taskbar_height -= ((task_count-1) * panel->g_taskbar.paddingx);
|
if (task_count>1) taskbar_height -= ((task_count-1) * panel->g_taskbar.paddingx);
|
||||||
|
|
||||||
pixel_height = taskbar_height / task_count;
|
pixel_height = taskbar_height / task_count;
|
||||||
@@ -287,16 +287,12 @@ void resize_taskbar(void *obj)
|
|||||||
modulo_height = taskbar_height % task_count;
|
modulo_height = taskbar_height % task_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((taskbar->task_width == pixel_height) && (taskbar->task_modulo == modulo_height)) {
|
taskbar->task_width = pixel_height;
|
||||||
}
|
taskbar->task_modulo = modulo_height;
|
||||||
else {
|
taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.paddingy) - panel->g_task.text_posx - panel->g_task.area.pix.border.width - panel->g_task.area.paddingx;
|
||||||
taskbar->task_width = pixel_height;
|
|
||||||
taskbar->task_modulo = modulo_height;
|
|
||||||
taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.paddingy) - panel->g_task.text_posx - panel->g_task.area.pix.border.width - panel->g_task.area.paddingx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// change pos_y and height for all tasks
|
// change pos_y and height for all tasks
|
||||||
y = taskbar->area.posy + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
|
y = taskbar->area.posy + border_width + taskbar->area.paddingxlr;
|
||||||
for (l = taskbar->area.list; l ; l = l->next) {
|
for (l = taskbar->area.list; l ; l = l->next) {
|
||||||
tsk = l->data;
|
tsk = l->data;
|
||||||
if (!tsk->area.on_screen) continue;
|
if (!tsk->area.on_screen) continue;
|
||||||
|
|||||||
@@ -402,9 +402,9 @@ void event_property_notify (XEvent *e)
|
|||||||
if (panel_mode == MULTI_DESKTOP && panel->g_taskbar.use_active) {
|
if (panel_mode == MULTI_DESKTOP && panel->g_taskbar.use_active) {
|
||||||
// redraw both taskbar
|
// redraw both taskbar
|
||||||
panel->taskbar[old_desktop].area.is_active = 0;
|
panel->taskbar[old_desktop].area.is_active = 0;
|
||||||
panel->taskbar[old_desktop].area.redraw = 1;
|
panel->taskbar[old_desktop].area.resize = 1;
|
||||||
panel->taskbar[server.desktop].area.is_active = 1;
|
panel->taskbar[server.desktop].area.is_active = 1;
|
||||||
panel->taskbar[server.desktop].area.redraw = 1;
|
panel->taskbar[server.desktop].area.resize = 1;
|
||||||
panel_refresh = 1;
|
panel_refresh = 1;
|
||||||
}
|
}
|
||||||
// check ALLDESKTOP task => resize taskbar
|
// check ALLDESKTOP task => resize taskbar
|
||||||
@@ -780,7 +780,7 @@ int main (int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ReparentNotify:
|
case ReparentNotify:
|
||||||
if (!systray.area.on_screen)
|
if (!systray_enabled)
|
||||||
break;
|
break;
|
||||||
panel = (Panel*)systray.area.panel;
|
panel = (Panel*)systray.area.panel;
|
||||||
if (e.xany.window == panel->main_win) // reparented to us
|
if (e.xany.window == panel->main_win) // reparented to us
|
||||||
|
|||||||
@@ -61,11 +61,11 @@ void init_tooltip()
|
|||||||
|
|
||||||
void cleanup_tooltip()
|
void cleanup_tooltip()
|
||||||
{
|
{
|
||||||
|
alarm(0);
|
||||||
tooltip_hide();
|
tooltip_hide();
|
||||||
g_tooltip.enabled = False;
|
g_tooltip.enabled = False;
|
||||||
g_tooltip.current_state = TOOLTIP_ABOUT_TO_HIDE;
|
g_tooltip.current_state = TOOLTIP_ABOUT_TO_HIDE;
|
||||||
if (g_tooltip.task) {
|
if (g_tooltip.task) {
|
||||||
alarm(0);
|
|
||||||
g_tooltip.task = 0;
|
g_tooltip.task = 0;
|
||||||
}
|
}
|
||||||
if (g_tooltip.window) {
|
if (g_tooltip.window) {
|
||||||
|
|||||||
Reference in New Issue
Block a user