Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
117ffb2bfd | ||
|
|
a8e7f4137a | ||
|
|
27715a5dbb | ||
|
|
7d0b0b85bc | ||
|
|
ec7e9e18ad | ||
|
|
5966b198b6 | ||
|
|
8af45bf3e6 | ||
|
|
71f8a01d48 | ||
|
|
418119a1ab | ||
|
|
1ecfdf5289 |
12
ChangeLog
12
ChangeLog
@@ -1,3 +1,15 @@
|
||||
2016-01-25 0.12.5
|
||||
- Fixes:
|
||||
- Fix crash on 32-bit systems (issue #546)
|
||||
- Fix compilation on Slackware (issue #547)
|
||||
- Terminal color reset code moved to the same line to prevent interference with logging (issue #545)
|
||||
- Enhancements:
|
||||
- Executor now sends click coordinates via environment variables (issue #544)
|
||||
|
||||
2016-01-24 0.12.5
|
||||
- Fixes:
|
||||
- Fix rendering corruption triggered occasionally when the compositor is disabled (regression in 0.12.4)
|
||||
|
||||
2016-01-23 0.12.4
|
||||
- Enhancements:
|
||||
- Support for NETWM viewports (as used by Compiz or Unity) (issue #94)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# New stable release: 0.12.4
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/0.12.4/ChangeLog
|
||||
# New stable release: 0.12.6
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/0.12.6/ChangeLog
|
||||
|
||||
Documentation: https://gitlab.com/o9000/tint2/wikis/Configure
|
||||
|
||||
@@ -7,7 +7,7 @@ Try it out with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/In
|
||||
```
|
||||
git clone https://gitlab.com/o9000/tint2.git
|
||||
cd tint2
|
||||
git checkout 0.12.4
|
||||
git checkout 0.12.6
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
@@ -67,9 +67,6 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
|
||||
* Downloads: https://gitlab.com/o9000/tint2-archive/tree/master or https://code.google.com/p/tint2/downloads/list
|
||||
* Old project location (inactive): https://code.google.com/p/tint2
|
||||
|
||||
# Releases
|
||||
* Latest stable release: tint2 0.12.4 (January 2016)
|
||||
|
||||
# Screenshots
|
||||
|
||||
## Default config of the latest release:
|
||||
|
||||
@@ -235,7 +235,7 @@ static void add_battery(const char *entryname)
|
||||
fprintf(stdout, "found battery \"%s\"\n", bat->name);
|
||||
} else {
|
||||
g_free(bat);
|
||||
fprintf(stderr, RED "failed to initialize battery \"%s\"\n" RESET, entryname);
|
||||
fprintf(stderr, RED "failed to initialize battery \"%s\"" RESET "\n", entryname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ static void add_mains(const char *entryname)
|
||||
fprintf(stdout, "found mains \"%s\"\n", ac->name);
|
||||
} else {
|
||||
g_free(ac);
|
||||
fprintf(stderr, RED "failed to initialize mains \"%s\"\n" RESET, entryname);
|
||||
fprintf(stderr, RED "failed to initialize mains \"%s\"" RESET "\n", entryname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ void draw_execp(void *obj, cairo_t *c)
|
||||
g_object_unref(layout);
|
||||
}
|
||||
|
||||
void execp_action(void *obj, int button)
|
||||
void execp_action(void *obj, int button, int x, int y)
|
||||
{
|
||||
Execp *execp = obj;
|
||||
char *command = NULL;
|
||||
@@ -450,7 +450,17 @@ void execp_action(void *obj, int button)
|
||||
break;
|
||||
}
|
||||
if (command) {
|
||||
tint_exec(command);
|
||||
char *full_cmd = g_strdup_printf("export EXECP_X=%d;"
|
||||
"export EXECP_Y=%d;"
|
||||
"export EXECP_W=%d;"
|
||||
"export EXECP_H=%d; %s",
|
||||
x,
|
||||
y,
|
||||
execp->area.width,
|
||||
execp->area.height,
|
||||
command);
|
||||
tint_exec(full_cmd);
|
||||
g_free(full_cmd);
|
||||
} else {
|
||||
if (execp->backend->child_pipe > 0) {
|
||||
// Command currently running, nothing to do
|
||||
|
||||
@@ -130,7 +130,7 @@ void draw_execp(void *obj, cairo_t *c);
|
||||
gboolean resize_execp(void *obj);
|
||||
|
||||
// Called on mouse click event.
|
||||
void execp_action(void *obj, int button);
|
||||
void execp_action(void *obj, int button, int x, int y);
|
||||
|
||||
// Called to check if new output from the command can be read.
|
||||
// No command might be running.
|
||||
|
||||
76
src/panel.c
76
src/panel.c
@@ -34,6 +34,8 @@
|
||||
#include "panel.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
void panel_clear_background(void *obj);
|
||||
|
||||
int signal_pending;
|
||||
|
||||
MouseAction mouse_left;
|
||||
@@ -198,6 +200,7 @@ void init_panel()
|
||||
p->area.resize_needed = 1;
|
||||
p->area.size_mode = LAYOUT_DYNAMIC;
|
||||
p->area._resize = resize_panel;
|
||||
p->area._clear = panel_clear_background;
|
||||
init_panel_size_and_position(p);
|
||||
// add children according to panel_items
|
||||
for (int k = 0; k < strlen(panel_items_order); k++) {
|
||||
@@ -688,75 +691,40 @@ void set_panel_properties(Panel *p)
|
||||
XFree(classhint);
|
||||
}
|
||||
|
||||
void set_panel_background(Panel *p)
|
||||
void panel_clear_background(void *obj)
|
||||
{
|
||||
if (p->area.pix)
|
||||
XFreePixmap(server.display, p->area.pix);
|
||||
p->area.pix = XCreatePixmap(server.display, server.root_win, p->area.width, p->area.height, server.depth);
|
||||
|
||||
int xoff = 0, yoff = 0;
|
||||
if (panel_horizontal && panel_position & BOTTOM)
|
||||
yoff = p->area.height - p->hidden_height;
|
||||
else if (!panel_horizontal && panel_position & RIGHT)
|
||||
xoff = p->area.width - p->hidden_width;
|
||||
|
||||
if (server.real_transparency) {
|
||||
clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height);
|
||||
} else {
|
||||
Panel *p = obj;
|
||||
clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height);
|
||||
if (!server.real_transparency) {
|
||||
get_root_pixmap();
|
||||
// copy background (server.root_pmap) in panel.area.pix
|
||||
Window dummy;
|
||||
int x, y;
|
||||
XTranslateCoordinates(server.display, p->main_win, server.root_win, 0, 0, &x, &y, &dummy);
|
||||
|
||||
if (panel_autohide && p->is_hidden) {
|
||||
int xoff = 0, yoff = 0;
|
||||
if (panel_horizontal && panel_position & BOTTOM)
|
||||
yoff = p->area.height - p->hidden_height;
|
||||
else if (!panel_horizontal && panel_position & RIGHT)
|
||||
xoff = p->area.width - p->hidden_width;
|
||||
x -= xoff;
|
||||
y -= yoff;
|
||||
}
|
||||
|
||||
XSetTSOrigin(server.display, server.gc, -x, -y);
|
||||
XFillRectangle(server.display, p->area.pix, server.gc, 0, 0, p->area.width, p->area.height);
|
||||
}
|
||||
}
|
||||
|
||||
// draw background panel
|
||||
cairo_surface_t *cs = cairo_xlib_surface_create(server.display, p->area.pix, server.visual, p->area.width, p->area.height);
|
||||
cairo_t *c = cairo_create(cs);
|
||||
draw_background(&p->area, c);
|
||||
cairo_destroy(c);
|
||||
cairo_surface_destroy(cs);
|
||||
void set_panel_background(Panel *p)
|
||||
{
|
||||
panel_clear_background(p);
|
||||
schedule_redraw(&p->area);
|
||||
|
||||
if (panel_autohide) {
|
||||
if (p->hidden_pixmap)
|
||||
XFreePixmap(server.display, p->hidden_pixmap);
|
||||
p->hidden_pixmap = XCreatePixmap(server.display, server.root_win, p->hidden_width, p->hidden_height, server.depth);
|
||||
XCopyArea(server.display,
|
||||
p->area.pix,
|
||||
p->hidden_pixmap,
|
||||
server.gc,
|
||||
xoff,
|
||||
yoff,
|
||||
p->hidden_width,
|
||||
p->hidden_height,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
|
||||
// redraw panel's object
|
||||
for (GList *l = p->area.children; l; l = l->next) {
|
||||
Area *a = (Area *)l->data;
|
||||
schedule_redraw(a);
|
||||
}
|
||||
|
||||
// reset task/taskbar 'state_pix'
|
||||
Taskbar *taskbar;
|
||||
for (int i = 0; i < p->num_desktops; i++) {
|
||||
taskbar = &p->taskbar[i];
|
||||
schedule_redraw(&taskbar->area);
|
||||
schedule_redraw(&taskbar->bar_name.area);
|
||||
GList *l = taskbar->area.children;
|
||||
if (taskbarname_enabled)
|
||||
l = l->next;
|
||||
for (; l; l = l->next) {
|
||||
schedule_redraw((Area *)l->data);
|
||||
}
|
||||
if (p->hidden_pixmap) {
|
||||
XFreePixmap(server.display, p->hidden_pixmap);
|
||||
p->hidden_pixmap = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ gboolean resize_systray(void *obj)
|
||||
count++;
|
||||
}
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "%s:%d number of icons = %d\n" RESET, __FUNCTION__, __LINE__, count);
|
||||
fprintf(stderr, BLUE "%s:%d number of icons = %d" RESET "\n", __FUNCTION__, __LINE__, count);
|
||||
|
||||
if (panel_horizontal) {
|
||||
int height = sysbar->area.height - 2 * sysbar->area.bg->border.width - 2 * sysbar->area.paddingy;
|
||||
@@ -190,7 +190,7 @@ gboolean resize_systray(void *obj)
|
||||
void draw_systray(void *obj, cairo_t *c)
|
||||
{
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
if (systray_composited) {
|
||||
if (render_background)
|
||||
XFreePixmap(server.display, render_background);
|
||||
@@ -276,7 +276,7 @@ void on_change_systray(void *obj)
|
||||
unsigned int width, height, depth;
|
||||
Window root;
|
||||
if (!XGetGeometry(server.display, traywin->parent, &root, &xpos, &ypos, &width, &height, &border_width, &depth)) {
|
||||
fprintf(stderr, RED "Couldn't get geometry of window!\n" RESET);
|
||||
fprintf(stderr, RED "Couldn't get geometry of window!" RESET "\n");
|
||||
}
|
||||
if (width != traywin->width || height != traywin->height || xpos != traywin->x || ypos != traywin->y) {
|
||||
if (systray_profile)
|
||||
@@ -345,7 +345,7 @@ void start_net()
|
||||
pid += prop[0];
|
||||
fprintf(stderr, " pid=%d", pid);
|
||||
}
|
||||
fprintf(stderr, "\n" RESET);
|
||||
fprintf(stderr, RESET "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -402,11 +402,11 @@ void start_net()
|
||||
XSetSelectionOwner(server.display, server.atom._NET_SYSTEM_TRAY_SCREEN, net_sel_win, CurrentTime);
|
||||
if (XGetSelectionOwner(server.display, server.atom._NET_SYSTEM_TRAY_SCREEN) != net_sel_win) {
|
||||
stop_net();
|
||||
fprintf(stderr, RED "tint2 : can't get systray manager\n" RESET);
|
||||
fprintf(stderr, RED "tint2 : can't get systray manager" RESET "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(stderr, GREEN "tint2 : systray started\n" RESET);
|
||||
fprintf(stderr, GREEN "tint2 : systray started" RESET "\n");
|
||||
if (systray_profile)
|
||||
fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
XClientMessageEvent ev;
|
||||
@@ -445,7 +445,7 @@ void net_message(XClientMessageEvent *e)
|
||||
if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA)
|
||||
fprintf(stderr, "message from dockapp: %s\n", e->data.b);
|
||||
else
|
||||
fprintf(stderr, RED "SYSTEM_TRAY : unknown message type\n" RESET);
|
||||
fprintf(stderr, RED "SYSTEM_TRAY : unknown message type" RESET "\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -473,10 +473,10 @@ gboolean error;
|
||||
int window_error_handler(Display *d, XErrorEvent *e)
|
||||
{
|
||||
if (systray_profile)
|
||||
fprintf(stderr, RED "[%f] %s:%d\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, RED "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
error = TRUE;
|
||||
if (e->error_code != BadWindow) {
|
||||
fprintf(stderr, RED "systray: error code %d\n" RESET, e->error_code);
|
||||
fprintf(stderr, RED "systray: error code %d" RESET "\n", e->error_code);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -643,7 +643,7 @@ gboolean add_icon(Window win)
|
||||
num_empty_same_pid++;
|
||||
fprintf(stderr,
|
||||
RED
|
||||
"Removing tray icon %lu (%s) from misbehaving application with pid=%d (too many icons)\n" RESET,
|
||||
"Removing tray icon %lu (%s) from misbehaving application with pid=%d (too many icons)" RESET "\n",
|
||||
((TrayWindow *)l->data)->win,
|
||||
((TrayWindow *)l->data)->name,
|
||||
pid);
|
||||
@@ -666,7 +666,7 @@ gboolean add_icon(Window win)
|
||||
XSetWindowAttributes set_attr;
|
||||
Visual *visual = server.visual;
|
||||
fprintf(stderr,
|
||||
GREEN "add_icon: %lu (%s), pid %d, %d, visual %p, colormap %lu, depth %d, width %d, height %d\n" RESET,
|
||||
GREEN "add_icon: %lu (%s), pid %d, %d, visual %p, colormap %lu, depth %d, width %d, height %d" RESET "\n",
|
||||
win,
|
||||
name,
|
||||
pid,
|
||||
@@ -745,7 +745,7 @@ gboolean add_icon(Window win)
|
||||
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
systray.area.resize_needed = TRUE;
|
||||
schedule_redraw(&systray.area);
|
||||
panel->area.resize_needed = TRUE;
|
||||
@@ -808,7 +808,7 @@ gboolean reparent_icon(TrayWindow *traywin)
|
||||
XSetErrorHandler(old);
|
||||
if (error != FALSE) {
|
||||
fprintf(stderr,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d\n" RESET,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d" RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -887,7 +887,7 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
// We could defer this for later (if we set PropertyChangeMask in XSelectInput we get notified)
|
||||
// but
|
||||
// for some reason it breaks transparency for Qt icons. So we don't.
|
||||
// fprintf(stderr, RED "tint2: window refused embedding\n" RESET);
|
||||
// fprintf(stderr, RED "tint2: window refused embedding" RESET "\n");
|
||||
// remove_icon(traywin);
|
||||
// XFree(data);
|
||||
// return FALSE;
|
||||
@@ -896,7 +896,7 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
XFree(data);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, RED "tint2 : xembed error\n" RESET);
|
||||
fprintf(stderr, RED "tint2 : xembed error" RESET "\n");
|
||||
remove_icon(traywin);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -932,7 +932,7 @@ gboolean embed_icon(TrayWindow *traywin)
|
||||
XSetErrorHandler(old);
|
||||
if (error != FALSE) {
|
||||
fprintf(stderr,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d\n" RESET,
|
||||
RED "systray %d: cannot embed icon for window %lu (%s) parent %lu pid %d" RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -972,7 +972,7 @@ void remove_icon(TrayWindow *traywin)
|
||||
|
||||
// remove from our list
|
||||
systray.list_icons = g_slist_remove(systray.list_icons, traywin);
|
||||
fprintf(stderr, YELLOW "remove_icon: %lu (%s)\n" RESET, traywin->win, traywin->name);
|
||||
fprintf(stderr, YELLOW "remove_icon: %lu (%s)" RESET "\n", traywin->win, traywin->name);
|
||||
|
||||
XSelectInput(server.display, traywin->win, NoEventMask);
|
||||
if (traywin->damage)
|
||||
@@ -1010,7 +1010,7 @@ void remove_icon(TrayWindow *traywin)
|
||||
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
systray.area.resize_needed = TRUE;
|
||||
schedule_redraw(&systray.area);
|
||||
panel->area.resize_needed = TRUE;
|
||||
@@ -1111,7 +1111,7 @@ void systray_reconfigure_event(TrayWindow *traywin, XEvent *e)
|
||||
if (traywin->bad_size_counter == max_bad_resize_events) {
|
||||
traywin->bad_size_counter++;
|
||||
fprintf(stderr,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events\n" RESET,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events" RESET "\n",
|
||||
traywin->win,
|
||||
traywin->name);
|
||||
}
|
||||
@@ -1131,7 +1131,7 @@ void systray_reconfigure_event(TrayWindow *traywin, XEvent *e)
|
||||
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
panel_refresh = TRUE;
|
||||
refresh_systray = 1;
|
||||
}
|
||||
@@ -1196,7 +1196,7 @@ void systray_resize_request_event(TrayWindow *traywin, XEvent *e)
|
||||
if (traywin->bad_size_counter == max_bad_resize_events) {
|
||||
traywin->bad_size_counter++;
|
||||
fprintf(stderr,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events\n" RESET,
|
||||
RED "Detected resize loop for tray icon %lu (%s), throttling resize events" RESET "\n",
|
||||
traywin->win,
|
||||
traywin->name);
|
||||
}
|
||||
@@ -1216,7 +1216,7 @@ void systray_resize_request_event(TrayWindow *traywin, XEvent *e)
|
||||
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
panel_refresh = TRUE;
|
||||
refresh_systray = 1;
|
||||
}
|
||||
@@ -1278,7 +1278,7 @@ void systray_render_icon_composited(void *t)
|
||||
add_timeout(min_refresh_period, 0, systray_render_icon_composited, traywin, &traywin->render_timeout);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1298,7 +1298,7 @@ void systray_render_icon_composited(void *t)
|
||||
add_timeout(min_refresh_period, 0, systray_render_icon_composited, traywin, &traywin->render_timeout);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1330,7 +1330,7 @@ void systray_render_icon_composited(void *t)
|
||||
} else if (traywin->depth == 32) {
|
||||
f = XRenderFindStandardFormat(server.display, PictStandardARGB32);
|
||||
} else {
|
||||
fprintf(stderr, RED "Strange tray icon found with depth: %d\n" RESET, traywin->depth);
|
||||
fprintf(stderr, RED "Strange tray icon found with depth: %d" RESET "\n", traywin->depth);
|
||||
XFreePixmap(server.display, tmp_pmap);
|
||||
return;
|
||||
}
|
||||
@@ -1434,7 +1434,7 @@ void systray_render_icon_composited(void *t)
|
||||
// Resize and redraw the systray
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
BLUE "[%f] %s:%d trigger resize & redraw\n" RESET,
|
||||
BLUE "[%f] %s:%d trigger resize & redraw" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__);
|
||||
@@ -1459,7 +1459,7 @@ void systray_render_icon_composited(void *t)
|
||||
|
||||
on_error:
|
||||
fprintf(stderr,
|
||||
RED "systray %d: rendering error for icon %lu (%s) pid %d\n" RESET,
|
||||
RED "systray %d: rendering error for icon %lu (%s) pid %d" RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -1469,7 +1469,7 @@ on_error:
|
||||
on_systray_error:
|
||||
fprintf(stderr,
|
||||
RED "systray %d: rendering error for icon %lu (%s) pid %d. "
|
||||
"Disabling compositing and restarting systray...\n" RESET,
|
||||
"Disabling compositing and restarting systray..." RESET "\n",
|
||||
__LINE__,
|
||||
traywin->win,
|
||||
traywin->name,
|
||||
@@ -1494,7 +1494,7 @@ void systray_render_icon(void *t)
|
||||
if (!traywin->reparented || !traywin->embedded) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1532,7 +1532,7 @@ void systray_render_icon(void *t)
|
||||
systray_render_icon_from_image(traywin);
|
||||
if (systray_profile)
|
||||
fprintf(stderr,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering\n" RESET,
|
||||
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||
profiling_get_time(),
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
@@ -1568,7 +1568,7 @@ void systray_render_icon(void *t)
|
||||
void refresh_systray_icons()
|
||||
{
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
TrayWindow *traywin;
|
||||
GSList *l;
|
||||
for (l = systray.list_icons; l; l = l->next) {
|
||||
|
||||
@@ -262,15 +262,10 @@ void task_update_icon(Task *task)
|
||||
gulong *tmp_data;
|
||||
|
||||
tmp_data = get_best_icon(data, get_icon_count(data, i), i, &w, &h, panel->g_task.icon_size1);
|
||||
#ifdef __x86_64__
|
||||
DATA32 icon_data[w * h];
|
||||
int length = w * h;
|
||||
for (int j = 0; j < length; ++j)
|
||||
for (int j = 0; j < w * h; ++j)
|
||||
icon_data[j] = tmp_data[j];
|
||||
img = imlib_create_image_using_copied_data(w, h, icon_data);
|
||||
#else
|
||||
img = imlib_create_image_using_data(w, h, (DATA32 *)tmp_data);
|
||||
#endif
|
||||
XFree(data);
|
||||
} else {
|
||||
// get Pixmap icon
|
||||
|
||||
37
src/tint.c
37
src/tint.c
@@ -191,7 +191,7 @@ const char *get_home_dir()
|
||||
|
||||
void dump_backtrace(int log_fd)
|
||||
{
|
||||
log_string(log_fd, YELLOW "\nBacktrace:\n");
|
||||
log_string(log_fd, "\n" YELLOW "Backtrace:" RESET "\n");
|
||||
|
||||
#ifdef ENABLE_LIBUNWIND
|
||||
unw_cursor_t cursor;
|
||||
@@ -226,7 +226,6 @@ void dump_backtrace(int log_fd)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
log_string(log_fd, RESET);
|
||||
}
|
||||
|
||||
// sleep() returns early when signals arrive. This function does not.
|
||||
@@ -251,7 +250,7 @@ void handle_crash(const char *reason)
|
||||
log_string(log_fd, reason);
|
||||
log_string(log_fd, RESET "\n");
|
||||
dump_backtrace(log_fd);
|
||||
log_string(log_fd, RED "Please create a bug report with this log output.\n" RESET);
|
||||
log_string(log_fd, RED "Please create a bug report with this log output." RESET "\n");
|
||||
close(log_fd);
|
||||
}
|
||||
|
||||
@@ -808,7 +807,7 @@ void event_button_release(XEvent *e)
|
||||
|
||||
Execp *execp = click_execp(panel, e->xbutton.x, e->xbutton.y);
|
||||
if (execp) {
|
||||
execp_action(execp, e->xbutton.button);
|
||||
execp_action(execp, e->xbutton.button, e->xbutton.x - execp->area.posx, e->xbutton.y - execp->area.posy);
|
||||
if (panel_layer == BOTTOM_LAYER)
|
||||
XLowerWindow(server.display, panel->main_win);
|
||||
task_drag = 0;
|
||||
@@ -1161,7 +1160,7 @@ void event_configure_notify(XEvent *e)
|
||||
|
||||
// change in root window (xrandr)
|
||||
if (win == server.root_win) {
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to configuration change in the root window\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to configuration change in the root window" RESET "\n", __FILE__, __LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
return;
|
||||
}
|
||||
@@ -1477,13 +1476,31 @@ start:
|
||||
while (1) {
|
||||
if (panel_refresh) {
|
||||
if (systray_profile)
|
||||
fprintf(stderr, BLUE "[%f] %s:%d redrawing panel\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
fprintf(stderr, BLUE "[%f] %s:%d redrawing panel" RESET "\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||
panel_refresh = FALSE;
|
||||
|
||||
for (int i = 0; i < num_panels; i++) {
|
||||
Panel *panel = &panels[i];
|
||||
|
||||
if (panel->is_hidden) {
|
||||
if (!panel->hidden_pixmap) {
|
||||
panel->hidden_pixmap = XCreatePixmap(server.display, server.root_win, panel->hidden_width, panel->hidden_height, server.depth);
|
||||
int xoff = 0, yoff = 0;
|
||||
if (panel_horizontal && panel_position & BOTTOM)
|
||||
yoff = panel->area.height - panel->hidden_height;
|
||||
else if (!panel_horizontal && panel_position & RIGHT)
|
||||
xoff = panel->area.width - panel->hidden_width;
|
||||
XCopyArea(server.display,
|
||||
panel->area.pix,
|
||||
panel->hidden_pixmap,
|
||||
server.gc,
|
||||
xoff,
|
||||
yoff,
|
||||
panel->hidden_width,
|
||||
panel->hidden_height,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
XCopyArea(server.display,
|
||||
panel->hidden_pixmap,
|
||||
panel->main_win,
|
||||
@@ -1686,7 +1703,7 @@ start:
|
||||
case DestroyNotify:
|
||||
if (e.xany.window == server.composite_manager) {
|
||||
// Stop real_transparency
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to compositor shutdown\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to compositor shutdown" RESET "\n", __FILE__, __LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
break;
|
||||
}
|
||||
@@ -1705,11 +1722,11 @@ start:
|
||||
if (ev->data.l[1] == server.atom._NET_WM_CM_S0) {
|
||||
if (ev->data.l[2] == None) {
|
||||
// Stop real_transparency
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n", __FILE__, __LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
} else {
|
||||
// Start real_transparency
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr, YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n", __FILE__, __LINE__);
|
||||
signal_pending = SIGUSR1;
|
||||
}
|
||||
}
|
||||
@@ -1863,7 +1880,7 @@ start:
|
||||
if (signal_pending) {
|
||||
cleanup();
|
||||
if (signal_pending == SIGUSR1) {
|
||||
fprintf(stderr, YELLOW "%s %d: restarting tint2...\n" RESET, __FILE__, __LINE__);
|
||||
fprintf(stderr, YELLOW "%s %d: restarting tint2..." RESET "\n", __FILE__, __LINE__);
|
||||
// restart tint2
|
||||
// SIGUSR1 used when : user's signal, composite manager stop/start or xrandr
|
||||
goto start;
|
||||
|
||||
@@ -379,9 +379,14 @@ void draw(Area *a)
|
||||
a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] = a->pix;
|
||||
|
||||
// Add layer of root pixmap (or clear pixmap if real_transparency==true)
|
||||
if (server.real_transparency)
|
||||
if (!a->_clear) {
|
||||
clear_pixmap(a->pix, 0, 0, a->width, a->height);
|
||||
XCopyArea(server.display, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0);
|
||||
if (!server.real_transparency) {
|
||||
XCopyArea(server.display, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0);
|
||||
}
|
||||
} else {
|
||||
a->_clear(a);
|
||||
}
|
||||
|
||||
cairo_surface_t *cs = cairo_xlib_surface_create(server.display, a->pix, server.visual, a->width, a->height);
|
||||
cairo_t *c = cairo_create(cs);
|
||||
|
||||
@@ -202,6 +202,9 @@ typedef struct Area {
|
||||
|
||||
// Callbacks
|
||||
|
||||
// Called on draw before any drawing takes place, obj = pointer to the Area
|
||||
void (*_clear)(void *obj);
|
||||
|
||||
// Called on draw, obj = pointer to the Area
|
||||
void (*_draw_foreground)(void *obj, cairo_t *c);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <sys/resource.h>
|
||||
#include <errno.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#ifdef HAVE_RSVG
|
||||
#include <librsvg/rsvg.h>
|
||||
|
||||
@@ -109,7 +109,7 @@ gboolean window_is_hidden(Window win)
|
||||
int get_window_desktop(Window win)
|
||||
{
|
||||
if (!server.viewports)
|
||||
return get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL);
|
||||
return MAX(0, MIN(server.num_desktops - 1, get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL)));
|
||||
|
||||
int x, y, w, h;
|
||||
get_window_coordinates(win, &x, &y, &w, &h);
|
||||
|
||||
Reference in New Issue
Block a user