Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
107bfc85a3 | ||
|
|
85536065bc | ||
|
|
efd28f38d9 | ||
|
|
4b26a5ef8a | ||
|
|
b196bb1c00 | ||
|
|
402713d4b1 | ||
|
|
f0de284dd9 | ||
|
|
9d9d6aa302 |
@@ -1,4 +1,10 @@
|
||||
2016-01-25 0.12.5
|
||||
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)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# New stable release: 0.12.6
|
||||
Changes: https://gitlab.com/o9000/tint2/blob/0.12.6/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.6
|
||||
git checkout 0.12.7
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
12
src/server.c
12
src/server.c
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -108,13 +108,17 @@ gboolean window_is_hidden(Window win)
|
||||
|
||||
int get_window_desktop(Window win)
|
||||
{
|
||||
if (!server.viewports)
|
||||
return MAX(0, MIN(server.num_desktops - 1, 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
44
test/workspaces-stress.sh
Executable 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user