Compare commits

...

15 Commits

Author SHA1 Message Date
o9000
107bfc85a3 Update for 0.12.7 2016-01-29 23:09:12 +01:00
o9000
85536065bc Fix regression in background rendering (issue #549) 2016-01-27 10:11:48 +01:00
o9000
efd28f38d9 Updated changelog 2016-01-26 20:33:36 +01:00
o9000
4b26a5ef8a Add stress test for workspace changes 2016-01-26 20:31:51 +01:00
o9000
b196bb1c00 Fix small memory leak in launcher 2016-01-26 20:30:57 +01:00
o9000
402713d4b1 Fix crash caused by race when reading _NET_CURRENT_DESKTOP and _NET_NUMBER_OF_DESKTOPS 2016-01-26 20:30:31 +01:00
o9000
f0de284dd9 Fix regression (all desktop tasks not working) 2016-01-26 20:28:23 +01:00
o9000
9d9d6aa302 Fix typo in changelog 2016-01-25 22:16:49 +01:00
o9000
117ffb2bfd Release 0.12.6 2016-01-25 21:58:31 +01:00
o9000
a8e7f4137a Fix crash on 32-bit 2016-01-25 18:26:17 +01:00
o9000
27715a5dbb Fix build on slackware 2016-01-25 18:25:59 +01:00
o9000
7d0b0b85bc Check that the window desktop index is in the valid range 2016-01-24 22:45:34 +01:00
o9000
ec7e9e18ad Move terminal color reset code to the same line (issue #545) 2016-01-24 20:08:52 +01:00
o9000
5966b198b6 Executor: send click coordinates via environment variables 2016-01-24 15:12:00 +01:00
o9000
8af45bf3e6 Updated readme 2016-01-24 13:17:36 +00:00
15 changed files with 139 additions and 71 deletions

View File

@@ -1,3 +1,17 @@
2016-01-29 0.12.7
- Fixes:
- Fix crash caused by race when reading inconsistent values for _NET_CURRENT_DESKTOP and _NET_NUMBER_OF_DESKTOPS
- Fix regression (all desktop tasks not working)
- Fix small memory leak in launcher
2016-01-25 0.12.6
- 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)

View File

@@ -1,5 +1,5 @@
# New stable release: 0.12.5
Changes: https://gitlab.com/o9000/tint2/blob/0.12.5/ChangeLog
# New stable release: 0.12.7
Changes: https://gitlab.com/o9000/tint2/blob/0.12.7/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.5
git checkout 0.12.7
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:

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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.

View File

@@ -457,10 +457,10 @@ void launcher_load_icons(Launcher *launcher)
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
launcherIcon->icon_size = 1;
launcherIcon->icon_tooltip = entry.name ? strdup(entry.name) : strdup(entry.exec);
free_desktop_entry(&entry);
launcher->list_icons = g_slist_append(launcher->list_icons, launcherIcon);
add_area(&launcherIcon->area, (Area *)launcher);
}
free_desktop_entry(&entry);
app = g_slist_next(app);
}
}

View File

@@ -427,8 +427,10 @@ void server_get_number_of_desktops()
XFree(x_screen_size);
int num_viewports = MAX(x_screen_width / work_area_width, 1) * MAX(x_screen_height / work_area_height, 1);
if (num_viewports <= 1)
if (num_viewports <= 1) {
server.num_desktops = 1;
return;
}
server.viewports = calloc(num_viewports, sizeof(Viewport));
int k = 0;
@@ -473,8 +475,9 @@ GSList *get_desktop_names()
int get_current_desktop()
{
if (!server.viewports)
return get_property32(server.root_win, server.atom._NET_CURRENT_DESKTOP, XA_CARDINAL);
if (!server.viewports) {
return MAX(0, MIN(server.num_desktops - 1, get_property32(server.root_win, server.atom._NET_CURRENT_DESKTOP, XA_CARDINAL)));
}
int num_results;
long *work_area_size = server_get_property(server.root_win, server.atom._NET_WORKAREA, XA_CARDINAL, &num_results);
@@ -507,7 +510,8 @@ int get_current_desktop()
// fprintf(stderr, "Viewport pos: %d x %d\n", viewport_x, viewport_y);
// fprintf(stderr, "Viewport i: %d\n", (viewport_y / work_area_height) * ncols + viewport_x / work_area_width);
return (viewport_y / work_area_height) * ncols + viewport_x / work_area_width;
int result = (viewport_y / work_area_height) * ncols + viewport_x / work_area_width;
return MAX(0, MIN(server.num_desktops - 1, result));
}
void change_desktop(int desktop)

View File

@@ -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) {

View File

@@ -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

View File

@@ -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,7 +1476,7 @@ 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++) {
@@ -1704,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;
}
@@ -1723,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;
}
}
@@ -1881,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;

View File

@@ -378,12 +378,11 @@ void draw(Area *a)
a->pix = XCreatePixmap(server.display, server.root_win, a->width, a->height, server.depth);
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 (!a->_clear) {
clear_pixmap(a->pix, 0, 0, a->width, a->height);
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);
}
// Add layer of root pixmap (or clear pixmap if real_transparency==true)
if (server.real_transparency)
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);
} else {
a->_clear(a);
}

View File

@@ -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>

View File

@@ -108,13 +108,17 @@ 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);
if (!server.viewports) {
int desktop = get_property32(win, server.atom._NET_WM_DESKTOP, XA_CARDINAL);
if (desktop != ALL_DESKTOPS)
desktop = MAX(0, MIN(server.num_desktops - 1, desktop));
return desktop;
}
int x, y, w, h;
get_window_coordinates(win, &x, &y, &w, &h);
int desktop = MIN(get_current_desktop(), server.num_desktops - 1);
int desktop = get_current_desktop();
// Window coordinates are relative to the current viewport, make them absolute
x += server.viewports[desktop].x;
y += server.viewports[desktop].y;

44
test/workspaces-stress.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
# List normal windows
# wmctrl -l | awk '{if ($4 != "Desktop") print $1}'
#
# Change the number of desktops
# xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS 2
#
# Move window to desktop
# xprop -id 0x03600007 -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP 0
#
# Move window to all desktops
# xprop -id 0x03600007 -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP 4294967295
while true
do
# change the number of desktops to a random value
num_desktops=$(( $RANDOM % 8 + 1 ))
xprop -root -f _NET_NUMBER_OF_DESKTOPS 32c -set _NET_NUMBER_OF_DESKTOPS $num_desktops
max_desktop=$(( $num_desktops - 1 ))
desktops=$(echo 4294967295; seq 0 $max_desktop)
for run in 1 2 3
do
# start and stop calculators
if (( $RANDOM % 5 == 0 ))
then
killall gnome-calculator 1>/dev/null 2>/dev/null
sleep 0.1
else
(gnome-calculator 1>/dev/null 2>/dev/null &)
fi
# change the current desktop to a random value
desktop=$(shuf -n 1 -e $(seq 0 $max_desktop))
xprop -root -f _NET_CURRENT_DESKTOP 32c -set _NET_CURRENT_DESKTOP $desktop
# move windows around
for win in $(wmctrl -l | awk '!/Terminal/ {if ($4 != "Desktop") print $1}')
do
desktop=$(shuf -n 1 -e $desktops)
xprop -id $win -f _NET_WM_DESKTOP 32c -set _NET_WM_DESKTOP $desktop
done
sleep 0.1
done
sleep 0.1
done

View File

@@ -168,3 +168,4 @@ src/tint2conf/po/fr.po
src/tint2conf/po/hr.po
src/tint2conf/po/pl.po
src/tint2conf/po/sr.po
README.md