Add area.name, useful for debugging

This commit is contained in:
o9000 2016-03-25 11:13:05 +01:00
parent 76bd4baa9c
commit 1edaf21bde
10 changed files with 15 additions and 1 deletions

View file

@ -150,6 +150,7 @@ void init_battery_panel(void *p)
battery->area.parent = p;
battery->area.panel = p;
snprintf(battery->area.name, sizeof(battery->area.name), "Battery");
battery->area._draw_foreground = draw_battery;
battery->area.size_mode = LAYOUT_FIXED;
battery->area._resize = resize_battery;

View file

@ -180,6 +180,7 @@ void init_clock_panel(void *p)
clock_init_fonts();
clock->area.parent = p;
clock->area.panel = p;
snprintf(clock->area.name, sizeof(clock->area.name), "Clock");
clock->area._is_under_mouse = full_width_area_is_under_mouse;
clock->area.has_mouse_press_effect = clock->area.has_mouse_over_effect =
panel_config.mouse_effects && (clock_lclick_command || clock_mclick_command || clock_rclick_command ||

View file

@ -155,9 +155,9 @@ void init_execp_panel(void *p)
execp->area.paddingx = execp->backend->paddingx;
execp->area.paddingy = execp->backend->paddingy;
execp->area.paddingxlr = execp->backend->paddingxlr;
execp->area.parent = panel;
execp->area.panel = panel;
snprintf(execp->area.name, sizeof(execp->area.name), "Execp %s", execp->backend->command ? execp->backend->command : "null");
execp->area._draw_foreground = draw_execp;
execp->area.size_mode = LAYOUT_FIXED;
execp->area._resize = resize_execp;

View file

@ -39,6 +39,7 @@ void init_freespace_panel(void *p)
freespace->area.bg = &g_array_index(backgrounds, Background, 0);
freespace->area.parent = p;
freespace->area.panel = p;
snprintf(freespace->area.name, sizeof(freespace->area.name), "Freespace");
freespace->area.size_mode = LAYOUT_FIXED;
freespace->area.resize_needed = 1;
freespace->area.on_screen = TRUE;

View file

@ -83,6 +83,7 @@ void init_launcher_panel(void *p)
launcher->area.parent = p;
launcher->area.panel = p;
snprintf(launcher->area.name, sizeof(launcher->area.name), "Launcher");
launcher->area._draw_foreground = NULL;
launcher->area.size_mode = LAYOUT_FIXED;
launcher->area._resize = resize_launcher;
@ -452,6 +453,7 @@ void launcher_load_icons(Launcher *launcher)
if (entry.exec) {
LauncherIcon *launcherIcon = calloc(1, sizeof(LauncherIcon));
launcherIcon->area.panel = launcher->area.panel;
snprintf(launcherIcon->area.name, sizeof(launcherIcon->area.name), "LauncherIcon %s", entry.name ? entry.name : "null");
launcherIcon->area._draw_foreground = draw_launcher_icon;
launcherIcon->area.size_mode = LAYOUT_FIXED;
launcherIcon->area._resize = NULL;

View file

@ -99,6 +99,7 @@ void default_panel()
backgrounds = g_array_new(0, 0, sizeof(Background));
memset(&panel_config, 0, sizeof(Panel));
snprintf(panel_config.area.name, sizeof(panel_config.area.name), "Panel");
panel_config.mouse_over_alpha = 100;
panel_config.mouse_over_saturation = 0;
panel_config.mouse_over_brightness = 10;
@ -196,6 +197,7 @@ void init_panel()
p->area.bg = &g_array_index(backgrounds, Background, 0);
p->area.parent = p;
p->area.panel = p;
snprintf(p->area.name, sizeof(p->area.name), "Panel %d", i);
p->area.on_screen = TRUE;
p->area.resize_needed = 1;
p->area.size_mode = LAYOUT_DYNAMIC;

View file

@ -113,6 +113,7 @@ void init_systray_panel(void *p)
Panel *panel = (Panel *)p;
systray.area.parent = panel;
systray.area.panel = panel;
snprintf(systray.area.name, sizeof(systray.area.name), "Systray");
if (!systray.area.bg)
systray.area.bg = &g_array_index(backgrounds, Background, 0);
show(&systray.area);

View file

@ -65,6 +65,7 @@ Task *add_task(Window win)
Task task_template;
memset(&task_template, 0, sizeof(task_template));
snprintf(task_template.area.name, sizeof(task_template.area.name), "Task %d", (int)win);
task_template.area.has_mouse_over_effect = panel_config.mouse_effects;
task_template.area.has_mouse_press_effect = panel_config.mouse_effects;
task_template.area._is_under_mouse = full_width_area_is_under_mouse;
@ -82,6 +83,7 @@ Task *add_task(Window win)
}
task_update_title(&task_template);
task_update_icon(&task_template);
snprintf(task_template.area.name, sizeof(task_template.area.name), "Task %d %s", (int)win, task_template.title ? task_template.title : "null");
// fprintf(stderr, "%s %d: win = %ld, task = %s\n", __FUNCTION__, __LINE__, win, task_template.title ?
// task_template.title : "??");

View file

@ -147,6 +147,7 @@ void init_taskbar_panel(void *p)
// taskbar name
panel->g_taskbar.area_name.panel = panel;
snprintf(panel->g_taskbar.area_name.name, sizeof(panel->g_taskbar.area_name.name), "Taskbarname");
panel->g_taskbar.area_name.size_mode = LAYOUT_FIXED;
panel->g_taskbar.area_name._resize = resize_taskbarname;
panel->g_taskbar.area_name._is_under_mouse = full_width_area_is_under_mouse;
@ -158,6 +159,7 @@ void init_taskbar_panel(void *p)
// taskbar
panel->g_taskbar.area.parent = panel;
panel->g_taskbar.area.panel = panel;
snprintf(panel->g_taskbar.area.name, sizeof(panel->g_taskbar.area.name), "Taskbar");
panel->g_taskbar.area.size_mode = LAYOUT_DYNAMIC;
panel->g_taskbar.area.alignment = taskbar_alignment;
panel->g_taskbar.area._resize = resize_taskbar;
@ -178,6 +180,7 @@ void init_taskbar_panel(void *p)
// task
panel->g_task.area.panel = panel;
snprintf(panel->g_task.area.name, sizeof(panel->g_task.area.name), "Task");
panel->g_task.area.size_mode = LAYOUT_DYNAMIC;
panel->g_task.area._draw_foreground = draw_task;
panel->g_task.area._on_change_layout = on_change_task;

View file

@ -194,6 +194,7 @@ typedef struct Area {
// This is the pixmap on which the Area is rendered. Render to it directly if needed.
Pixmap pix;
Pixmap pix_by_state[MOUSE_STATE_COUNT];
char name[32];
// Callbacks