Compare commits

..

56 Commits

Author SHA1 Message Date
o9000
0f1dac50f1 Updated readme for 0.12-rc6 2015-06-13 10:08:43 +00:00
o9000
eb0346e02a Updated changelog 2015-06-13 10:07:23 +00:00
o9000
cae621918e systray: Do not turn off compositing for missing window errors 2015-06-13 11:32:22 +02:00
o9000
f28983e5a7 systray: Use different X connection for XGetImage (fixes crash on ATI cards) 2015-06-12 21:28:58 +02:00
o9000
b35cdb70df systray: Detect window resizez during composited rendering to prevent crashes 2015-06-12 21:13:20 +02:00
o9000
80361a121e Better error handling in systray rendering and fall back to non-composited rendering in case of errors 2015-06-12 12:24:19 +02:00
o9000
b4ff007e42 systray: reorder some operations to make sure we resize correctly 2015-06-12 11:57:05 +02:00
o9000
ae379d865c systray: fix bad embed 2015-06-12 11:40:22 +02:00
o9000
0a3876dc8c systray: prevent race in error detection 2015-06-12 11:39:36 +02:00
o9000
e2d95acfa1 Add missing files for freespace 2015-06-12 10:41:51 +02:00
o9000
5ac1a6a653 systray: resize icon when reparenting 2015-06-12 09:44:13 +02:00
o9000
481c409617 Fix bad interaction between freespace and systray 2015-06-12 02:09:43 +02:00
o9000
e8869b4d87 systray: Minor change in error logging 2015-06-12 01:43:39 +02:00
o9000
b1b95e086d Free space item 2015-06-12 01:42:00 +02:00
o9000
df1f2d4e4b Merge taskbar_alignment from branch 2015-06-12 00:52:10 +02:00
o9000
18b0ef2d1b Updated changelog 2015-06-07 11:21:11 +00:00
o9000
860c100a04 launcher: sort desktop files by name in launcher_apps_dir 2015-06-07 13:03:49 +02:00
o9000
9040764cf1 systray: Cleaned up the code a bit 2015-06-07 12:58:29 +02:00
o9000
d8d4bc76cd systray: Delay reparenting to the first render to prevent graphical corruptions 2015-06-07 12:45:48 +02:00
o9000
fbcfa54061 Disable systray composited rendering if disable_transparency = 1 2015-06-07 11:44:43 +02:00
o9000
b235f77f39 systray: Prevent triggering concurrent updates for the same icon 2015-05-30 14:22:40 +02:00
o9000
1b4b0a8d8d systray: Delay icon rendering only when throttling is necessary 2015-05-30 13:41:29 +02:00
o9000
7ea0dc241c systray: Sort icons in the correct order when an icon is empty and order is right2left 2015-05-30 13:33:44 +02:00
o9000
39e67df44d Revert "systray: Sort icons in the correct order when an icon is empty and order is right2left"
This reverts commit cb17e5a662.
2015-05-30 13:23:20 +02:00
o9000
cb17e5a662 systray: Sort icons in the correct order when an icon is empty and order is right2left 2015-05-30 13:03:42 +02:00
o9000
ea67f24051 Merge branch 'master' into 'master'
Polish translations for desktop files

Polish translations for .desktop files updated.

BTW. Big thanks for bringing new life to this awesome project :)

See merge request !2
2015-05-28 19:52:06 +00:00
7e2e1d5adf Polish translations for desktop files 2015-05-28 21:48:06 +02:00
o9000
c49d231875 Merge branch 'master' into 'master'
Polish translation

See merge request !1
2015-05-28 19:35:07 +00:00
d839d80c2e Polish translation 2015-05-28 21:02:31 +02:00
o9000
cc826cbcb5 Updated readme 2015-05-23 09:45:14 +00:00
o9000
f59702054d Updated changelog 2015-05-23 09:43:57 +00:00
o9000
06dfcf70be Updated localization file with new strings 2015-05-21 12:44:41 +02:00
o9000
44785a49da Updated tint2conf for localization 2015-05-21 12:34:52 +02:00
o9000
e20448d6b5 Annotate strings for translation 2015-05-21 10:57:50 +02:00
o9000
6014b51850 Better error handling in systray icon rendering 2015-05-20 15:42:27 +02:00
o9000
5acda6a0c0 Silence warning 2015-05-15 08:39:12 +02:00
o9000
f4f028a773 Updated changelog 2015-05-15 06:11:17 +00:00
o9000
66c98bc820 Fix bad include 2015-05-14 19:19:42 +00:00
o9000
de1d255088 Updated readme 2015-05-14 10:43:38 +00:00
o9000
b381ad2905 Updated changelog 2015-05-14 10:41:41 +00:00
o9000
a4894b8257 Workaround for empty systray icon in Google Chrome (misbehaving) - fix resize 2015-05-13 22:58:58 +02:00
o9000
b7dbb919a9 Merge branch 'title-race' 2015-05-13 22:41:52 +02:00
o9000
a08491c122 Workaround for empty systray icon in Google Chrome (misbehaving) - fix sorting 2015-05-13 21:17:02 +02:00
o9000
8795f50bb8 Workaround for empty systray icon in Google Chrome (misbehaving) - fix sorting 2015-05-13 21:02:40 +02:00
o9000
3ab42f9b72 Workaround for empty systray icon in Google Chrome (misbehaving) 2015-05-11 21:19:36 +02:00
o9000
7bce19452e Reduce memory footprint 2015-05-10 12:43:58 +02:00
o9000
1ff028e99f Fix some battery issues when unplugging/replugging 2015-05-08 23:35:44 +02:00
o9000
5450dcca0b Attempt to fix new window title race in fvwm 2015-05-08 21:49:26 +02:00
o9000
d2ee0a481f Adding missing icons 2015-05-05 11:18:55 +02:00
o9000
1d95e01882 tint2conf: Updated tooltips 2015-05-03 22:30:10 +02:00
o9000
ebc356d1c7 Updated tint2rc file header with link to docs 2015-05-03 20:01:58 +00:00
o9000
54708a6167 Updated desktop file 2015-05-03 17:21:43 +00:00
o9000
60f01f7fff Updated icons and desktop files 2015-05-03 19:17:24 +02:00
o9000
9f8860f003 Updated tint2.desktop 2015-05-03 16:34:12 +00:00
o9000
be19d1eeef Add tint2.desktop 2015-05-03 16:31:07 +00:00
o9000
1d02b8588b Fix icon loading with wrong image extension 2015-05-03 16:22:23 +02:00
40 changed files with 6965 additions and 851 deletions

View File

@@ -5,6 +5,7 @@ tint2 is developped by :
- Euan Freeman <euan04@gmail.com> (tintwizard)
- Christian Ruppert <Spooky85@gmail.com> (autotools build system)
- Ovidiu M <mrovi9000 at gmail.com> : launcher, bug fixes
- Mishael A Sibiryakov (death@junki.org) : freespace
tint2 is based on ttm source code (http://code.google.com/p/ttm/)
- 2007-2008 Pål Staurland <staura@gmail.com>

View File

@@ -42,6 +42,7 @@ include_directories( ${PROJECT_BINARY_DIR}
src/launcher
src/tooltip
src/util
src/freespace
${X11_INCLUDE_DIRS}
${PANGOCAIRO_INCLUDE_DIRS}
${PANGO_INCLUDE_DIRS}
@@ -67,7 +68,8 @@ set( SOURCES src/config.c
src/taskbar/taskbar.c
src/taskbar/taskbarname.c
src/tooltip/tooltip.c
src/util/area.c
src/freespace/freespace.c
src/util/area.c
src/util/common.c
src/util/strnatcmp.c
src/util/timer.c
@@ -145,6 +147,9 @@ set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -fno-strict-aliasin
set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread -fno-strict-aliasing ${ASAN_L_FLAGS}" )
install( TARGETS tint2 DESTINATION bin )
install( FILES tint2.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps )
install( FILES tint2.desktop DESTINATION ${DATADIR}/applications )
install( CODE "execute_process(COMMAND gtk-update-icon-cache -f -t ${DATADIR}/icons/hicolor WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})" )
install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
install( FILES default_icon.png DESTINATION ${DATADIR}/tint2 )
install( FILES AUTHORS ChangeLog README.md DESTINATION ${DOCDIR} )
@@ -152,4 +157,4 @@ install( FILES doc/tint2.1 DESTINATION ${MANDIR}/man1 )
if( ENABLE_EXAMPLES )
file( GLOB SAMPLEFILES sample/*.tint2rc )
install( FILES ${SAMPLEFILES} DESTINATION ${DOCDIR}/examples )
endif( ENABLE_EXAMPLES )
endif( ENABLE_EXAMPLES )

View File

@@ -1,4 +1,4 @@
2015-05-03 master
2015-06-12 master
- Note: the changes listed here are based on the previous release tint2 0.11, however some distributions (e.g. Debian)
offered packages using newer commits and/or patches; thus from the user's perspective some of these features are
already present. They are marked with '(already released by distros)'.
@@ -11,6 +11,10 @@
- Experimental, testing/feedback needed
- Icons (system tray, task buttons, launcher):
- Changed rendering method to fix icon corruptions (please report any problems)
- System tray:
- Icon rendering is faster
- Several kinds of graphical corruptions have been fixed
- Added workaround for misbehaving applications leaving empty tray icons
- Many bugfixes
- New config options (see https://gitlab.com/o9000/tint2/wikis/Configure):
- Panel:
@@ -23,6 +27,7 @@
- taskbar_hide_inactive_tasks
- taskbar_sort_order
- taskbar_name (already released by distros)
- task_align (already released by distros)
- Launcher:
- launcher* (already released by distros)
- launcher_apps_dir (previously patched in by some distros)
@@ -30,6 +35,7 @@
- launcher_icon_theme_override
- System tray:
- systray_monitor
- Freespace (already released by distros)
- Config options with changed behavior:
- Panel:
- panel_dock: previously, 'panel_dock = 1' was actually not placing the panel into the dock. This option now
@@ -44,8 +50,37 @@
Reason for change: legibility improved for transparent panels.
- Launcher:
- launcher_item_app: now it expands leading ~ to the path to the user's home directory.
- Known issues:
- tint2 might close unexpectedly and/or cause X to freeze on certain ATI graphics cards.
Workaround: set 'disable_transparency = 1' in the config.
Reference: https://gitlab.com/o9000/tint2/issues/497
- Project hosting:
- Migrated from https://code.google.com/p/tint2 to https://gitlab.com/o9000/tint2 and switched from svn to git
- Bugfixes:
- task switching from tint2 using the mouse wheel (mouse_scroll_up = prev_task and mouse_scroll_down = next_task) with
multiple desktops and taskbar_mode = multi_desktop when hovering over the first/last window in the taskbar was broken;
also when a window is set to appear on all desktops;
- the launcher was not loading an icon if the icon theme was not providing it in a size close to the value of launcher_icon_size;
- the launcher was not loading an icon if the extension was incorrect (e.g. file contents were PNG but the file name
had extension SVG);
- some launcher icons (PNG files saved with an indexed colormap and alpha mask) were sometimes rendered with white instead of
transparency;
- icons looked washed out when the panel was very transparent;
- the panel border was rendered in the background of every systray icon; sometimes systray icons were rendered in the
background of other icons;
- a crash caused by a change that prevents Google Chrome (and possibly other misbehaving applications) from leaving a large
number of empty icons in the system tray;
- a crash caused by the system tray code on computers with ATI cards;
- the panel window had a shadow;
- some ATI drivers return an extra monitor with size zero which should be ignored when using panel_monitor = all;
- the battery applet was sometimes working incorrectly with certain laptop models (the battery applet stopped updating after
suspend with the battery unplugged);
- crashed caused by incomplete or malformed config files;
- with the fvwm window manager, the window title was sometimes not displayed correctly if it changed right after an
application was started;
- seconds were not updating in the clock;
- tint2 hang triggered when an application started from the launcher was closed and startup notifications were enabled;
- the code that loads SVG icons was using a lot of memory.
2010-06-26
- unhide tint2 panel when dragging something

View File

@@ -1,14 +1,14 @@
### New unstable release: 0.12-rc3
### New unstable release: 0.12-rc6
Changes: https://gitlab.com/o9000/tint2/blob/master/ChangeLog
Documentation: https://gitlab.com/o9000/tint2/wikis/home
Try it out with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/Install#dependencies)):
```
mkdir tint2-0.12-rc3
cd tint2-0.12-rc3
wget 'https://gitlab.com/o9000/tint2/repository/archive.tar.gz?ref=v0.12-rc3' --output-document tint2-0.12-rc3.tar.gz
tar -xzf tint2-0.12-rc3.tar.gz
mkdir tint2-0.12-rc6
cd tint2-0.12-rc6
wget 'https://gitlab.com/o9000/tint2/repository/archive.tar.gz?ref=v0.12-rc6' --output-document tint2-0.12-rc6.tar.gz
tar -xzf tint2-0.12-rc6.tar.gz
cd tint2.git
mkdir build
cd build
@@ -49,7 +49,7 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
* [Configure](https://gitlab.com/o9000/tint2/wikis/Configure)
* [Add applet not supported by tint2](https://gitlab.com/o9000/tint2/wikis/ThirdPartyApplets)
* [Other frequently asked questions](https://gitlab.com/o9000/tint2/wikis/FAQ)
* [Debug](https://gitlab.com/o9000/tint2/wikis/Debug)
* [Debug](https://gitlab.com/o9000/tint2/wikis/Debug)
### How can I help out?

View File

@@ -76,6 +76,9 @@ void update_battery_tick(void* arg)
int16_t old_hours = battery_state.time.hours;
int8_t old_minutes = battery_state.time.minutes;
if (!battery_found) {
init_battery();
}
if (update_battery() != 0) {
// Reconfigure
init_battery();
@@ -103,15 +106,23 @@ void update_battery_tick(void* arg)
int i;
for (i = 0; i < nb_panel; i++) {
if (!battery_found && panel1[i].battery.area.on_screen == 1) {
hide(&panel1[i].battery.area);
panel_refresh = 1;
} else if (battery_state.percentage >= percentage_hide && panel1[i].battery.area.on_screen == 1) {
hide(&panel1[i].battery.area);
panel_refresh = 1;
} else if (battery_state.percentage < percentage_hide && panel1[i].battery.area.on_screen == 0) {
show(&panel1[i].battery.area);
panel_refresh = 1;
if (!battery_found) {
if (panel1[i].battery.area.on_screen == 1) {
hide(&panel1[i].battery.area);
panel_refresh = 1;
}
} else {
if (battery_state.percentage >= percentage_hide) {
if (panel1[i].battery.area.on_screen == 1) {
hide(&panel1[i].battery.area);
panel_refresh = 1;
}
} else {
if (panel1[i].battery.area.on_screen == 0) {
show(&panel1[i].battery.area);
panel_refresh = 1;
}
}
}
if (panel1[i].battery.area.on_screen == 1) {
panel1[i].battery.area.resize = 1;
@@ -279,7 +290,7 @@ void init_battery()
#endif
if (!battery_timeout)
battery_timeout = add_timeout(10, 10000, update_battery_tick, 0, &battery_timeout);
battery_timeout = add_timeout(10, 30000, update_battery_tick, 0, &battery_timeout);
}
@@ -474,7 +485,7 @@ int update_battery() {
battery_state.time.seconds = seconds;
if (energy_full > 0)
new_percentage = ((energy_now <= energy_full ? energy_now : energy_full) * 100) / energy_full;
new_percentage = 0.5 + ((energy_now <= energy_full ? energy_now : energy_full) * 100.0) / energy_full;
battery_state.percentage = new_percentage;

View File

@@ -41,6 +41,7 @@
#include "common.h"
#include "server.h"
#include "strnatcmp.h"
#include "panel.h"
#include "task.h"
#include "taskbar.h"
@@ -153,23 +154,48 @@ int config_get_monitor(char* monitor)
return -1;
}
static gint compare_strings(gconstpointer a, gconstpointer b)
{
return strnatcasecmp((const char*)a, (const char*)b);
}
void load_launcher_app_dir(const char *path)
{
GDir *d = g_dir_open(path, 0, NULL);
GList *subdirs = NULL;
GList *files = NULL;
GDir *d = g_dir_open(path, 0, NULL);
if (d) {
const gchar *name;
while ((name = g_dir_read_name(d))) {
gchar *file = g_build_filename(path, name, NULL);
if (!g_file_test(file, G_FILE_TEST_IS_DIR) &&
g_str_has_suffix(file, ".desktop")) {
panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, strdup(file));
if (!g_file_test(file, G_FILE_TEST_IS_DIR) && g_str_has_suffix(file, ".desktop")) {
files = g_list_append(files, file);
} else if (g_file_test(file, G_FILE_TEST_IS_DIR)) {
load_launcher_app_dir(file);
}
g_free(file);
subdirs = g_list_append(subdirs, file);
} else {
g_free(file);
}
}
g_dir_close(d);
}
subdirs = g_list_sort(subdirs, compare_strings);
GList *l;
for (l = subdirs; l; l = g_list_next(l)) {
gchar *dir = (gchar *)l->data;
load_launcher_app_dir(dir);
g_free(dir);
}
g_list_free(subdirs);
files = g_list_sort(files, compare_strings);
for (l = files; l; l = g_list_next(l)) {
gchar *file = (gchar *)l->data;
panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, strdup(file));
g_free(file);
}
g_list_free(files);
}
void add_entry (char *key, char *value)
@@ -518,6 +544,15 @@ void add_entry (char *key, char *value)
taskbar_sort_method = TASKBAR_NOSORT;
}
}
else if (strcmp (key, "task_align") == 0) {
if (strcmp(value, "center") == 0) {
taskbar_alignment = ALIGN_CENTER;
} else if (strcmp(value, "right") == 0) {
taskbar_alignment = ALIGN_RIGHT;
} else {
taskbar_alignment = ALIGN_LEFT;
}
}
/* Task */
else if (strcmp (key, "task_text") == 0)
@@ -613,13 +648,13 @@ void add_entry (char *key, char *value)
}
else if (strcmp(key, "systray_sort") == 0) {
if (strcmp(value, "descending") == 0)
systray.sort = -1;
systray.sort = SYSTRAY_SORT_DESCENDING;
else if (strcmp(value, "ascending") == 0)
systray.sort = 1;
systray.sort = SYSTRAY_SORT_ASCENDING;
else if (strcmp(value, "left2right") == 0)
systray.sort = 2;
systray.sort = SYSTRAY_SORT_LEFT2RIGHT;
else if (strcmp(value, "right2left") == 0)
systray.sort = 3;
systray.sort = SYSTRAY_SORT_RIGHT2LEFT;
}
else if (strcmp(key, "systray_icon_size") == 0) {
systray_max_icon_size = atoi(value);

93
src/freespace/freespace.c Normal file
View File

@@ -0,0 +1,93 @@
/**************************************************************************
*
* Tint2 : freespace
*
* Copyright (C) 2011 Mishael A Sibiryakov (death@junki.org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**************************************************************************/
#include <string.h>
#include <stdio.h>
#include <cairo.h>
#include <cairo-xlib.h>
#include <pango/pangocairo.h>
#include <stdlib.h>
#include "window.h"
#include "server.h"
#include "panel.h"
#include "freespace.h"
#include "common.h"
void init_freespace_panel(void *p)
{
Panel *panel = (Panel*)p;
FreeSpace *freespace = &panel->freespace;
if (freespace->area.bg == 0)
freespace->area.bg = &g_array_index(backgrounds, Background, 0);
freespace->area.parent = p;
freespace->area.panel = p;
freespace->area.size_mode = SIZE_BY_CONTENT;
freespace->area.resize = 1;
freespace->area.on_screen = 1;
freespace->area._resize = resize_freespace;
}
int freespace_get_max_size(Panel *p) {
// Get space used by every element except the freespace
GList *walk;
int size = 0;
for (walk = p->area.list; walk; walk = g_list_next(walk)) {
Area *a = (Area *)walk->data;
if (a->_resize == resize_freespace || !a->on_screen)
continue;
if (panel_horizontal)
size += a->width + (a->bg->border.width * 2) + p->area.paddingx;
else
size += a->height + (a->bg->border.width * 2) + p->area.paddingy;
}
if (panel_horizontal)
size = p->area.width - size - (p->area.bg->border.width * 2) - p->area.paddingxlr;
else
size = p->area.height - size - (p->area.bg->border.width * 2) - p->area.paddingxlr;
return size;
}
int resize_freespace(void *obj) {
FreeSpace *freespace = (FreeSpace*)obj;
Panel *panel = (Panel*)freespace->area.panel;
if (!freespace->area.on_screen)
return 0;
int old_size = panel_horizontal ? freespace->area.width : freespace->area.height;
int size = freespace_get_max_size(panel);
if (old_size == size)
return 0;
if (panel_horizontal) {
freespace->area.width = size;
} else {
freespace->area.height = size;
}
freespace->area.redraw = 1;
panel_refresh = 1;
return 1;
}

20
src/freespace/freespace.h Normal file
View File

@@ -0,0 +1,20 @@
/**************************************************************************
* Copyright (C) 2011 Mishael A Sibiryakov (death@junki.org)
**************************************************************************/
#ifndef FREESPACE_H
#define FREESPACE_H
#include "common.h"
#include "area.h"
typedef struct FreeSpace {
Area area;
} FreeSpace;
void cleanup_freespace();
void init_freespace_panel(void *panel);
int resize_freespace(void *obj);
#endif

View File

@@ -536,6 +536,9 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
char *next_larger = NULL;
GSList *next_larger_theme = NULL;
int file_name_size = 4096;
char *file_name = calloc(file_name_size, 1);
for (theme = themes; theme; theme = g_slist_next(theme)) {
((IconTheme*)theme->data)->list_directories = g_slist_sort_with_data(((IconTheme*)theme->data)->list_directories,
compare_theme_directories,
@@ -560,8 +563,13 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
char *theme_name = ((IconTheme*)theme->data)->name;
char *dir_name = ((IconThemeDir*)dir->data)->name;
char *extension = (char*) ext->data;
char *file_name = calloc(strlen(base_name) + strlen(theme_name) +
strlen(dir_name) + strlen(icon_name) + strlen(extension) + 100, 1);
if (strlen(base_name) + strlen(theme_name) +
strlen(dir_name) + strlen(icon_name) + strlen(extension) + 100 > file_name_size) {
file_name_size = strlen(base_name) + strlen(theme_name) +
strlen(dir_name) + strlen(icon_name) + strlen(extension) + 100;
file_name = realloc(file_name, file_name_size);
}
file_name[0] = 0;
// filename = directory/$(themename)/subdirectory/iconname.extension
sprintf(file_name, "%s/%s/%s/%s%s", base_name, theme_name, dir_name, icon_name, extension);
if (DEBUG_ICON_SEARCH)
@@ -596,11 +604,12 @@ char *get_icon_path_helper(GSList *themes, const char *icon_name, int size)
printf("next_larger = %s; next_larger_size = %d\n", next_larger, next_larger_size);
}
}
free(file_name);
}
}
}
}
free(file_name);
file_name = NULL;
if (next_larger) {
g_slist_free(extensions);
free(best_file_name);

View File

@@ -31,6 +31,8 @@
#include <glib.h>
#include <glib/gstdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <sys/types.h>
#include <sys/wait.h>
#ifdef HAVE_RSVG
#include <librsvg/rsvg.h>
@@ -150,8 +152,7 @@ void cleanup_launcher_theme(Launcher *launcher)
for (l = launcher->list_icons; l ; l = l->next) {
LauncherIcon *launcherIcon = (LauncherIcon*)l->data;
if (launcherIcon) {
free_icon(launcherIcon->icon_scaled);
free_icon(launcherIcon->icon_original);
free_icon(launcherIcon->image);
free(launcherIcon->icon_name);
free(launcherIcon->icon_path);
free(launcherIcon->cmd);
@@ -186,7 +187,7 @@ int resize_launcher(void *obj)
// Resize icons if necessary
for (l = launcher->list_icons; l ; l = l->next) {
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
if (launcherIcon->icon_size != icon_size || !launcherIcon->icon_original) {
if (launcherIcon->icon_size != icon_size || !launcherIcon->image) {
launcherIcon->icon_size = icon_size;
launcherIcon->area.width = launcherIcon->icon_size;
launcherIcon->area.height = launcherIcon->icon_size;
@@ -195,68 +196,69 @@ int resize_launcher(void *obj)
char *new_icon_path = get_icon_path(launcher->list_themes, launcherIcon->icon_name, launcherIcon->icon_size);
if (!new_icon_path) {
// Draw a blank icon
free_icon(launcherIcon->icon_original);
launcherIcon->icon_original = NULL;
free_icon(launcherIcon->icon_scaled);
launcherIcon->icon_scaled = NULL;
free_icon(launcherIcon->image);
launcherIcon->image = NULL;
continue;
}
if (launcherIcon->icon_path && strcmp(new_icon_path, launcherIcon->icon_path) == 0) {
// If it's the same file just rescale
free_icon(launcherIcon->icon_scaled);
launcherIcon->icon_scaled = scale_icon(launcherIcon->icon_original, icon_size);
free(new_icon_path);
fprintf(stderr, "launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path);
} else {
// Free the old files
free_icon(launcherIcon->icon_original);
free_icon(launcherIcon->icon_scaled);
launcherIcon->icon_original = launcherIcon->icon_scaled = NULL;
// Load the new file and scale
// Free the old files
free_icon(launcherIcon->image);
launcherIcon->image = NULL;
// Load the new file and scale
launcherIcon->image = imlib_load_image_immediately(new_icon_path);
#ifdef HAVE_RSVG
if (g_str_has_suffix(new_icon_path, ".svg")) {
if (!launcherIcon->image && g_str_has_suffix(new_icon_path, ".svg")) {
char suffix[128];
sprintf(suffix, "tmpicon-%d.png", getpid());
// We fork here because librsvg allocates memory like crazy
pid_t pid = fork();
if (pid == 0) {
// Child
GError* err = NULL;
RsvgHandle* svg = rsvg_handle_new_from_file(new_icon_path, &err);
if (err != NULL) {
fprintf(stderr, "Could not load svg image!: %s", err->message);
g_error_free(err);
launcherIcon->icon_original = NULL;
launcherIcon->image = NULL;
} else {
char suffix[128];
sprintf(suffix, "tmpicon-%d.png", getpid());
gchar *name = g_build_filename(g_get_user_config_dir(), "tint2", suffix, NULL);
GdkPixbuf *pixbuf = rsvg_handle_get_pixbuf(svg);
gdk_pixbuf_save(pixbuf, name, "png", NULL, NULL);
launcherIcon->icon_original = imlib_load_image_immediately_without_cache(name);
g_remove(name);
g_free(name);
g_object_unref(G_OBJECT(pixbuf));
g_object_unref(G_OBJECT(svg));
}
} else
#endif
{
launcherIcon->icon_original = imlib_load_image_immediately(new_icon_path);
}
// On loading error, fallback to default
if (!launcherIcon->icon_original) {
free(new_icon_path);
new_icon_path = get_icon_path(launcher->list_themes, DEFAULT_ICON, launcherIcon->icon_size);
if (new_icon_path)
launcherIcon->icon_original = imlib_load_image_immediately(new_icon_path);
}
if (!launcherIcon->icon_original) {
// Loading default icon failed, draw a blank icon
free(new_icon_path);
exit(0);
} else {
// Loaded icon successfully
launcherIcon->icon_scaled = scale_icon(launcherIcon->icon_original, launcherIcon->icon_size);
free(launcherIcon->icon_path);
launcherIcon->icon_path = new_icon_path;
fprintf(stderr, "launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path);
// Parent
waitpid(pid, 0, 0);
gchar *name = g_build_filename(g_get_user_config_dir(), "tint2", suffix, NULL);
launcherIcon->image = imlib_load_image_immediately_without_cache(name);
g_remove(name);
g_free(name);
}
} else
#endif
{
launcherIcon->image = imlib_load_image_immediately(new_icon_path);
}
// On loading error, fallback to default
if (!launcherIcon->image) {
free(new_icon_path);
new_icon_path = get_icon_path(launcher->list_themes, DEFAULT_ICON, launcherIcon->icon_size);
if (new_icon_path)
launcherIcon->image = imlib_load_image_immediately(new_icon_path);
}
if (!launcherIcon->image) {
// Loading default icon failed, draw a blank icon
free(new_icon_path);
} else {
// Loaded icon successfully
Imlib_Image original = launcherIcon->image;
launcherIcon->image = scale_icon(launcherIcon->image, launcherIcon->icon_size);
free_icon(original);
free(launcherIcon->icon_path);
launcherIcon->icon_path = new_icon_path;
fprintf(stderr, "launcher.c %d: Using icon %s\n", __LINE__, launcherIcon->icon_path);
}
}
}
@@ -330,6 +332,7 @@ int resize_launcher(void *obj)
}
}
}
return 1;
}
@@ -354,9 +357,8 @@ void draw_launcher_icon(void *obj, cairo_t *c)
{
LauncherIcon *launcherIcon = (LauncherIcon*)obj;
Imlib_Image icon_scaled = launcherIcon->icon_scaled;
// Render
imlib_context_set_image(icon_scaled);
imlib_context_set_image(launcherIcon->image);
if (server.real_transparency) {
render_image(launcherIcon->area.pix, 0, 0);
} else {
@@ -402,7 +404,7 @@ void launcher_action(LauncherIcon *icon, XEvent* evt)
char *cmd = calloc(strlen(icon->cmd) + 10, 1);
sprintf(cmd, "(%s&)", icon->cmd);
#if HAVE_SN
SnLauncherContext* ctx;
SnLauncherContext* ctx = 0;
Time time;
if (startup_notifications) {
ctx = sn_launcher_context_new(server.sn_dsp, server.screen);

View File

@@ -23,8 +23,7 @@ typedef struct Launcher {
typedef struct LauncherIcon {
// always start with area
Area area;
Imlib_Image icon_scaled;
Imlib_Image icon_original;
Imlib_Image image;
char *cmd;
char *icon_name;
char *icon_path;

View File

@@ -204,6 +204,8 @@ void init_panel()
}
if (panel_items_order[k] == 'C')
init_clock_panel(p);
if (panel_items_order[k] == 'F' && !strstr(panel_items_order, "T"))
init_freespace_panel(p);
}
set_panel_items_order(p);
@@ -322,13 +324,13 @@ void init_panel_size_and_position(Panel *panel)
int resize_panel(void *obj)
{
resize_by_layout(obj, 0);
Panel *panel = (Panel*)obj;
resize_by_layout(panel, 0);
//printf("resize_panel\n");
if (panel_mode != MULTI_DESKTOP && taskbar_enabled) {
// propagate width/height on hidden taskbar
int i, width, height;
Panel *panel = (Panel*)obj;
width = panel->taskbar[server.desktop].area.width;
height = panel->taskbar[server.desktop].area.height;
for (i=0 ; i < panel->nb_desktop ; i++) {
@@ -339,7 +341,6 @@ int resize_panel(void *obj)
}
if (panel_mode == MULTI_DESKTOP && taskbar_enabled && taskbar_distribute_size) {
// Distribute the available space between taskbars
Panel *panel = (Panel*)obj;
// Compute the total available size, and the total size requested by the taskbars
int total_size = 0;
@@ -354,7 +355,7 @@ int resize_panel(void *obj)
}
Taskbar *taskbar = &panel->taskbar[i];
GSList *l;
GList *l;
for (l = taskbar->area.list; l; l = l->next) {
Area *child = l->data;
if (!child->on_screen)
@@ -389,7 +390,7 @@ int resize_panel(void *obj)
int requested_size = (2 * taskbar->area.bg->border.width) + (2 * taskbar->area.paddingxlr);
int items = 0;
GSList *l = taskbar->area.list;
GList *l = taskbar->area.list;
if (taskbarname_enabled)
l = l->next;
for (; l; l = l->next) {
@@ -418,6 +419,8 @@ int resize_panel(void *obj)
}
}
}
if (panel->freespace.area.on_screen)
resize_freespace(&panel->freespace);
return 0;
}
@@ -482,29 +485,31 @@ void set_panel_items_order(Panel *p)
int k, j;
if (p->area.list) {
g_slist_free(p->area.list);
g_list_free(p->area.list);
p->area.list = 0;
}
for (k=0 ; k < strlen(panel_items_order) ; k++) {
if (panel_items_order[k] == 'L') {
p->area.list = g_slist_append(p->area.list, &p->launcher);
p->area.list = g_list_append(p->area.list, &p->launcher);
p->launcher.area.resize = 1;
}
if (panel_items_order[k] == 'T') {
for (j=0 ; j < p->nb_desktop ; j++)
p->area.list = g_slist_append(p->area.list, &p->taskbar[j]);
p->area.list = g_list_append(p->area.list, &p->taskbar[j]);
}
#ifdef ENABLE_BATTERY
if (panel_items_order[k] == 'B')
p->area.list = g_slist_append(p->area.list, &p->battery);
p->area.list = g_list_append(p->area.list, &p->battery);
#endif
int i = p - panel1;
if (panel_items_order[k] == 'S' && systray_on_monitor(i, nb_panel)) {
p->area.list = g_slist_append(p->area.list, &systray);
p->area.list = g_list_append(p->area.list, &systray);
}
if (panel_items_order[k] == 'C')
p->area.list = g_slist_append(p->area.list, &p->clock);
p->area.list = g_list_append(p->area.list, &p->clock);
if (panel_items_order[k] == 'F')
p->area.list = g_list_append(p->area.list, &p->freespace);
}
init_rendering(&p->area, 0);
}
@@ -629,7 +634,7 @@ void set_panel_background(Panel *p)
}
// redraw panel's object
GSList *l0;
GList *l0;
Area *a;
for (l0 = p->area.list; l0 ; l0 = l0->next) {
a = l0->data;
@@ -695,7 +700,7 @@ Taskbar *click_taskbar (Panel *panel, int x, int y)
Task *click_task (Panel *panel, int x, int y)
{
GSList *l0;
GList *l0;
Taskbar *tskbar;
if ( (tskbar = click_taskbar(panel, x, y)) ) {
@@ -797,7 +802,7 @@ Area* click_area(Panel *panel, int x, int y)
Area* new_result = result;
do {
result = new_result;
GSList* it = result->list;
GList* it = result->list;
while (it) {
Area* a = it->data;
if (a->on_screen && x >= a->posx && x <= (a->posx + a->width)

View File

@@ -20,6 +20,7 @@
#include "taskbar.h"
#include "systraybar.h"
#include "launcher.h"
#include "freespace.h"
#ifdef ENABLE_BATTERY
#include "battery.h"
@@ -116,6 +117,8 @@ typedef struct {
Launcher launcher;
FreeSpace freespace;
// autohide
int is_hidden;
int hidden_width, hidden_height;

View File

@@ -98,6 +98,7 @@ void server_init_atoms ()
server.atom._NET_SYSTEM_TRAY_ORIENTATION = XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_ORIENTATION", False);
server.atom._XEMBED = XInternAtom(server.dsp, "_XEMBED", False);
server.atom._XEMBED_INFO = XInternAtom(server.dsp, "_XEMBED_INFO", False);
server.atom._NET_WM_PID = XInternAtom(server.dsp, "_NET_WM_PID", True);
// drag 'n' drop
server.atom.XdndAware = XInternAtom(server.dsp, "XdndAware", False);

View File

@@ -15,9 +15,8 @@
#ifdef HAVE_SN
#include <libsn/sn.h>
#include <glib.h>
#endif
#include <glib.h>
typedef struct Global_atom
{
@@ -74,6 +73,7 @@ typedef struct Global_atom
Atom _NET_SYSTEM_TRAY_ORIENTATION;
Atom _XEMBED;
Atom _XEMBED_INFO;
Atom _NET_WM_PID;
Atom _XSETTINGS_SCREEN;
Atom _XSETTINGS_SETTINGS;
Atom XdndAware;
@@ -154,4 +154,4 @@ void get_monitors();
void get_desktops();
int server_get_number_of_desktops();
#endif
#endif

View File

@@ -41,8 +41,6 @@ GSList *icons;
#define SYSTEM_TRAY_BEGIN_MESSAGE 1
#define SYSTEM_TRAY_CANCEL_MESSAGE 2
#define FORCE_COMPOSITED_RENDERING 1
// selection window
Window net_sel_win = None;
@@ -52,7 +50,8 @@ int refresh_systray;
int systray_enabled;
int systray_max_icon_size;
int systray_monitor;
int chrono;
int systray_composited;
// background pixmap if we render ourselves the icons
static Pixmap render_background;
@@ -61,8 +60,9 @@ void default_systray()
{
memset(&systray, 0, sizeof(Systraybar));
render_background = 0;
chrono = 0;
systray.alpha = 100;
systray.sort = 3;
systray.sort = SYSTRAY_SORT_LEFT2RIGHT;
systray.area._draw_foreground = draw_systray;
systray.area._on_change_layout = on_change_systray;
systray.area.size_mode = SIZE_BY_CONTENT;
@@ -85,16 +85,19 @@ void cleanup_systray()
void init_systray()
{
start_net();
if (!systray_enabled)
return;
if (!server.visual32 && (systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)) {
printf("No 32 bit visual for your X implementation. 'systray_asb = 100 0 0' will be forced\n");
systray_composited = !server.disable_transparency && server.visual32 && server.colormap32;
printf("Systray composited rendering %s\n", systray_composited ? "on" : "off");
if (!systray_composited) {
printf("systray_asb forced to 100 0 0\n");
systray.alpha = 100;
systray.brightness = systray.saturation = 0;
}
start_net();
}
@@ -108,12 +111,13 @@ void init_systray_panel(void *p)
GSList *l;
int count = 0;
for (l = systray.list_icons; l ; l = l->next) {
if (!((TrayWindow*)l->data)->hide)
count++;
if (((TrayWindow*)l->data)->hide)
continue;
count++;
}
if (count == 0)
hide(&systray.area);
else
else
show(&systray.area);
refresh_systray = 0;
}
@@ -121,8 +125,9 @@ void init_systray_panel(void *p)
void draw_systray(void *obj, cairo_t *c)
{
if (FORCE_COMPOSITED_RENDERING || server.real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
if (render_background) XFreePixmap(server.dsp, render_background);
if (systray_composited) {
if (render_background)
XFreePixmap(server.dsp, render_background);
render_background = XCreatePixmap(server.dsp, server.root_win, systray.area.width, systray.area.height, server.depth);
XCopyArea(server.dsp, systray.area.pix, render_background, server.gc, 0, 0, systray.area.width, systray.area.height, 0, 0);
}
@@ -146,8 +151,9 @@ int resize_systray(void *obj)
sysbar->icon_size = systray_max_icon_size;
count = 0;
for (l = systray.list_icons; l ; l = l->next) {
if (!((TrayWindow*)l->data)->hide)
count++;
if (((TrayWindow*)l->data)->hide)
continue;
count++;
}
//printf("count %d\n", count);
@@ -158,8 +164,7 @@ int resize_systray(void *obj)
sysbar->marging = height - (sysbar->icons_per_column-1)*(sysbar->icon_size+sysbar->area.paddingx) - sysbar->icon_size;
sysbar->icons_per_row = count / sysbar->icons_per_column + (count%sysbar->icons_per_column != 0);
systray.area.width = (2 * systray.area.bg->border.width) + (2 * systray.area.paddingxlr) + (sysbar->icon_size * sysbar->icons_per_row) + ((sysbar->icons_per_row-1) * systray.area.paddingx);
}
else {
} else {
int width = sysbar->area.width - 2*sysbar->area.bg->border.width - 2*sysbar->area.paddingy;
// here icons_per_row always higher than 0
sysbar->icons_per_row = (width+sysbar->area.paddingx) / (sysbar->icon_size+sysbar->area.paddingx);
@@ -184,44 +189,46 @@ void on_change_systray (void *obj)
if (panel_horizontal) {
posy = start;
posx = systray.area.posx + systray.area.bg->border.width + systray.area.paddingxlr;
}
else {
} else {
posx = start;
posy = systray.area.posy + systray.area.bg->border.width + systray.area.paddingxlr;
}
TrayWindow *traywin;
GSList *l;
for (i=1, l = systray.list_icons; l ; i++, l = l->next) {
for (i = 1, l = systray.list_icons; l ; i++, l = l->next) {
traywin = (TrayWindow*)l->data;
if (traywin->hide) continue;
if (traywin->hide)
continue;
traywin->y = posy;
traywin->x = posx;
//printf("systray %d : %d,%d\n", i, posx, posy);
// printf("systray %d %d : pos %d, %d\n", traywin->parent, traywin->win, posx, posy);
traywin->width = sysbar->icon_size;
traywin->height = sysbar->icon_size;
if (panel_horizontal) {
if (i % sysbar->icons_per_column)
if (i % sysbar->icons_per_column) {
posy += sysbar->icon_size + sysbar->area.paddingx;
else {
} else {
posy = start;
posx += (sysbar->icon_size + systray.area.paddingx);
}
}
else {
if (i % sysbar->icons_per_row)
} else {
if (i % sysbar->icons_per_row) {
posx += sysbar->icon_size + systray.area.paddingx;
else {
} else {
posx = start;
posy += (sysbar->icon_size + systray.area.paddingx);
}
}
// position and size the icon window
XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, sysbar->icon_size, sysbar->icon_size);
XResizeWindow(server.dsp, traywin->tray_id, sysbar->icon_size, sysbar->icon_size);
XMoveResizeWindow(server.dsp, traywin->parent, traywin->x, traywin->y, traywin->width, traywin->height);
if (traywin->reparented) {
XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height);
}
}
refresh_systray = 1;
}
@@ -235,10 +242,10 @@ void start_net()
if (!systray_enabled)
stop_net();
return;
}
else
} else {
if (!systray_enabled)
return;
}
Window win = XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN);
@@ -273,7 +280,7 @@ void start_net()
long orient = 0;
XChangeProperty(server.dsp, net_sel_win, server.atom._NET_SYSTEM_TRAY_ORIENTATION, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &orient, 1);
VisualID vid;
if (server.visual32 && (FORCE_COMPOSITED_RENDERING || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0))
if (systray_composited)
vid = XVisualIDFromVisual(server.visual32);
else
vid = XVisualIDFromVisual(server.visual);
@@ -323,10 +330,9 @@ void stop_net()
gboolean error;
int window_error_handler(Display *d, XErrorEvent *e)
{
d=d;e=e;
error = TRUE;
if (e->error_code != BadWindow) {
printf("error_handler %d\n", e->error_code);
printf("systray: error code %d\n", e->error_code);
}
return 0;
}
@@ -336,70 +342,201 @@ static gint compare_traywindows(gconstpointer a, gconstpointer b)
{
const TrayWindow * traywin_a = (TrayWindow*)a;
const TrayWindow * traywin_b = (TrayWindow*)b;
XTextProperty name_a, name_b;
if(XGetWMName(server.dsp, traywin_a->tray_id, &name_a) == 0) {
return -1;
if (traywin_a->empty && !traywin_b->empty)
return 1 * (systray.sort == SYSTRAY_SORT_RIGHT2LEFT ? -1 : 1);
if (!traywin_a->empty && traywin_b->empty)
return -1 * (systray.sort == SYSTRAY_SORT_RIGHT2LEFT ? -1 : 1);
if (systray.sort == SYSTRAY_SORT_ASCENDING ||
systray.sort == SYSTRAY_SORT_DESCENDING) {
XTextProperty name_a, name_b;
if (XGetWMName(server.dsp, traywin_a->win, &name_a) == 0) {
return -1;
} else if (XGetWMName(server.dsp, traywin_b->win, &name_b) == 0) {
XFree(name_a.value);
return 1;
} else {
gint retval = g_ascii_strncasecmp((char*)name_a.value, (char*)name_b.value, -1) *
(systray.sort == SYSTRAY_SORT_ASCENDING ? 1 : -1);
XFree(name_a.value);
XFree(name_b.value);
return retval;
}
}
else if(XGetWMName(server.dsp, traywin_b->tray_id, &name_b) == 0) {
XFree(name_a.value);
return 1;
}
else {
gint retval = g_ascii_strncasecmp((char*)name_a.value, (char*)name_b.value, -1) * systray.sort;
XFree(name_a.value);
XFree(name_b.value);
return retval;
if (systray.sort == SYSTRAY_SORT_LEFT2RIGHT ||
systray.sort == SYSTRAY_SORT_RIGHT2LEFT) {
return (traywin_a->chrono - traywin_b->chrono) *
(systray.sort == SYSTRAY_SORT_LEFT2RIGHT ? 1 : -1);
}
return 0;
}
gboolean add_icon(Window id)
gboolean add_icon(Window win)
{
TrayWindow *traywin;
XErrorHandler old;
Panel *panel = systray.area.panel;
int hide = 0;
GSList *l;
for (l = systray.list_icons; l; l = l->next) {
if (((TrayWindow*)l->data)->tray_id == id)
return FALSE;
// Get the process ID of the application that created the window
int pid = 0;
{
Atom actual_type;
int actual_format;
unsigned long nitems;
unsigned long bytes_after;
unsigned char *prop = 0;
int ret = XGetWindowProperty(server.dsp, win, server.atom._NET_WM_PID, 0, 1024, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop);
if (ret == Success && prop) {
pid = prop[1] * 256;
pid += prop[0];
}
}
error = FALSE;
// Check if the application leaves behind empty icons
GSList *l;
int num_empty_same_pid = 0;
for (l = systray.list_icons; l; l = l->next) {
if (((TrayWindow*)l->data)->win == win)
return FALSE;
if (pid && ((TrayWindow*)l->data)->pid == pid && ((TrayWindow*)l->data)->empty)
num_empty_same_pid++;
}
// Remove empty icons if the application leaves behind more than 1
const int max_num_empty_same_pid = 0;
if (num_empty_same_pid > max_num_empty_same_pid) {
for (l = systray.list_icons; l; l = l->next) {
if (pid && ((TrayWindow*)l->data)->pid == pid && ((TrayWindow*)l->data)->empty) {
num_empty_same_pid++;
fprintf(stderr, "Removing tray icon %lu from misbehaving application with pid=%d\n", ((TrayWindow*)l->data)->win, pid);
remove_icon((TrayWindow*)l->data);
break;
}
}
}
//printf("add_icon: %d, pid %d, %d\n", win, pid, num_empty_same_pid);
// Create the parent window that will embed the icon
XWindowAttributes attr;
if ( XGetWindowAttributes(server.dsp, id, &attr) == False ) return FALSE;
if (XGetWindowAttributes(server.dsp, win, &attr) == False)
return FALSE;
unsigned long mask = 0;
XSetWindowAttributes set_attr;
Visual* visual = server.visual;
//printf("icon with depth: %d, width %d, height %d\n", attr.depth, attr.width, attr.height);
//printf("icon with depth: %d\n", attr.depth);
if (attr.depth != server.depth || FORCE_COMPOSITED_RENDERING || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
if (systray_composited || attr.depth != server.depth) {
visual = attr.visual;
set_attr.colormap = attr.colormap;
set_attr.background_pixel = 0;
set_attr.border_pixel = 0;
mask = CWColormap|CWBackPixel|CWBorderPixel;
}
else {
} else {
set_attr.background_pixmap = ParentRelative;
mask = CWBackPixmap;
}
Window parent_window;
parent_window = XCreateWindow(server.dsp, panel->main_win, 0, 0, 30, 30, 0, attr.depth, InputOutput, visual, mask, &set_attr);
old = XSetErrorHandler(window_error_handler);
XReparentWindow(server.dsp, id, parent_window, 0, 0);
// watch for the icon trying to resize itself / closing again!
XSelectInput(server.dsp, id, StructureNotifyMask);
Window parent = XCreateWindow(server.dsp, panel->main_win, 0, 0, 30, 30, 0, attr.depth, InputOutput, visual, mask, &set_attr);
// Add the icon to the list
traywin = g_new0(TrayWindow, 1);
traywin->parent = parent;
traywin->win = win;
traywin->hide = hide;
traywin->depth = attr.depth;
// Reparenting is done at the first paint event when the window is positioned correctly over its empty background,
// to prevent graphical corruptions in icons with fake transparency
traywin->reparented = 0;
traywin->damage = 0;
traywin->empty = 0;
traywin->pid = pid;
traywin->chrono = chrono;
chrono++;
if (systray.area.on_screen == 0)
show(&systray.area);
if (systray.sort == SYSTRAY_SORT_RIGHT2LEFT)
systray.list_icons = g_slist_prepend(systray.list_icons, traywin);
else
systray.list_icons = g_slist_append(systray.list_icons, traywin);
systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows);
// printf("add_icon win %lx, %d\n", win, g_slist_length(systray.list_icons));
// Resize and redraw the systray
systray.area.resize = 1;
systray.area.redraw = 1;
panel->area.resize = 1;
panel_refresh = 1;
return TRUE;
}
gboolean reparent_icon(TrayWindow *traywin)
{
if (traywin->reparented)
return TRUE;
Panel* panel = systray.area.panel;
// Reparent
XSync(server.dsp, False);
error = FALSE;
XErrorHandler old = XSetErrorHandler(window_error_handler);
XReparentWindow(server.dsp, traywin->win, traywin->parent, 0, 0);
XSync(server.dsp, False);
XSetErrorHandler(old);
if (error != FALSE) {
fprintf(stderr, "tint2 : not icon_swallow\n");
XDestroyWindow(server.dsp, parent_window);
printf("systray %d: cannot embed icon for window %lu parent %lu pid %d\n", __LINE__, traywin->win, traywin->parent, traywin->pid);
remove_icon(traywin);
return FALSE;
}
// Watch for the icon trying to resize itself / closing again
XSync(server.dsp, False);
error = FALSE;
old = XSetErrorHandler(window_error_handler);
XSelectInput(server.dsp, traywin->win, StructureNotifyMask);
XSync(server.dsp, False);
XSetErrorHandler(old);
if (error != FALSE) {
printf("systray %d: cannot embed icon for window %lu parent %lu pid %d\n", __LINE__, traywin->win, traywin->parent, traywin->pid);
remove_icon(traywin);
return FALSE;
}
traywin->reparented = 1;
// Embed into parent
{
XEvent e;
e.xclient.type = ClientMessage;
e.xclient.serial = 0;
e.xclient.send_event = True;
e.xclient.message_type = server.atom._XEMBED;
e.xclient.window = traywin->win;
e.xclient.format = 32;
e.xclient.data.l[0] = CurrentTime;
e.xclient.data.l[1] = XEMBED_EMBEDDED_NOTIFY;
e.xclient.data.l[2] = 0;
e.xclient.data.l[3] = traywin->parent;
e.xclient.data.l[4] = 0;
XSync(server.dsp, False);
error = FALSE;
XErrorHandler old = XSetErrorHandler(window_error_handler);
XSendEvent(server.dsp, traywin->win, False, 0xFFFFFF, &e);
XSync(server.dsp, False);
XSetErrorHandler(old);
if (error != FALSE) {
printf("systray %d: cannot embed icon for window %lu pid %d\n", __LINE__, traywin->win, traywin->pid);
remove_icon(traywin);
return FALSE;
}
}
// Check if window was embedded
{
Atom acttype;
int actfmt;
@@ -407,7 +544,7 @@ gboolean add_icon(Window id)
unsigned char *data = 0;
int ret;
ret = XGetWindowProperty(server.dsp, id, server.atom._XEMBED_INFO, 0, 2, False, server.atom._XEMBED_INFO, &acttype, &actfmt, &nbitem, &bytes, &data);
ret = XGetWindowProperty(server.dsp, traywin->win, server.atom._XEMBED_INFO, 0, 2, False, server.atom._XEMBED_INFO, &acttype, &actfmt, &nbitem, &bytes, &data);
if (ret == Success) {
if (data) {
if (nbitem == 2) {
@@ -416,84 +553,51 @@ gboolean add_icon(Window id)
}
XFree(data);
}
}
else {
} else {
fprintf(stderr, "tint2 : xembed error\n");
XDestroyWindow(server.dsp, parent_window);
remove_icon(traywin);
return FALSE;
}
}
{
XEvent e;
e.xclient.type = ClientMessage;
e.xclient.serial = 0;
e.xclient.send_event = True;
e.xclient.message_type = server.atom._XEMBED;
e.xclient.window = id;
e.xclient.format = 32;
e.xclient.data.l[0] = CurrentTime;
e.xclient.data.l[1] = XEMBED_EMBEDDED_NOTIFY;
e.xclient.data.l[2] = 0;
e.xclient.data.l[3] = parent_window;
e.xclient.data.l[4] = 0;
XSendEvent(server.dsp, id, False, 0xFFFFFF, &e);
// Redirect rendering when using compositing
if (systray_composited) {
traywin->damage = XDamageCreate(server.dsp, traywin->parent, XDamageReportRawRectangles);
XCompositeRedirectWindow(server.dsp, traywin->parent, CompositeRedirectManual);
}
traywin = g_new0(TrayWindow, 1);
traywin->id = parent_window;
traywin->tray_id = id;
traywin->hide = hide;
traywin->depth = attr.depth;
traywin->damage = 0;
if (systray.area.on_screen == 0)
show(&systray.area);
if (systray.sort == 3)
systray.list_icons = g_slist_prepend(systray.list_icons, traywin);
else if (systray.sort == 2)
systray.list_icons = g_slist_append(systray.list_icons, traywin);
else
systray.list_icons = g_slist_insert_sorted(systray.list_icons, traywin, compare_traywindows);
//printf("add_icon id %lx, %d\n", id, g_slist_length(systray.list_icons));
if (FORCE_COMPOSITED_RENDERING || server.real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportRawRectangles);
XCompositeRedirectWindow(server.dsp, traywin->id, CompositeRedirectManual);
}
// show the window
// Make the icon visible
if (!traywin->hide)
XMapWindow(server.dsp, traywin->tray_id);
XMapWindow(server.dsp, traywin->win);
if (!traywin->hide && !panel->is_hidden)
XMapRaised(server.dsp, traywin->id);
XMapRaised(server.dsp, traywin->parent);
XMoveResizeWindow(server.dsp, traywin->parent, traywin->x, traywin->y, traywin->width, traywin->height);
XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height);
XFlush(server.dsp);
// changed in systray
systray.area.resize = 1;
panel_refresh = 1;
return TRUE;
}
void remove_icon(TrayWindow *traywin)
{
XErrorHandler old;
// remove from our list
systray.list_icons = g_slist_remove(systray.list_icons, traywin);
//printf("remove_icon id %lx, %d\n", traywin->id);
printf("remove_icon: %lu\n", traywin->win);
XSelectInput(server.dsp, traywin->tray_id, NoEventMask);
XSelectInput(server.dsp, traywin->win, NoEventMask);
if (traywin->damage)
XDamageDestroy(server.dsp, traywin->damage);
// reparent to root
XSync(server.dsp, False);
error = FALSE;
old = XSetErrorHandler(window_error_handler);
XErrorHandler old = XSetErrorHandler(window_error_handler);
if (!traywin->hide)
XUnmapWindow(server.dsp, traywin->tray_id);
XReparentWindow(server.dsp, traywin->tray_id, server.root_win, 0, 0);
XDestroyWindow(server.dsp, traywin->id);
XUnmapWindow(server.dsp, traywin->win);
XReparentWindow(server.dsp, traywin->win, server.root_win, 0, 0);
XDestroyWindow(server.dsp, traywin->parent);
XSync(server.dsp, False);
XSetErrorHandler(old);
stop_timeout(traywin->render_timeout);
@@ -503,12 +607,13 @@ void remove_icon(TrayWindow *traywin)
int count = 0;
GSList *l;
for (l = systray.list_icons; l; l = l->next) {
if (!((TrayWindow*)l->data)->hide)
count++;
if (((TrayWindow*)l->data)->hide)
continue;
count++;
}
if (count == 0)
hide(&systray.area);
// changed in systray
systray.area.resize = 1;
panel_refresh = 1;
@@ -518,40 +623,118 @@ void remove_icon(TrayWindow *traywin)
void net_message(XClientMessageEvent *e)
{
unsigned long opcode;
Window id;
Window win;
opcode = e->data.l[1];
switch (opcode) {
case SYSTEM_TRAY_REQUEST_DOCK:
id = e->data.l[2];
if (id) add_icon(id);
break;
case SYSTEM_TRAY_REQUEST_DOCK:
win = e->data.l[2];
if (win)
add_icon(win);
break;
case SYSTEM_TRAY_BEGIN_MESSAGE:
case SYSTEM_TRAY_CANCEL_MESSAGE:
// we don't show baloons messages.
break;
case SYSTEM_TRAY_BEGIN_MESSAGE:
case SYSTEM_TRAY_CANCEL_MESSAGE:
// we don't show baloons messages.
break;
default:
if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA)
printf("message from dockapp: %s\n", e->data.b);
else
fprintf(stderr, "SYSTEM_TRAY : unknown message type\n");
break;
default:
if (opcode == server.atom._NET_SYSTEM_TRAY_MESSAGE_DATA)
printf("message from dockapp: %s\n", e->data.b);
else
fprintf(stderr, "SYSTEM_TRAY : unknown message type\n");
break;
}
}
void systray_render_icon_now(void* t)
Display *display = NULL;
XImage *tintXGetImage(Window win)
{
char *display_name = XDisplayName(NULL);
if (!display_name)
return NULL;
if (!display)
display = XOpenDisplay(display_name);
if (!display)
return NULL;
unsigned int border_width;
int xpos, ypos;
unsigned int width, height, depth;
Window root;
if (!XGetGeometry(display, win, &root, &xpos, &ypos, &width, &height, &border_width, &depth)) {
fprintf(stderr, "Couldn't get geometry of window!\n");
return NULL;
}
return XGetImage(display, win, 0, 0, width, height, AllPlanes, XYPixmap);
}
void systray_render_icon_composited(void* t)
{
// we end up in this function only in real transparency mode or if systray_task_asb != 100 0 0
// we made also sure, that we always have a 32 bit visual, i.e. we can safely create 32 bit pixmaps here
TrayWindow* traywin = t;
traywin->render_timeout = 0;
if ( traywin->width == 0 || traywin->height == 0 ) {
// reschedule rendering since the geometry information has not yet been processed (can happen on slow cpu)
systray_render_icon(traywin);
// wine tray icons update whenever mouse is over them, so we limit the updates to 50 ms
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
struct timespec earliest_render = add_msec_to_timespec(traywin->time_last_render, 50);
if (compare_timespecs(&earliest_render, &now) > 0) {
traywin->render_timeout = add_timeout(50, 0, systray_render_icon_composited, traywin, &traywin->render_timeout);
return;
}
traywin->time_last_render.tv_sec = now.tv_sec;
traywin->time_last_render.tv_nsec = now.tv_nsec;
if ( traywin->width == 0 || traywin->height == 0 ) {
// reschedule rendering since the geometry information has not yet been processed (can happen on slow cpu)
traywin->render_timeout = add_timeout(50, 0, systray_render_icon_composited, traywin, &traywin->render_timeout);
return;
}
if (traywin->render_timeout) {
stop_timeout(traywin->render_timeout);
traywin->render_timeout = NULL;
}
int empty = 1;
XImage *ximage = tintXGetImage(traywin->win);
if (ximage) {
if (ximage->width != traywin->width ||
ximage->height != traywin->height) {
XFree(ximage);
XCloseDisplay(display);
display = NULL;
XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height);
return;
}
XColor color;
if (ximage->width > 0 && ximage->height > 0) {
color.pixel = XGetPixel(ximage, ximage->width/2, ximage->height/2);
if (color.pixel != 0)
empty = 0;
int x, y;
for (x = 0; empty && x < ximage->width; x++) {
for (y = 0; empty && y < ximage->height; y++) {
color.pixel = XGetPixel(ximage, x, y);
if (color.pixel != 0)
empty = 0;
}
}
}
XFree(ximage);
XCloseDisplay(display);
display = NULL;
}
if (traywin->empty != empty) {
traywin->empty = empty;
systray.area.resize = 1;
panel_refresh = 1;
systray.list_icons = g_slist_sort(systray.list_icons, compare_traywindows);
}
//printf("systray_render_icon_now: %d empty %d\n", traywin->win, empty);
if (empty)
return;
// good systray icons support 32 bit depth, but some icons are still 24 bit.
// We create a heuristic mask for these icons, i.e. we get the rgb value in the top left corner, and
@@ -561,22 +744,46 @@ void systray_render_icon_now(void* t)
// Very ugly hack, but somehow imlib2 is not able to get the image from the traywindow itself,
// so we first render the tray window onto a pixmap, and then we tell imlib2 to use this pixmap as
// drawable. If someone knows why it does not work with the traywindow itself, please tell me ;)
Pixmap tmp_pmap = XCreatePixmap(server.dsp, server.root_win, traywin->width, traywin->height, 32);
XRenderPictFormat* f;
if (traywin->depth == 24)
Pixmap tmp_pmap = XCreatePixmap(server.dsp, traywin->win, traywin->width, traywin->height, 32);
if (!tmp_pmap) {
goto on_systray_error;
}
XRenderPictFormat *f;
if (traywin->depth == 24) {
f = XRenderFindStandardFormat(server.dsp, PictStandardRGB24);
else if (traywin->depth == 32)
} else if (traywin->depth == 32) {
f = XRenderFindStandardFormat(server.dsp, PictStandardARGB32);
else {
} else {
printf("Strange tray icon found with depth: %d\n", traywin->depth);
XFreePixmap(server.dsp, tmp_pmap);
return;
}
Picture pict_image;
XRenderPictFormat *f32 = XRenderFindVisualFormat(server.dsp, server.visual32);
if (!f || !f32) {
XFreePixmap(server.dsp, tmp_pmap);
goto on_systray_error;
}
XSync(server.dsp, False);
error = FALSE;
XErrorHandler old = XSetErrorHandler(window_error_handler);
//if (server.real_transparency)
//pict_image = XRenderCreatePicture(server.dsp, traywin->id, f, 0, 0);
//Picture pict_image = XRenderCreatePicture(server.dsp, traywin->parent, f, 0, 0);
// reverted Rev 407 because here it's breaking alls icon with systray + xcompmgr
pict_image = XRenderCreatePicture(server.dsp, traywin->tray_id, f, 0, 0);
Picture pict_image = XRenderCreatePicture(server.dsp, traywin->win, f, 0, 0);
if (!pict_image) {
XFreePixmap(server.dsp, tmp_pmap);
XSetErrorHandler(old);
goto on_error;
}
Picture pict_drawable = XRenderCreatePicture(server.dsp, tmp_pmap, XRenderFindVisualFormat(server.dsp, server.visual32), 0, 0);
if (!pict_drawable) {
XRenderFreePicture(server.dsp, pict_image);
XFreePixmap(server.dsp, tmp_pmap);
XSetErrorHandler(old);
goto on_error;
}
XRenderComposite(server.dsp, PictOpSrc, pict_image, None, pict_drawable, 0, 0, 0, 0, 0, 0, traywin->width, traywin->height);
XRenderFreePicture(server.dsp, pict_image);
XRenderFreePicture(server.dsp, pict_drawable);
@@ -586,12 +793,17 @@ void systray_render_icon_now(void* t)
imlib_context_set_colormap(server.colormap32);
imlib_context_set_drawable(tmp_pmap);
Imlib_Image image = imlib_create_image_from_drawable(0, 0, 0, traywin->width, traywin->height, 1);
if (image == 0)
return;
if (!image) {
imlib_context_set_visual(server.visual);
imlib_context_set_colormap(server.colormap);
XFreePixmap(server.dsp, tmp_pmap);
XSetErrorHandler(old);
goto on_error;
}
imlib_context_set_image(image);
//if (traywin->depth == 24)
//imlib_save_image("/home/thil77/test.jpg");
//imlib_save_image("/home/thil77/test.jpg");
imlib_image_set_has_alpha(1);
DATA32* data = imlib_image_get_data();
if (traywin->depth == 24) {
@@ -611,21 +823,40 @@ void systray_render_icon_now(void* t)
if (traywin->damage)
XDamageSubtract(server.dsp, traywin->damage, None, None);
XFlush(server.dsp);
XSync(server.dsp, False);
XSetErrorHandler(old);
if (error)
goto on_error;
return;
on_error:
printf("systray %d: rendering error for icon %lu pid %d\n", __LINE__, traywin->win, traywin->pid);
return;
on_systray_error:
printf("systray %d: rendering error for icon %lu pid %d. Disabling compositing and restarting systray...\n", __LINE__, traywin->win, traywin->pid);
systray_composited = 0;
stop_net();
start_net();
return;
}
void systray_render_icon(TrayWindow* traywin)
{
if (FORCE_COMPOSITED_RENDERING || server.real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
// wine tray icons update whenever mouse is over them, so we limit the updates to 50 ms
if (!reparent_icon(traywin))
return;
if (systray_composited) {
if (!traywin->render_timeout)
traywin->render_timeout = add_timeout(50, 0, systray_render_icon_now, traywin, &traywin->render_timeout);
}
else {
// Pixmap pix = XCreatePixmap(server.dsp, server.root_win, traywin->width, traywin->height, server.depth);
// XCopyArea(server.dsp, panel->temp_pmap, pix, server.gc, traywin->x, traywin->y, traywin->width, traywin->height, 0, 0);
// XSetWindowBackgroundPixmap(server.dsp, traywin->id, pix);
XClearArea(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, True);
systray_render_icon_composited(traywin);
} else {
// Trigger window repaint
XClearArea(server.dsp, traywin->parent, 0, 0, traywin->width, traywin->height, True);
XClearArea(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height, True);
}
}
@@ -636,7 +867,8 @@ void refresh_systray_icon()
GSList *l;
for (l = systray.list_icons; l ; l = l->next) {
traywin = (TrayWindow*)l->data;
if (traywin->hide) continue;
if (traywin->hide)
continue;
systray_render_icon(traywin);
}
}

View File

@@ -20,6 +20,7 @@
// Flags for _XEMBED_INFO
#define XEMBED_MAPPED (1 << 0)
enum { SYSTRAY_SORT_ASCENDING, SYSTRAY_SORT_DESCENDING, SYSTRAY_SORT_LEFT2RIGHT, SYSTRAY_SORT_RIGHT2LEFT };
typedef struct {
// always start with area
@@ -34,8 +35,8 @@ typedef struct {
typedef struct
{
Window id;
Window tray_id;
Window parent;
Window win;
int x, y;
int width, height;
// TODO: manage icon's show/hide
@@ -43,6 +44,11 @@ typedef struct
int depth;
Damage damage;
timeout* render_timeout;
int empty;
int pid;
int chrono;
struct timespec time_last_render;
int reparented;
} TrayWindow;

View File

@@ -50,6 +50,9 @@ Task *add_task (Window win)
if (!win) return 0;
if (window_is_hidden(win)) return 0;
XSelectInput(server.dsp, win, PropertyChangeMask|StructureNotifyMask);
XFlush(server.dsp);
int monitor;
if (nb_panel > 1) {
monitor = window_get_monitor (win);
@@ -75,8 +78,7 @@ Task *add_task (Window win)
get_title(&new_tsk);
get_icon(&new_tsk);
//printf("task %s : desktop %d, monitor %d\n", new_tsk->title, desktop, monitor);
XSelectInput (server.dsp, new_tsk.win, PropertyChangeMask|StructureNotifyMask);
//printf("new task %s win %u: desktop %d, monitor %d\n", new_tsk.title, win, new_tsk.desktop, monitor);
GPtrArray* task_group = g_ptr_array_new();
Taskbar *tskbar;
@@ -109,7 +111,7 @@ Task *add_task (Window win)
}
new_tsk2->icon_width = new_tsk.icon_width;
new_tsk2->icon_height = new_tsk.icon_height;
tskbar->area.list = g_slist_append(tskbar->area.list, new_tsk2);
tskbar->area.list = g_list_append(tskbar->area.list, new_tsk2);
tskbar->area.resize = 1;
g_ptr_array_add(task_group, new_tsk2);
//printf("add_task panel %d, desktop %d, task %s\n", i, j, new_tsk2->title);
@@ -167,7 +169,7 @@ void remove_task (Task *tsk)
for (i=0; i<task_group->len; ++i) {
tsk2 = g_ptr_array_index(task_group, i);
tskbar = tsk2->area.parent;
tskbar->area.list = g_slist_remove(tskbar->area.list, tsk2);
tskbar->area.list = g_list_remove(tskbar->area.list, tsk2);
tskbar->area.resize = 1;
if (tsk2 == task_active) task_active = 0;
if (tsk2 == task_drag) task_drag = 0;
@@ -422,15 +424,13 @@ Task *find_active_task(Task *current_task, Task *active_task)
if (active_task == NULL)
return current_task;
GSList *l0;
Task *tsk;
Taskbar* tskbar = current_task->area.parent;
l0 = tskbar->area.list;
GList *l0 = tskbar->area.list;
if (taskbarname_enabled)
l0 = l0->next;
for (; l0 ; l0 = l0->next) {
tsk = l0->data;
Task *tsk = l0->data;
if (tsk->win == active_task->win)
return tsk;
}
@@ -443,15 +443,13 @@ Task *next_task(Task *tsk)
if (tsk == 0)
return 0;
GSList *l0, *lfirst_tsk;
Task *tsk1;
Taskbar* tskbar = tsk->area.parent;
l0 = tskbar->area.list;
GList *l0 = tskbar->area.list;
if (taskbarname_enabled) l0 = l0->next;
lfirst_tsk = l0;
GList *lfirst_tsk = l0;
for (; l0 ; l0 = l0->next) {
tsk1 = l0->data;
Task *tsk1 = l0->data;
if (tsk1 == tsk) {
if (l0->next == 0) l0 = lfirst_tsk;
else l0 = l0->next;
@@ -467,19 +465,18 @@ Task *prev_task(Task *tsk)
if (tsk == 0)
return 0;
GSList *l0, *lfirst_tsk;
Task *tsk1, *tsk2;
Taskbar* tskbar = tsk->area.parent;
tsk2 = 0;
l0 = tskbar->area.list;
GList *l0 = tskbar->area.list;
if (taskbarname_enabled) l0 = l0->next;
lfirst_tsk = l0;
GList *lfirst_tsk = l0;
for (; l0 ; l0 = l0->next) {
tsk1 = l0->data;
if (tsk1 == tsk) {
if (l0 == lfirst_tsk) {
l0 = g_slist_last ( l0 );
l0 = g_list_last ( l0 );
tsk2 = l0->data;
}
return tsk2;

View File

@@ -47,6 +47,7 @@ int taskbar_distribute_size;
int hide_inactive_tasks;
int hide_task_diff_monitor;
int taskbar_sort_method;
int taskbar_alignment;
guint win_hash(gconstpointer key) { return (guint)*((Window*)key); }
gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((Window*)a) == *((Window*)b)); }
@@ -63,6 +64,7 @@ void default_taskbar()
hide_inactive_tasks = 0;
hide_task_diff_monitor = 0;
taskbar_sort_method = TASKBAR_NOSORT;
taskbar_alignment = ALIGN_LEFT;
default_taskbarname();
}
@@ -97,7 +99,7 @@ void cleanup_taskbar()
}
free_area(&tskbar->area);
// remove taskbar from the panel
panel->area.list = g_slist_remove(panel->area.list, tskbar);
panel->area.list = g_list_remove(panel->area.list, tskbar);
}
if (panel->taskbar) {
free(panel->taskbar);
@@ -153,6 +155,7 @@ void init_taskbar_panel(void *p)
panel->g_taskbar.area.parent = panel;
panel->g_taskbar.area.panel = panel;
panel->g_taskbar.area.size_mode = SIZE_BY_LAYOUT;
panel->g_taskbar.area.alignment = taskbar_alignment;
panel->g_taskbar.area._resize = resize_taskbar;
panel->g_taskbar.area._draw_foreground = draw_taskbar;
panel->g_taskbar.area._on_change_layout = on_change_taskbar;
@@ -334,7 +337,7 @@ int resize_taskbar(void *obj)
resize_by_layout(obj, panel->g_task.maximum_width);
text_width = panel->g_task.maximum_width;
GSList *l = taskbar->area.list;
GList *l = taskbar->area.list;
if (taskbarname_enabled) l = l->next;
for (; l != NULL; l = l->next) {
if (((Task *)l->data)->area.on_screen) {
@@ -388,7 +391,7 @@ void set_taskbar_state(Taskbar *tskbar, int state)
if (taskbarname_enabled && tskbar->bar_name.state_pix[state] == 0)
tskbar->bar_name.area.redraw = 1;
if (panel_mode == MULTI_DESKTOP && panel1[0].g_taskbar.background[TASKBAR_NORMAL] != panel1[0].g_taskbar.background[TASKBAR_ACTIVE]) {
GSList *l = tskbar->area.list;
GList *l = tskbar->area.list;
if (taskbarname_enabled) l = l->next;
for ( ; l ; l = l->next)
set_task_redraw(l->data);
@@ -511,7 +514,7 @@ int taskbar_needs_sort(Taskbar *taskbar)
if (taskbar_sort_method == TASKBAR_NOSORT)
return 0;
GSList *i, *j;
GList *i, *j;
for (i = taskbar->area.list, j = i ? i->next : NULL; i && j; i = i->next, j = j->next) {
if (compare_tasks(i->data, j->data, taskbar) > 0) {
return 1;
@@ -528,7 +531,7 @@ void sort_tasks(Taskbar *taskbar)
if (!taskbar_needs_sort(taskbar)) {
return;
}
taskbar->area.list = g_slist_sort_with_data(taskbar->area.list, (GCompareDataFunc)compare_tasks, taskbar);
taskbar->area.list = g_list_sort_with_data(taskbar->area.list, (GCompareDataFunc)compare_tasks, taskbar);
taskbar->area.resize = 1;
panel_refresh = 1;
((Panel*)taskbar->area.panel)->area.resize = 1;

View File

@@ -21,6 +21,7 @@ extern int hide_inactive_tasks;
extern int hide_task_diff_monitor;
enum { TASKBAR_NOSORT, TASKBAR_SORT_CENTER, TASKBAR_SORT_TITLE };
extern int taskbar_sort_method;
extern int taskbar_alignment;
typedef struct {
// always start with area

View File

@@ -76,7 +76,7 @@ void init_taskbarname_panel(void *p)
tskbar->bar_name.name = g_strdup_printf("%d", j+1);
// append the name at the beginning of taskbar
tskbar->area.list = g_slist_append(tskbar->area.list, &tskbar->bar_name);
tskbar->area.list = g_list_append(tskbar->area.list, &tskbar->bar_name);
}
for (l=list ; l ; l = l->next)
@@ -103,7 +103,7 @@ void cleanup_taskbarname()
XFreePixmap(server.dsp, tskbar->bar_name.state_pix[k]);
tskbar->bar_name.state_pix[k] = 0;
}
tskbar->area.list = g_slist_remove(tskbar->area.list, &tskbar->bar_name);
tskbar->area.list = g_list_remove(tskbar->area.list, &tskbar->bar_name);
}
}

View File

@@ -117,12 +117,12 @@ void init (int argc, char *argv[])
// BSD does not support pselect(), therefore we have to use select and hope that we do not
// end up in a race condition there (see 'man select()' on a linux machine for more information)
// block all signals, such that no race conditions occur before pselect in our main loop
// sigset_t block_mask;
// sigaddset(&block_mask, SIGINT);
// sigaddset(&block_mask, SIGTERM);
// sigaddset(&block_mask, SIGHUP);
// sigaddset(&block_mask, SIGUSR1);
// sigprocmask(SIG_BLOCK, &block_mask, 0);
// sigset_t block_mask;
// sigaddset(&block_mask, SIGINT);
// sigaddset(&block_mask, SIGTERM);
// sigaddset(&block_mask, SIGHUP);
// sigaddset(&block_mask, SIGUSR1);
// sigprocmask(SIG_BLOCK, &block_mask, 0);
}
static int sn_pipe_valid = 0;
@@ -241,7 +241,7 @@ void init_X11_post_config()
/* Catch events */
XSelectInput (server.dsp, server.root_win, PropertyChangeMask|StructureNotifyMask);
// load default icon
gchar *path;
const gchar * const *data_dirs;
@@ -323,60 +323,60 @@ void window_action (Task *tsk, int action)
if (!tsk) return;
int desk;
switch (action) {
case CLOSE:
set_close (tsk->win);
break;
case TOGGLE:
set_active(tsk->win);
break;
case ICONIFY:
case CLOSE:
set_close (tsk->win);
break;
case TOGGLE:
set_active(tsk->win);
break;
case ICONIFY:
XIconifyWindow (server.dsp, tsk->win, server.screen);
break;
case TOGGLE_ICONIFY:
if (task_active && tsk->win == task_active->win)
XIconifyWindow (server.dsp, tsk->win, server.screen);
break;
case TOGGLE_ICONIFY:
if (task_active && tsk->win == task_active->win)
XIconifyWindow (server.dsp, tsk->win, server.screen);
else
set_active (tsk->win);
break;
case SHADE:
window_toggle_shade (tsk->win);
break;
case MAXIMIZE_RESTORE:
window_maximize_restore (tsk->win);
break;
case MAXIMIZE:
window_maximize_restore (tsk->win);
break;
case RESTORE:
window_maximize_restore (tsk->win);
break;
case DESKTOP_LEFT:
if ( tsk->desktop == 0 ) break;
desk = tsk->desktop - 1;
windows_set_desktop(tsk->win, desk);
if (desk == server.desktop)
set_active(tsk->win);
break;
case DESKTOP_RIGHT:
if (tsk->desktop == server.nb_desktop ) break;
desk = tsk->desktop + 1;
windows_set_desktop(tsk->win, desk);
if (desk == server.desktop)
set_active(tsk->win);
break;
case NEXT_TASK:
{
Task *tsk1;
tsk1 = next_task(find_active_task(tsk, task_active));
set_active(tsk1->win);
}
break;
case PREV_TASK:
{
Task *tsk1;
tsk1 = prev_task(find_active_task(tsk, task_active));
set_active(tsk1->win);
}
else
set_active (tsk->win);
break;
case SHADE:
window_toggle_shade (tsk->win);
break;
case MAXIMIZE_RESTORE:
window_maximize_restore (tsk->win);
break;
case MAXIMIZE:
window_maximize_restore (tsk->win);
break;
case RESTORE:
window_maximize_restore (tsk->win);
break;
case DESKTOP_LEFT:
if ( tsk->desktop == 0 ) break;
desk = tsk->desktop - 1;
windows_set_desktop(tsk->win, desk);
if (desk == server.desktop)
set_active(tsk->win);
break;
case DESKTOP_RIGHT:
if (tsk->desktop == server.nb_desktop ) break;
desk = tsk->desktop + 1;
windows_set_desktop(tsk->win, desk);
if (desk == server.desktop)
set_active(tsk->win);
break;
case NEXT_TASK:
{
Task *tsk1;
tsk1 = next_task(find_active_task(tsk, task_active));
set_active(tsk1->win);
}
break;
case PREV_TASK:
{
Task *tsk1;
tsk1 = prev_task(find_active_task(tsk, task_active));
set_active(tsk1->win);
}
}
}
@@ -386,10 +386,10 @@ int tint2_handles_click(Panel* panel, XButtonEvent* e)
Task* task = click_task(panel, e->x, e->y);
if (task) {
if( (e->button == 1 && mouse_left != 0)
|| (e->button == 2 && mouse_middle != 0)
|| (e->button == 3 && mouse_right != 0)
|| (e->button == 4 && mouse_scroll_up != 0)
|| (e->button == 5 && mouse_scroll_down !=0) )
|| (e->button == 2 && mouse_middle != 0)
|| (e->button == 3 && mouse_right != 0)
|| (e->button == 4 && mouse_scroll_up != 0)
|| (e->button == 5 && mouse_scroll_down !=0) )
{
return 1;
}
@@ -470,8 +470,8 @@ void event_button_motion_notify (XEvent *e)
} else {
// Swap the task_drag with the task on the event's location (if they differ)
if(event_task && event_task != task_drag) {
GSList * drag_iter = g_slist_find(event_taskbar->area.list, task_drag);
GSList * task_iter = g_slist_find(event_taskbar->area.list, event_task);
GList * drag_iter = g_list_find(event_taskbar->area.list, task_drag);
GList * task_iter = g_list_find(event_taskbar->area.list, event_task);
if(drag_iter && task_iter) {
gpointer temp = task_iter->data;
task_iter->data = drag_iter->data;
@@ -488,14 +488,14 @@ void event_button_motion_notify (XEvent *e)
return;
Taskbar * drag_taskbar = (Taskbar*)task_drag->area.parent;
drag_taskbar->area.list = g_slist_remove(drag_taskbar->area.list, task_drag);
drag_taskbar->area.list = g_list_remove(drag_taskbar->area.list, task_drag);
if(event_taskbar->area.posx > drag_taskbar->area.posx || event_taskbar->area.posy > drag_taskbar->area.posy) {
int i = (taskbarname_enabled) ? 1 : 0;
event_taskbar->area.list = g_slist_insert(event_taskbar->area.list, task_drag, i);
event_taskbar->area.list = g_list_insert(event_taskbar->area.list, task_drag, i);
}
else
event_taskbar->area.list = g_slist_append(event_taskbar->area.list, task_drag);
event_taskbar->area.list = g_list_append(event_taskbar->area.list, task_drag);
// Move task to other desktop (but avoid the 'Window desktop changed' code in 'event_property_notify')
task_drag->area.parent = event_taskbar;
@@ -530,27 +530,27 @@ void event_button_release (XEvent *e)
int action = TOGGLE_ICONIFY;
switch (e->xbutton.button) {
case 1:
action = mouse_left;
break;
case 2:
action = mouse_middle;
break;
case 3:
action = mouse_right;
break;
case 4:
action = mouse_scroll_up;
break;
case 5:
action = mouse_scroll_down;
break;
case 6:
action = mouse_tilt_left;
break;
case 7:
action = mouse_tilt_right;
break;
case 1:
action = mouse_left;
break;
case 2:
action = mouse_middle;
break;
case 3:
action = mouse_right;
break;
case 4:
action = mouse_scroll_up;
break;
case 5:
action = mouse_scroll_down;
break;
case 6:
action = mouse_tilt_left;
break;
case 7:
action = mouse_tilt_right;
break;
}
if ( click_clock(panel, e->xbutton.x, e->xbutton.y)) {
@@ -677,10 +677,9 @@ void event_property_notify (XEvent *e)
// check ALLDESKTOP task => resize taskbar
Taskbar *tskbar;
Task *tsk;
GSList *l;
if (server.nb_desktop > old_desktop) {
tskbar = &panel->taskbar[old_desktop];
l = tskbar->area.list;
GList *l = tskbar->area.list;
if (taskbarname_enabled) l = l->next;
for (; l ; l = l->next) {
tsk = l->data;
@@ -694,7 +693,7 @@ void event_property_notify (XEvent *e)
}
}
tskbar = &panel->taskbar[server.desktop];
l = tskbar->area.list;
GList *l = tskbar->area.list;
if (taskbarname_enabled) l = l->next;
for (; l ; l = l->next) {
tsk = l->data;
@@ -727,6 +726,7 @@ void event_property_notify (XEvent *e)
}
else {
tsk = task_get_task (win);
//printf("change win = %u, task = %p\n", win, tsk);
if (!tsk) {
if (at != server.atom._NET_WM_STATE)
return;
@@ -830,11 +830,13 @@ void event_configure_notify (Window win)
GSList *l;
for (l = systray.list_icons; l ; l = l->next) {
traywin = (TrayWindow*)l->data;
if (traywin->tray_id == win) {
if (traywin->win == win) {
//printf("move tray %d\n", traywin->x);
XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, traywin->width, traywin->height);
XResizeWindow(server.dsp, traywin->tray_id, traywin->width, traywin->height);
XMoveResizeWindow(server.dsp, traywin->parent, traywin->x, traywin->y, traywin->width, traywin->height);
if (traywin->reparented)
XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height);
panel_refresh = 1;
refresh_systray = 1;
return;
}
}
@@ -894,8 +896,8 @@ struct Property read_property(Display* disp, Window w, Atom property)
if (ret != 0)
XFree(ret);
XGetWindowProperty(disp, w, property, 0, read_bytes, False, AnyPropertyType,
&actual_type, &actual_format, &nitems, &bytes_after,
&ret);
&actual_type, &actual_format, &nitems, &bytes_after,
&ret);
read_bytes *= 2;
} while (bytes_after != 0);
@@ -1125,8 +1127,8 @@ start:
dnd_sent_request = 0;
dnd_launcher_exec = 0;
// sigset_t empty_mask;
// sigemptyset(&empty_mask);
// sigset_t empty_mask;
// sigemptyset(&empty_mask);
while (1) {
if (panel_refresh) {
@@ -1267,8 +1269,8 @@ start:
if (e.xany.window == g_tooltip.window || !systray_enabled)
break;
for (it = systray.list_icons; it; it = g_slist_next(it)) {
if (((TrayWindow*)it->data)->tray_id == e.xany.window) {
remove_icon((TrayWindow*)it->data);
if (((TrayWindow*)it->data)->win == e.xany.window) {
remove_icon((TrayWindow*)it->data);
break;
}
}
@@ -1412,8 +1414,8 @@ start:
XDamageNotifyEvent* de = &event_union.de;
for (l = systray.list_icons; l ; l = l->next) {
traywin = (TrayWindow*)l->data;
if ( traywin->id == de->drawable ) {
systray_render_icon(traywin);
if ( traywin->parent == de->drawable ) {
systray_render_icon(traywin);
break;
}
}

View File

@@ -56,15 +56,18 @@ target_link_libraries( tint2conf ${X11_T2C_LIBRARIES}
${RSVG_LIBRARIES} )
if ( NOT DATADIR )
set( DATADIR share )
set(DATADIR share)
endif( NOT DATADIR )
add_definitions( -DINSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" )
add_definitions( -DLOCALEDIR=\"${CMAKE_INSTALL_PREFIX}/${DATADIR}/locale\" )
add_definitions( -DGETTEXT_PACKAGE=\"tint2conf\" )
set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -pthread" )
set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" )
add_subdirectory(po)
install( TARGETS tint2conf DESTINATION bin )
install( PROGRAMS tintwizard.py DESTINATION bin )
install( FILES taskbar.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps )
install( FILES tint2conf.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps )
install( FILES tint2conf.desktop DESTINATION ${DATADIR}/applications )
install( CODE "execute_process(COMMAND gtk-update-icon-cache -f -t ${DATADIR}/icons/hicolor WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})" )

View File

@@ -119,26 +119,12 @@ static const char *global_ui =
" </popup>"
"</ui>";
// define menubar and toolbar action
static GtkActionEntry entries[] = {
{"ThemeMenu", NULL, _("Theme"), NULL, NULL, NULL},
{"ThemeAdd", GTK_STOCK_ADD, _("_Import theme..."), "<Control>N", _("Import theme"), G_CALLBACK(menuImport)},
{"ThemeDefault", GTK_STOCK_NEW, _("_Import default theme..."), NULL, _("Import default theme"), G_CALLBACK(menuImportDefault)},
{"ThemeSaveAs", GTK_STOCK_SAVE_AS, _("_Save as..."), NULL, _("Save theme as"), G_CALLBACK(menuSaveAs)},
{"ThemeDelete", GTK_STOCK_DELETE, _("_Delete"), NULL, _("Delete theme"), G_CALLBACK(menuDelete)},
{"ThemeProperties", GTK_STOCK_PROPERTIES, _("_Edit theme..."), NULL, _("Edit selected theme"), G_CALLBACK(edit_current_theme)},
{"ThemeQuit", GTK_STOCK_QUIT, _("_Quit"), "<control>Q", _("Quit"), G_CALLBACK(gtk_main_quit)},
{"EditMenu", NULL, "Edit", NULL, NULL, NULL},
{"EditRefresh", GTK_STOCK_REFRESH, _("Refresh"), NULL, _("Refresh"), G_CALLBACK(refresh_current_theme)},
{"EditRefreshAll", GTK_STOCK_REFRESH, _("Refresh all"), NULL, _("Refresh all"), G_CALLBACK(load_all_themes)},
{"HelpMenu", NULL, _("Help"), NULL, NULL, NULL},
{"HelpAbout", GTK_STOCK_ABOUT, _("_About"), "<Control>A", _("About"), G_CALLBACK(menuAbout)}
};
int main(int argc, char **argv)
{
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
GtkWidget *vBox = NULL, *scrollbar = NULL;
GtkActionGroup *actionGroup;
@@ -167,6 +153,23 @@ int main(int argc, char **argv)
gtk_container_add(GTK_CONTAINER(g_window), vBox);
actionGroup = gtk_action_group_new("menuActionGroup");
// Menubar and toolbar entries
GtkActionEntry entries[] = {
{"ThemeMenu", NULL, _("Theme"), NULL, NULL, NULL},
{"ThemeAdd", GTK_STOCK_ADD, _("_Import theme..."), "<Control>N", _("Import theme"), G_CALLBACK(menuImport)},
{"ThemeDefault", GTK_STOCK_NEW, _("_Import default theme..."), NULL, _("Import default theme"), G_CALLBACK(menuImportDefault)},
{"ThemeSaveAs", GTK_STOCK_SAVE_AS, _("_Save as..."), NULL, _("Save theme as"), G_CALLBACK(menuSaveAs)},
{"ThemeDelete", GTK_STOCK_DELETE, _("_Delete"), NULL, _("Delete theme"), G_CALLBACK(menuDelete)},
{"ThemeProperties", GTK_STOCK_PROPERTIES, _("_Edit theme..."), NULL, _("Edit selected theme"), G_CALLBACK(edit_current_theme)},
{"ThemeQuit", GTK_STOCK_QUIT, _("_Quit"), "<control>Q", _("Quit"), G_CALLBACK(gtk_main_quit)},
{"EditMenu", NULL, _("Edit"), NULL, NULL, NULL},
{"EditRefresh", GTK_STOCK_REFRESH, _("Refresh"), NULL, _("Refresh"), G_CALLBACK(refresh_current_theme)},
{"EditRefreshAll", GTK_STOCK_REFRESH, _("Refresh all"), NULL, _("Refresh all"), G_CALLBACK(load_all_themes)},
{"HelpMenu", NULL, _("Help"), NULL, NULL, NULL},
{"HelpAbout", GTK_STOCK_ABOUT, _("_About"), "<Control>A", _("About"), G_CALLBACK(menuAbout)}
};
gtk_action_group_add_actions(actionGroup, entries, G_N_ELEMENTS(entries), NULL);
globalUIManager = gtk_ui_manager_new();
gtk_ui_manager_insert_action_group(globalUIManager, actionGroup, 0);

View File

@@ -11,6 +11,7 @@
#include <glib/gi18n-lib.h>
#else
#define _(String) String
#define GETTEXT_PACKAGE "tint2conf"
#endif
#define SNAPSHOT_TICK 190

View File

@@ -0,0 +1,20 @@
include(FindGettext)
if (GETTEXT_FOUND)
set(GETTEXT_PACKAGE tint2conf)
file(GLOB POTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.po")
string(REPLACE ".po" " " LANGUAGES ${POTFILES})
message(STATUS "gettext found languages: ${LANGUAGES}")
string(REPLACE " " ";" LANGUAGES ${LANGUAGES})
if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.8")
GETTEXT_CREATE_TRANSLATIONS("${CMAKE_CURRENT_SOURCE_DIR}/tint2conf.pot" ALL ${POTFILES})
else()
foreach(LANG ${LANGUAGES})
GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES ${LANG}.po)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${DATADIR}/locale/${LANG}/LC_MESSAGES"
RENAME "${GETTEXT_PACKAGE}.mo")
endforeach ()
endif()
else ()
message(STATUS "gettext not found")
endif ()

1583
src/tint2conf/po/fr.po Normal file

File diff suppressed because it is too large Load Diff

1834
src/tint2conf/po/pl.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -51,7 +51,7 @@ extern GtkWidget *taskbar_hide_inactive_tasks, *taskbar_hide_diff_monitor;
extern GtkWidget *taskbar_name_padding_x, *taskbar_name_padding_y, *taskbar_name_inactive_color, *taskbar_name_active_color, *taskbar_name_font;
extern GtkWidget *taskbar_active_background, *taskbar_inactive_background;
extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background;
extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order;
extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment;
// task
extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;

View File

@@ -1,4 +1,3 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -273,6 +272,16 @@ void config_write_taskbar(FILE *fp)
}
fprintf(fp, "\n");
fprintf(fp, "task_align = ");
if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_alignment)) <= 0) {
fprintf(fp, "left");
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(taskbar_alignment)) == 1) {
fprintf(fp, "center");
} else {
fprintf(fp, "right");
}
fprintf(fp, "\n");
fprintf(fp, "\n");
}
@@ -625,6 +634,8 @@ void config_save_file(const char *path) {
unsigned short checksum = 0;
fprintf(fp, "#---- Generated by tint2conf %04x ----\n", checksum);
fprintf(fp, "# See https://gitlab.com/o9000/tint2/wikis/Configure for \n");
fprintf(fp, "# full documentation of the configuration options.\n");
config_write_backgrounds(fp);
config_write_panel(fp);
@@ -997,6 +1008,16 @@ void add_entry(char *key, char *value)
else
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
}
else if (strcmp(key, "task_align") == 0) {
if (strcmp(value, "left") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
else if (strcmp(value, "center") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 1);
else if (strcmp(value, "right") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 2);
else
gtk_combo_box_set_active(GTK_COMBO_BOX(taskbar_sort_order), 0);
}
else if (strcmp(key, "taskbar_padding") == 0) {
extract_values(value, &value1, &value2, &value3);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_padding_x), atoi(value1));
@@ -1413,4 +1434,4 @@ char *get_action(GtkWidget *combo)
if (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)) == 10)
return "prev_task";
return "none";
}
}

View File

@@ -1,148 +1,58 @@
[Desktop Entry]
Type=Application
Name=Panel tint2
Name[am]=ፓነል tint2
Name[ar]=الشريط tint2
Name[ast]=Panel tint2
Name[be]=Панэль tint2
Name[ca]=Quadre tint2
Name[cs]=Panel tint2
Name[da]=Panel tint2
Name[de]=Leiste tint2
Name[dz]=པེ་ནཱལ། tint2
Name[el]=Ταμπλό tint2
Name[en_GB]=Panel tint2
Name[eo]=Panelo tint2
Name[es]=Panel tint2
Name[et]=Ääreriba tint2
Name[eu]=Panela tint2
Name[fi]=Paneeli tint2
Name[fr]=Panneau tint2
Name[gl]=Panel tint2
Name[he]=לוח tint2
Name[hu]=Panel tint2
Name[id]=Panel tint2
Name[it]=Pannello tint2
Name[ja]=パネル tint2
Name[kk]=Панель tint2
Name[ko]=패널 tint2
Name[ku]=Panel tint2
Name[lv]=Panelis tint2
Name[mk]=Панел tint2
Name[nb]=Panel tint2
Name[nl]=Paneel tint2
Name[nn]=Panel tint2
Name[pa]=ਪੈਨਲ tint2
Name[pl]=Panel tint2
Name[pt]=Painel tint2
Name[pt_BR]=Painel tint2
Name[ro]=Panou tint2
Name[ru]=Панель tint2
Name[si]=පුවරුව tint2
Name[sk]=Panel tint2
Name[sq]=Panel tint2
Name[sv]=Panel tint2
Name[ta]=பலகை tint2
Name[tr]=Panel tint2
Name[ug]=panel tint2
Name[uk]=Панель tint2
Name[ur]=پینل tint2
Name[ur_PK]=پینل tint2
Name[vi]=Panel tint2
Name[zh_CN]=面板 tint2
Name[zh_TW]=面板 tint2
GenericName=Panel Manager
GenericName[am]=ፓነል አስተዳዳሪ
GenericName[ar]=مدير الائحة :
GenericName[ast]=Alministrador de panel
GenericName[be]=Кіраўнік Панэляў
GenericName[ca]=Gestor de quadres
GenericName[cs]=Správce panelu
GenericName[da]=Panelhåndtering
GenericName[de]=Leistenverwaltung
GenericName[dz]=པེ་ནཱལ་འཛིན་སྐྱོང་པ།
GenericName[el]=Διαχειριστής ταμπλό
GenericName[en_GB]=Panel Manager
GenericName[eo]=Administrilo de Panelo
GenericName[es]=Administrador de panel
GenericName[et]=Paneelihaldur
GenericName[eu]=Panel Kudeatzailea:
GenericName[fi]=Paneelin hallinta
GenericName[fr]=Gestionnaire de panneau
GenericName[gl]=Xestor de paneis
GenericName[he]=מנהל הלוח
GenericName[hu]=Panelkezelő
GenericName[id]=Manajer Panel
GenericName[it]=Gestore dei pannelli
GenericName[ja]=パネルマネージャ
GenericName[kk]=Панель менеджері
GenericName[ko]=패널 관리자
GenericName[ku]=Gerinendeyê panelan
GenericName[lv]=Paneļu pārvaldnieks
GenericName[mk]=Менаџер за панели
GenericName[nb]=Panelbehandler
GenericName[nl]=Paneel Manager
GenericName[nn]=Panelhandsamar
GenericName[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
GenericName[pl]=Panel
GenericName[pt]=Gestor do Painel
GenericName[pt_BR]=Gerenciador do painel
GenericName[ro]=Manager de panouri
GenericName[ru]=Диспетчер панелей
GenericName[si]=පුවරු කළමණාකරු
GenericName[sk]=Nastavenie panelu
GenericName[sq]=Përgjegjës Panelesh
GenericName[sv]=Panelhanterare
GenericName[ta]=பலகை மேளாலர்:
GenericName[tr]=Panel Yöneticisi
GenericName[ug]=Panel باشقۇرغۇ
GenericName[uk]=Менеджер панелей
GenericName[ur]=پینل منیجر
GenericName[ur_PK]=پینل منیجر
GenericName[vi]=Quản lý panel
GenericName[zh_CN]=面板管理器
GenericName[zh_TW]=面板管理程式
Comment=Customize the panel settings
Comment[ast]=Personalice la configuración del panel
Comment[ca]=Personalitza els ajustaments del quadre
Comment[cs]=Přizpůsobit nastavení panelu
Comment[da]=Tilpas panelets indstillinger
Comment[de]=Leiste anpassen
Comment[el]=Προσαρμογή ρυθμίσεων ταμπλό
Comment[en_GB]=Customise the panel settings
Comment[es]=Personalice la configuración del panel
Comment[et]=Ääreriba seadistamine käepäraseks
Comment[eu]=Pertsonalizatu panel ezapenak
Comment[fi]=Mukauta paneelin asetuksia
Comment[fr]=Configurer le panneau
Comment[gl]=Personalizar a configuración do panel
Comment[hu]=A panel beállításainak személyre szabása
Comment[id]=Kustomisasi pengaturan panel
Comment[it]=Personalizzazione delle impostazioni del pannello
Comment[ja]=パネルの設定をカスタマイズします
Comment[kk]=Панельді баптау
Comment[lv]=Pielāgot paneļa uzstādījumus
Comment[nb]=Tilpass panelet
Comment[nl]=Paneel configureren
Comment[nn]=Tilpass innstillingane for panelet
Comment[pl]=Konfiguruje ustawienia paneli
Comment[pt]=Personalizar as definições do painel
Comment[pt_BR]=Personalizar as configurações do painel
Comment[ro]=Schimbați opțiunile panoului
Comment[ru]=Настроить панель
Comment[si]=පුවරු සිටුවම් සකසන්න
Comment[sk]=Prispôsobiť nastavenia panelu
Comment[sq]=Përshtasni rregullimet për panelin
Comment[sv]=Anpassa panelinställningarna
Comment[ta]=நிரல்பலகை அமைப்பை தன்விருப்பமாற்றம் செய்க
Comment[tr]=Panel ayarlarını özelleştir
Comment[ug]=panel تەڭشىكىنى Customize قىلىش
Comment[uk]=Налаштувати властивості панелі
Comment[ur]=پینل کی ترتیبات
Comment[ur_PK]=پینل کی ترتیبات
Comment[zh_CN]=自定义面板设置
Name=Tint2 panel settings
Name[am]=ፓነል አስተዳዳሪ
Name[ar]=مدير الائحة :
Name[ast]=Alministrador de panel
Name[be]=Кіраўнік Панэляў
Name[ca]=Gestor de quadres
Name[cs]=Správce panelu
Name[da]=Panelhåndtering
Name[de]=Leistenverwaltung
Name[dz]=པེ་ནཱལ་འཛིན་སྐྱོང་པ།
Name[el]=Διαχειριστής ταμπλό
Name[en_GB]=Panel Manager
Name[eo]=Administrilo de Panelo
Name[es]=Administrador de panel
Name[et]=Paneelihaldur
Name[eu]=Panel Kudeatzailea:
Name[fi]=Paneelin hallinta
Name[fr]=Gestionnaire de panneau
Name[gl]=Xestor de paneis
Name[he]=מנהל הלוח
Name[hu]=Panelkezelő
Name[id]=Manajer Panel
Name[it]=Gestore dei pannelli
Name[ja]=パネルマネージャ
Name[kk]=Панель менеджері
Name[ko]=패널 관리자
Name[ku]=Gerinendeyê panelan
Name[lv]=Paneļu pārvaldnieks
Name[mk]=Менаџер за панели
Name[nb]=Panelbehandler
Name[nl]=Paneel Manager
Name[nn]=Panelhandsamar
Name[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
Name[pl]=Ustawienia panelu
Name[pt]=Gestor do Painel
Name[pt_BR]=Gerenciador do painel
Name[ro]=Manager de panouri
Name[ru]=Диспетчер панелей
Name[si]=පුවරු කළමණාකරු
Name[sk]=Nastavenie panelu
Name[sq]=Përgjegjës Panelesh
Name[sv]=Panelhanterare
Name[ta]=பலகை மேளாலர்:
Name[tr]=Panel Yöneticisi
Name[ug]=Panel باشقۇرغۇ
Name[uk]=Менеджер панелей
Name[ur]=پینل منیجر
Name[ur_PK]=پینل منیجر
Name[vi]=Quản lý panel
Name[zh_CN]=面板管理器
Name[zh_TW]=面板管理程式
Exec=tint2conf
Icon=taskbar
Icon=tint2conf
Terminal=false
Categories=Settings;DesktopSettings;

509
src/tint2conf/tint2conf.svg Normal file
View File

@@ -0,0 +1,509 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="48"
height="48"
id="svg1325"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="tint2conf.svg"
inkscape:export-filename="/home/omega_dist/4_devel_open_source/9_tint/tint2/src/tint2conf/tint2conf.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<metadata
id="metadata50">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1768"
inkscape:window-height="1056"
id="namedview48"
showgrid="false"
inkscape:zoom="16"
inkscape:cx="30.824904"
inkscape:cy="2.1959811"
inkscape:window-x="152"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g3841" />
<defs
id="defs1327">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 24 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="48 : 24 : 1"
inkscape:persp3d-origin="24 : 16 : 1"
id="perspective52" />
<linearGradient
id="linearGradient4708">
<stop
id="stop4710"
style="stop-color:white;stop-opacity:1"
offset="0" />
<stop
id="stop4712"
style="stop-color:black;stop-opacity:1"
offset="0.57954973" />
<stop
id="stop4714"
style="stop-color:black;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient2270">
<stop
id="stop2272"
style="stop-color:white;stop-opacity:1"
offset="0" />
<stop
id="stop2274"
style="stop-color:white;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
x1="20"
y1="18"
x2="20"
y2="46"
id="linearGradient2851"
xlink:href="#linearGradient2270"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0,-9.9999992)" />
<linearGradient
x1="30"
y1="17"
x2="30"
y2="47"
id="linearGradient2854"
xlink:href="#linearGradient2181"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0,-9.9999992)" />
<linearGradient
x1="63.397362"
y1="-12.489107"
x2="63.397362"
y2="5.4675598"
id="linearGradient2685"
xlink:href="#linearGradient4873"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5436509,0,0,1.5436158,-80.015712,21.419381)" />
<linearGradient
id="linearGradient4873">
<stop
id="stop4875"
style="stop-color:white;stop-opacity:1"
offset="0" />
<stop
id="stop4877"
style="stop-color:white;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
cx="23.895569"
cy="3.9900031"
r="20.397499"
fx="23.895569"
fy="3.9900031"
id="radialGradient2688"
xlink:href="#linearGradient3242-187-536"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,1.7008781,-2.245129,0,24.958071,-40.236051)" />
<linearGradient
id="linearGradient3242-187-536">
<stop
id="stop2778"
style="stop-color:#8badea;stop-opacity:1"
offset="0" />
<stop
id="stop2780"
style="stop-color:#6396cd;stop-opacity:1"
offset="0.26238" />
<stop
id="stop2782"
style="stop-color:#3b7caf;stop-opacity:1"
offset="0.66093999" />
<stop
id="stop2784"
style="stop-color:#194c70;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="18.379412"
y1="44.980297"
x2="18.379412"
y2="3.0816143"
id="linearGradient2690"
xlink:href="#linearGradient2490-182-124"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.7126612,0,0,0.7126613,-1.1038706,-1.1038704)" />
<linearGradient
id="linearGradient2490-182-124">
<stop
id="stop2788"
style="stop-color:#1f4b6a;stop-opacity:1"
offset="0" />
<stop
id="stop2790"
style="stop-color:#4083c2;stop-opacity:1"
offset="1" />
</linearGradient>
<radialGradient
cx="62.625"
cy="4.625"
r="10.625"
fx="62.625"
fy="4.625"
id="radialGradient2693"
xlink:href="#linearGradient8838"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.5058824,0,0,0.37647,-78.305888,26.258824)" />
<linearGradient
id="linearGradient8838">
<stop
id="stop8840"
style="stop-color:black;stop-opacity:1"
offset="0" />
<stop
id="stop8842"
style="stop-color:black;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient2181">
<stop
id="stop2183"
style="stop-color:#f0f0f0;stop-opacity:1"
offset="0" />
<stop
id="stop2185"
style="stop-color:#d3d3d3;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="50.23077"
y1="22"
x2="53"
y2="22"
id="linearGradient4720"
xlink:href="#linearGradient4708"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.3333333,0,0,1,-176.66667,0)" />
<mask
id="mask4716">
<rect
width="52"
height="32"
x="1"
y="6"
id="rect4718"
style="fill:url(#linearGradient4720);fill-opacity:1;stroke:none" />
</mask>
<linearGradient
x1="50.23077"
y1="22"
x2="53"
y2="22"
id="linearGradient4726"
xlink:href="#linearGradient4708"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.3333333,0,0,1,-176.66667,0)" />
<mask
id="mask4722">
<rect
width="52"
height="32"
x="1"
y="6"
id="rect4724"
style="fill:url(#linearGradient4726);fill-opacity:1;stroke:none" />
</mask>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4873"
id="linearGradient2861"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.8085571,0,0,0.74493792,-86.459085,24.622683)"
x1="63.397362"
y1="-12.489107"
x2="63.397362"
y2="5.4675598" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3242-187-536"
id="radialGradient2864"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,0.82083158,-2.630416,0,36.52927,-5.1317867)"
cx="23.895569"
cy="3.9900031"
fx="23.895569"
fy="3.9900031"
r="20.397499" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2490-182-124"
id="linearGradient2866"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.83496113,0,0,0.34392523,5.994833,13.753123)"
x1="18.379412"
y1="44.980297"
x2="18.379412"
y2="3.0816143" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient8838"
id="radialGradient2869"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7643072,0,0,0.18168172,-84.455838,26.958163)"
cx="62.625"
cy="4.625"
fx="62.625"
fy="4.625"
r="10.625" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient8838"
id="radialGradient2876"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.7643072,0,0,0.18168172,-84.455838,26.958163)"
cx="62.625"
cy="4.625"
fx="62.625"
fy="4.625"
r="10.625" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3242-187-536"
id="radialGradient2878"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0,0.82083158,-2.630416,0,36.52927,-5.1317867)"
cx="23.895569"
cy="3.9900031"
fx="23.895569"
fy="3.9900031"
r="20.397499" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2490-182-124"
id="linearGradient2880"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.83496113,0,0,0.34392523,5.994833,13.753123)"
x1="18.379412"
y1="44.980297"
x2="18.379412"
y2="3.0816143" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4873"
id="linearGradient2882"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.8085571,0,0,0.74493792,-86.459085,24.622683)"
x1="63.397362"
y1="-12.489107"
x2="63.397362"
y2="5.4675598" />
<inkscape:perspective
id="perspective2924"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
x1="30"
y1="17"
x2="30"
y2="47"
id="linearGradient2854-0"
xlink:href="#linearGradient2181-7"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0,-9.9999992)" />
<linearGradient
id="linearGradient2181-7">
<stop
id="stop2183-8"
style="stop-color:#f0f0f0;stop-opacity:1"
offset="0" />
<stop
id="stop2185-6"
style="stop-color:#d3d3d3;stop-opacity:1"
offset="1" />
</linearGradient>
<mask
id="mask4722-8">
<rect
width="52"
height="32"
x="1"
y="6"
id="rect4724-8"
style="fill:url(#linearGradient4726-4);fill-opacity:1;stroke:none" />
</mask>
<linearGradient
x1="50.23077"
y1="22"
x2="53"
y2="22"
id="linearGradient4726-4"
xlink:href="#linearGradient4708-3"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.3333333,0,0,1,-176.66667,0)" />
<linearGradient
id="linearGradient4708-3">
<stop
id="stop4710-1"
style="stop-color:white;stop-opacity:1"
offset="0" />
<stop
id="stop4712-4"
style="stop-color:black;stop-opacity:1"
offset="0.57954973" />
<stop
id="stop4714-9"
style="stop-color:black;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
y2="47"
x2="30"
y1="17"
x1="30"
gradientTransform="translate(0,-9.9999992)"
gradientUnits="userSpaceOnUse"
id="linearGradient2940"
xlink:href="#linearGradient2181-7"
inkscape:collect="always" />
<inkscape:perspective
id="perspective2894"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<rect
width="46"
height="29"
x="2.5"
y="7.5"
mask="url(#mask4722)"
id="rect1333"
style="fill:url(#linearGradient2854);fill-opacity:1;stroke:#2c2c2c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
transform="translate(-0.20338983,3.4237288)" />
<rect
width="45"
height="27"
x="3.5"
y="8.5"
mask="url(#mask4716)"
id="rect2210"
style="opacity:0.7;fill:none;stroke:url(#linearGradient2851);stroke-width:0.99999976;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
transform="translate(-0.20338983,3.4237288)" />
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#333424;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.69999999999999996"
id="rect6306"
width="29.45332"
height="9.5719652"
x="10.697065"
y="21.044527"
rx="1.4456253"
ry="1.6443363" />
<g
id="g3841"
transform="translate(130.875,44.5)">
<path
sodipodi:nodetypes="csscccsscc"
inkscape:connector-curvature="0"
id="path3833"
d="M -71.433946,14.735703 C -80.071947,4.6612321 -89.248707,-5.737975 -92.147263,-9.1977463 c -3.224562,-3.8488997 -3.263797,-3.3549747 -1.493188,-4.5254517 l 1.278694,-0.845292 14.113986,16.2862263 14.113987,16.2862257 -1.004295,0.889458 c -0.552362,0.489201 -1.149443,0.973153 -1.326848,1.075448 -0.259255,0.149489 -1.234399,-0.877491 -4.969019,-5.233165 z"
style="fill:#87aade" />
<path
sodipodi:nodetypes="cscsssc"
inkscape:connector-curvature="0"
id="path3825"
d="m -98.105823,-13.116897 c -0.09278,-0.307786 -1.541317,-8.963836 -1.697567,-8.726554 -0.0244,0.03706 7.876058,3.167414 7.876435,3.661796 0.27526,-0.22635 0.628731,0.02647 0.174381,0.954172 -0.406614,0.830238 -0.712942,1.441488 -2.270947,2.615226 -0.993109,0.748168 -2.553662,1.682052 -2.971367,1.846131 -0.688741,0.270545 -1.081414,0.266981 -1.110935,-0.350771 z"
style="fill:#e9c6af" />
<path
sodipodi:nodetypes="scscscsss"
inkscape:connector-curvature="0"
id="path3831"
d="m -77.291221,0.7427987 -14.60455,-16.3513767 0.637035,-0.730536 c 0.266185,-0.305255 0.324002,-1.389769 0.39974,-1.43161 0.07574,-0.04184 6.588518,8.0823714 14.511041,17.25171965 l 14.404588,16.67154235 -0.456991,0.486444 c -0.251345,0.267543 -0.509994,0.486443 -0.574776,0.486443 -0.06478,0 -6.507022,-7.3721814 -14.316087,-16.3826263 z"
style="fill:#afc6e9" />
<path
sodipodi:nodetypes="sssssscs"
inkscape:connector-curvature="0"
id="path3835"
d="m -72.642373,17.731344 c -15.785516,-18.3468257 -22.67882,-27.078419 -24.317731,-29.175546 -0.237129,-0.303427 -0.02287,-0.396673 0.25262,-0.547032 0.446221,-0.24354 0.48891,-0.24519 1.064375,0.556916 0.626398,0.873099 10.342493,12.0396466 21.114327,24.608034 6.242539,7.283685 7.651572,8.214809 7.295404,8.484526 -0.209506,0.158654 -1.332932,1.444171 -1.357614,0.66226 -0.39968,0.56189 -2.205614,-2.443908 -4.051381,-4.589158 z"
style="fill:#3771c8" />
<path
inkscape:connector-curvature="0"
id="path3837"
d="m -99.864407,-18.915254 3.050848,-2.237288"
style="fill:#0b2822;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path3049"
d="m -98.144068,-11.76536 29.460805,34.842161 7.728814,-6.711865 -29.898305,-34.576271"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="path3823"
d="m -98.112288,-12.03125 2.174788,-0.688559 3.864407,-2.847458 1.079449,-2.691208 -9.621826,-4.630826 z"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccscccsscc"
inkscape:connector-curvature="0"
id="path3827"
d="m -80.955348,4.2773755 c -7.750968,-9.0443333 -14.97509,-16.8628515 -14.945966,-16.9543465 0.02912,-0.09149 1.512719,-0.624766 2.1979,-1.135322 l 1.426197,-1.062718 14.171177,16.60582 14.202426,16.387071 -0.88474,0.775212 c -0.486606,0.426368 -1.11724,0.948927 -1.401408,1.161244 l -0.516667,0.386032 z"
style="fill:#5f8dd3" />
<path
inkscape:connector-curvature="0"
id="path3829"
d="m -83.124992,5.0906125 c -7.869016,-9.1612493 -14.285686,-16.7328745 -14.259267,-16.8258325 0.02642,-0.09296 0.288522,-0.270134 0.582452,-0.393722 0.525603,-0.220999 0.770084,0.05025 14.820977,16.4434263 l 14.286559,16.6681317 -0.492096,0.387084 c -0.270652,0.212894 -0.523421,0.384976 -0.561709,0.382405 -0.03829,-0.0026 -6.507899,-7.500244 -14.376916,-16.6614925 l 0,0 z"
style="fill:#3771c8" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3051"
d="m -96.265889,-12.891949 29.350635,34.044492"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path3053"
d="m -92.338983,-15.661017 29.084746,33.559322"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="scscccccs"
inkscape:connector-curvature="0"
id="path3839"
d="m -100.69352,-20.893751 c -0.0917,-0.34644 -0.71612,-3.00338 -0.8271,-3.157561 0.0437,-0.0437 2.636115,1.39898 2.993406,1.577103 l 1.143051,0.524237 -0.435163,0.963572 -0.709103,0.627398 -0.787319,0.476477 -1.110472,0.181053 c 0.17185,0.510627 -0.0972,-0.549821 -0.2673,-1.192279 z"
style="fill:#5f8dd3;fill-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -76,7 +76,7 @@ void init_rendering(void *obj, int pos)
Area *a = (Area*)obj;
// initialize fixed position/size
GSList *l;
GList *l;
for (l = a->list; l ; l = l->next) {
Area *child = ((Area*)l->data);
if (panel_horizontal) {
@@ -102,7 +102,7 @@ void rendering(void *obj)
Panel *panel = (Panel*)obj;
size_by_content(&panel->area);
size_by_layout(&panel->area, 0, 1);
size_by_layout(&panel->area, 1);
refresh(&panel->area);
}
@@ -111,10 +111,11 @@ void rendering(void *obj)
void size_by_content (Area *a)
{
// don't resize hiden objects
if (!a->on_screen) return;
if (!a->on_screen)
return;
// children node are resized before its parent
GSList *l;
GList *l;
for (l = a->list; l ; l = l->next)
size_by_content(l->data);
@@ -134,14 +135,15 @@ void size_by_content (Area *a)
}
void size_by_layout (Area *a, int pos, int level)
void size_by_layout (Area *a, int level)
{
// don't resize hiden objects
if (!a->on_screen) return;
if (!a->on_screen)
return;
// parent node is resized before its children
// calculate area's size
GSList *l;
GList *l;
if (a->resize && a->size_mode == SIZE_BY_LAYOUT) {
a->resize = 0;
@@ -156,40 +158,103 @@ void size_by_layout (Area *a, int pos, int level)
}
}
// update position of childs
pos += a->paddingxlr + a->bg->border.width;
int i=0;
for (l = a->list; l ; l = l->next) {
Area *child = ((Area*)l->data);
if (!child->on_screen) continue;
i++;
if (panel_horizontal) {
if (pos != child->posx) {
// pos changed => redraw
child->posx = pos;
child->on_changed = 1;
// update position of children
if (a->list) {
if (a->alignment == ALIGN_LEFT) {
int pos = (panel_horizontal ? a->posx : a->posy) + a->bg->border.width + a->paddingxlr;
for (l = a->list; l ; l = l->next) {
Area *child = ((Area*)l->data);
if (!child->on_screen)
continue;
if (panel_horizontal) {
if (pos != child->posx) {
// pos changed => redraw
child->posx = pos;
child->on_changed = 1;
}
} else {
if (pos != child->posy) {
// pos changed => redraw
child->posy = pos;
child->on_changed = 1;
}
}
size_by_layout(child, level+1);
pos += panel_horizontal ? child->width + a->paddingx : child->height + a->paddingx;
}
} else if (a->alignment == ALIGN_RIGHT) {
int pos = (panel_horizontal ? a->posx + a->width : a->posy + a->height) - a->bg->border.width - a->paddingxlr;
for (l = g_list_last(a->list); l ; l = l->prev) {
Area *child = ((Area*)l->data);
if (!child->on_screen)
continue;
pos -= panel_horizontal ? child->width : child->height;
if (panel_horizontal) {
if (pos != child->posx) {
// pos changed => redraw
child->posx = pos;
child->on_changed = 1;
}
} else {
if (pos != child->posy) {
// pos changed => redraw
child->posy = pos;
child->on_changed = 1;
}
}
size_by_layout(child, level+1);
pos -= a->paddingx;
}
} else if (a->alignment == ALIGN_CENTER) {
int children_size = 0;
for (l = a->list; l ; l = l->next) {
Area *child = ((Area*)l->data);
if (!child->on_screen)
continue;
children_size += panel_horizontal ? child->width : child->height;
children_size += (l == a->list) ? 0 : a->paddingx;
}
int pos = (panel_horizontal ? a->posx : a->posy) + a->bg->border.width + a->paddingxlr;
pos += ((panel_horizontal ? a->width : a->height) - children_size) / 2;
for (l = a->list; l ; l = l->next) {
Area *child = ((Area*)l->data);
if (!child->on_screen)
continue;
if (panel_horizontal) {
if (pos != child->posx) {
// pos changed => redraw
child->posx = pos;
child->on_changed = 1;
}
} else {
if (pos != child->posy) {
// pos changed => redraw
child->posy = pos;
child->on_changed = 1;
}
}
size_by_layout(child, level+1);
pos += panel_horizontal ? child->width + a->paddingx : child->height + a->paddingx;
}
}
else {
if (pos != child->posy) {
// pos changed => redraw
child->posy = pos;
child->on_changed = 1;
}
}
/*// position of each visible object
int k;
for (k=0 ; k < level ; k++) printf(" ");
printf("tree level %d, object %d, pos %d, %s\n", level, i, pos, (child->size_mode == SIZE_BY_LAYOUT) ? "SIZE_BY_LAYOUT" : "SIZE_BY_CONTENT");*/
size_by_layout(child, pos, level+1);
if (panel_horizontal)
pos += child->width + a->paddingx;
else
pos += child->height + a->paddingx;
}
}
if (a->on_changed) {
// pos/size changed
@@ -209,7 +274,7 @@ void refresh (Area *a)
if (a->redraw) {
a->redraw = 0;
// force redraw of child
//GSList *l;
//GList *l;
//for (l = a->list ; l ; l = l->next)
//((Area*)l->data)->redraw = 1;
@@ -222,7 +287,7 @@ void refresh (Area *a)
XCopyArea (server.dsp, a->pix, ((Panel *)a->panel)->temp_pmap, server.gc, 0, 0, a->width, a->height, a->posx, a->posy);
// and then refresh child object
GSList *l;
GList *l;
for (l = a->list; l ; l = l->next)
refresh(l->data);
}
@@ -236,7 +301,7 @@ int resize_by_layout(void *obj, int maximum_size)
if (panel_horizontal) {
// detect free size for SIZE_BY_LAYOUT's Area
size = a->width - (2 * (a->paddingxlr + a->bg->border.width));
GSList *l;
GList *l;
for (l = a->list ; l ; l = l->next) {
child = (Area*)l->data;
if (child->on_screen && child->size_mode == SIZE_BY_CONTENT) {
@@ -278,7 +343,7 @@ int resize_by_layout(void *obj, int maximum_size)
else {
// detect free size for SIZE_BY_LAYOUT's Area
size = a->height - (2 * (a->paddingxlr + a->bg->border.width));
GSList *l;
GList *l;
for (l = a->list ; l ; l = l->next) {
child = (Area*)l->data;
if (child->on_screen && child->size_mode == SIZE_BY_CONTENT) {
@@ -291,7 +356,7 @@ int resize_by_layout(void *obj, int maximum_size)
if (nb_by_content+nb_by_layout)
size -= ((nb_by_content+nb_by_layout-1) * a->paddingx);
int height=0, modulo=0, old_height;
int height=0, modulo=0;
if (nb_by_layout) {
height = size / nb_by_layout;
modulo = size % nb_by_layout;
@@ -305,7 +370,7 @@ int resize_by_layout(void *obj, int maximum_size)
for (l = a->list ; l ; l = l->next) {
child = (Area*)l->data;
if (child->on_screen && child->size_mode == SIZE_BY_LAYOUT) {
old_height = child->height;
int old_height = child->height;
child->height = height;
if (modulo) {
child->height++;
@@ -324,7 +389,7 @@ void set_redraw (Area *a)
{
a->redraw = 1;
GSList *l;
GList *l;
for (l = a->list ; l ; l = l->next)
set_redraw(l->data);
}
@@ -438,7 +503,7 @@ void remove_area (Area *a)
{
Area *parent = (Area*)a->parent;
parent->list = g_slist_remove(parent->list, a);
parent->list = g_list_remove(parent->list, a);
set_redraw (parent);
}
@@ -448,7 +513,7 @@ void add_area (Area *a)
{
Area *parent = (Area*)a->parent;
parent->list = g_slist_append(parent->list, a);
parent->list = g_list_append(parent->list, a);
set_redraw (parent);
}
@@ -459,12 +524,12 @@ void free_area (Area *a)
if (!a)
return;
GSList *l0;
GList *l0;
for (l0 = a->list; l0 ; l0 = l0->next)
free_area (l0->data);
if (a->list) {
g_slist_free(a->list);
g_list_free(a->list);
a->list = 0;
}
if (a->pix) {

View File

@@ -51,6 +51,7 @@ typedef struct
// SIZE_BY_LAYOUT objects : taskbar and task
// SIZE_BY_CONTENT objects : clock, battery, launcher, systray
enum { SIZE_BY_LAYOUT, SIZE_BY_CONTENT };
enum { ALIGN_LEFT = 0, ALIGN_CENTER = 1, ALIGN_RIGHT = 2 };
typedef struct {
// coordinate relative to panel window
@@ -61,13 +62,15 @@ typedef struct {
Background *bg;
// list of child : Area object
GSList *list;
GList *list;
// object visible on screen.
// An object (like systray) could be enabled but hidden (because no tray icon).
int on_screen;
// way to calculate the size (SIZE_BY_CONTENT or SIZE_BY_LAYOUT)
int size_mode;
int alignment;
// need to calculate position and width
int resize;
// need redraw Pixmap
@@ -96,7 +99,7 @@ void init_rendering(void *obj, int pos);
void rendering(void *obj);
void size_by_content (Area *a);
void size_by_layout (Area *a, int pos, int level);
void size_by_layout (Area *a, int level);
// draw background and foreground
void refresh (Area *a);

View File

@@ -49,9 +49,7 @@ struct _timeout {
void add_timeout_intern(int value_msec, int interval_msec, void(*_callback)(void*), void* arg, timeout* t);
gint compare_timeouts(gconstpointer t1, gconstpointer t2);
gint compare_timespecs(const struct timespec* t1, const struct timespec* t2);
int timespec_subtract(struct timespec* result, struct timespec* x, struct timespec* y);
struct timespec add_msec_to_timespec(struct timespec ts, int msec);
int align_with_existing_timeouts(timeout* t);

View File

@@ -20,6 +20,8 @@
#define TIMER_H
#include <glib.h>
#include <time.h>
#include <sys/time.h>
extern struct timeval next_timeout;
@@ -66,4 +68,9 @@ void update_next_timeout();
/** Callback of all expired timeouts **/
void callback_timeout_expired();
/** Returns -1 if t1 < t2, 0 if t1 == t2, 1 if t1 > t2 **/
gint compare_timespecs(const struct timespec* t1, const struct timespec* t2);
struct timespec add_msec_to_timespec(struct timespec ts, int msec);
#endif // TIMER_H

61
tint2.desktop Normal file
View File

@@ -0,0 +1,61 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Tint2 panel
Name[am]=ፓነል tint2
Name[ar]=الشريط tint2
Name[ast]=Panel tint2
Name[be]=Панэль tint2
Name[ca]=Quadre tint2
Name[cs]=Panel tint2
Name[da]=Panel tint2
Name[de]=Leiste tint2
Name[dz]=པེ་ནཱལ། tint2
Name[el]=Ταμπλό tint2
Name[en_GB]=Panel tint2
Name[eo]=Panelo tint2
Name[es]=Panel tint2
Name[et]=Ääreriba tint2
Name[eu]=Panela tint2
Name[fi]=Paneeli tint2
Name[fr]=Panneau tint2
Name[gl]=Panel tint2
Name[he]=לוח tint2
Name[hu]=Panel tint2
Name[id]=Panel tint2
Name[it]=Pannello tint2
Name[ja]=パネル tint2
Name[kk]=Панель tint2
Name[ko]=패널 tint2
Name[ku]=Panel tint2
Name[lv]=Panelis tint2
Name[mk]=Панел tint2
Name[nb]=Panel tint2
Name[nl]=Paneel tint2
Name[nn]=Panel tint2
Name[pa]=ਪੈਨਲ tint2
Name[pl]=Panel tint2
Name[pt]=Painel tint2
Name[pt_BR]=Painel tint2
Name[ro]=Panou tint2
Name[ru]=Панель tint2
Name[si]=පුවරුව tint2
Name[sk]=Panel tint2
Name[sq]=Panel tint2
Name[sv]=Panel tint2
Name[ta]=பலகை tint2
Name[tr]=Panel tint2
Name[ug]=panel tint2
Name[uk]=Панель tint2
Name[ur]=پینل tint2
Name[ur_PK]=پینل tint2
Name[vi]=Panel tint2
Name[zh_CN]=面板 tint2
Name[zh_TW]=面板 tint2
Comment=Lightweight panel
Comment[fr_FR]=Panel léger
Comment[pl]=Lekki panel
Exec=tint2
Icon=taskbar
Terminal=false
Categories=System;

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB