Compare commits

...

16 Commits

Author SHA1 Message Date
o9000
487774eac9 Updated readme 2015-05-03 15:47:24 +02:00
o9000
d710eb9cea Updated readme 2015-05-03 13:46:01 +00:00
o9000
0385ca46dc Updated changelog 2015-05-03 13:44:03 +00:00
o9000
e7c3f99e28 Attempt to fix icon rendering problems 2015-05-03 15:36:42 +02:00
o9000
14d5c4e43d Updated changelog 2015-05-03 08:07:37 +00:00
o9000
a9330b424b launcher: New option launcher_icon_theme_override to preserve legacy behavior 2015-05-03 10:05:36 +02:00
o9000
5486c93f4c Updated changelog 2015-05-03 07:47:45 +00:00
o9000
b9508450b7 panel: Use WINDOW_TYPE_SPLASH instead of DOCK if panel_layer=normal and panel_dock=0 otherwise it is impossible to get normal stacking 2015-05-03 09:27:52 +02:00
o9000
7384fd8270 Battery: fixes for FreeBSD 2015-05-03 08:52:39 +02:00
o9000
7ea2452ae4 tint2conf: fixes for *BSD 2015-05-02 22:24:15 +02:00
o9000
c3b60f1b4d Fixed README in CMakeLists.txt 2015-05-02 11:07:26 +00:00
o9000
193b3b5a81 Fix build on Debian Jessie 2015-04-27 19:16:21 +02:00
o9000
9bd4257fcf Updated readme 2015-04-27 16:45:12 +00:00
o9000
5bf8efac03 Update readme 2015-04-27 16:43:27 +00:00
o9000
bd9e12b993 Wrap text at word boundaries 2015-04-26 16:33:07 +02:00
o9000
78595a3d1f Renamed notification area -> system tray for consistency 2015-04-26 15:37:25 +02:00
15 changed files with 97 additions and 59 deletions

View File

@@ -147,9 +147,9 @@ set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread -fno-strict-aliasin
install( TARGETS tint2 DESTINATION bin )
install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
install( FILES default_icon.png DESTINATION ${DATADIR}/tint2 )
install( FILES AUTHORS ChangeLog README DESTINATION ${DOCDIR} )
install( FILES AUTHORS ChangeLog README.md DESTINATION ${DOCDIR} )
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,7 +1,4 @@
2015-04-26 tint2-0.12-rc2
- Bumped RC version due to multiple bugfixes (mostly in tint2conf)
2015-04-25 tint2-0.12-rc1
2015-05-03 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)'.
@@ -12,8 +9,8 @@
- Enhancement: more thorough search for icons
- Configuration GUI: tint2conf
- Experimental, testing/feedback needed
- System tray:
- Changed rendering method to fix icon corruptions (need user feedback; see known issues)
- Icons (system tray, task buttons, launcher):
- Changed rendering method to fix icon corruptions (please report any problems)
- Many bugfixes
- New config options (see https://gitlab.com/o9000/tint2/wikis/Configure):
- Panel:
@@ -30,6 +27,7 @@
- launcher* (already released by distros)
- launcher_apps_dir (previously patched in by some distros)
- startup_notifications
- launcher_icon_theme_override
- System tray:
- systray_monitor
- Config options with changed behavior:
@@ -39,21 +37,15 @@
set it to zero (or change the border color/style to match tint2). If you set it to zero, make sure you do not have
reserved space at the edge of the screen in the OpenBox config.
Reason for change: issues 257, 394, 461, 465, 481.
- panel_layer: previously, 'panel_layer = normal' was not functioning correctly. Now it does (it requires panel_dock = 0).
Note that in this case some compositors will draw shadows of other windows behind tint2. This can be avoided in compton
using the option shadow-exclude-reg = "x35+0-0" where 35 should be replaced with the size of the panel.
- font_shadow: shadows are thicker and softer, and are now applied to all text elements, not just the taskbar.
Reason for change: legibility improved for transparent panels.
- Launcher:
- launcher_icon_theme: previously, this parameter had a lower priority than the icon theme provided through the
XSettings manager; as virtually all DEs provide one, it was useless. Now the parameter has a higher priority.
Remove it to respect the XSettings manager settings.
Reasons for change:
* ability to use a custom icon theme only in tint2
* several DEs do not allow selecting the hicolor theme
- launcher_item_app: now it expands leading ~ to the path to the user's home directory.
- Project hosting:
- Migrated from https://code.google.com/p/tint2 to https://gitlab.com/o9000/tint2 and switched from svn to git
- Known issues
- System tray:
- The opacity (alpha) in systray_icon_asb must be set to 100 otherwise icon corruptions might occur
2010-06-26
- unhide tint2 panel when dragging something

View File

@@ -1,14 +1,14 @@
### New unstable release: 0.12-rc2
### New unstable release: 0.12-rc3
Changes: https://gitlab.com/o9000/tint2/blob/master/ChangeLog
Documentation: https://gitlab.com/o9000/tint2/wikis/home
Try it out with:
Try it out with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/Install#dependencies)):
```
mkdir tint2-0.12-rc2
cd tint2-0.12-rc2
wget 'https://gitlab.com/o9000/tint2/repository/archive.tar.gz?ref=v0.12-rc2' --output-document tint2-0.12-rc2.tar.gz
tar -xzf tint2-0.12-rc2.tar.gz
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
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

@@ -188,7 +188,11 @@ void init_battery()
battery_found = 1;
}
#elif defined(__FreeBSD__)
// Nothing to do
int sysctl_out = 0;
size_t len = sizeof(sysctl_out);
battery_found = (sysctlbyname("hw.acpi.battery.state", &sysctl_out, &len, NULL, 0) == 0) ||
(sysctlbyname("hw.acpi.battery.time", &sysctl_out, &len, NULL, 0) == 0) ||
(sysctlbyname("hw.acpi.battery.life", &sysctl_out, &len, NULL, 0) == 0);
#else // Linux
GDir *directory = 0;
GError *error = NULL;

View File

@@ -664,6 +664,9 @@ void add_entry (char *key, char *value)
free(icon_theme_name_config);
icon_theme_name_config = strdup(value);
}
else if (strcmp(key, "launcher_icon_theme_override") == 0) {
launcher_icon_theme_override = atoi(value);
}
else if (strcmp(key, "launcher_icon_asb") == 0) {
extract_values(value, &value1, &value2, &value3);
launcher_alpha = atoi(value1);

View File

@@ -34,7 +34,6 @@
#ifdef HAVE_RSVG
#include <librsvg/rsvg.h>
#include <librsvg/rsvg-cairo.h>
#endif
#include "window.h"
@@ -54,6 +53,7 @@ int launcher_saturation;
int launcher_brightness;
char *icon_theme_name_config;
char *icon_theme_name_xsettings;
int launcher_icon_theme_override;
XSettingsClient *xsettings_client;
int startup_notifications;
@@ -70,6 +70,7 @@ void default_launcher()
launcher_brightness = 0;
icon_theme_name_config = NULL;
icon_theme_name_xsettings = NULL;
launcher_icon_theme_override = 0;
xsettings_client = NULL;
startup_notifications = 0;
}
@@ -355,10 +356,14 @@ void draw_launcher_icon(void *obj, cairo_t *c)
Imlib_Image icon_scaled = launcherIcon->icon_scaled;
// Render
imlib_context_set_image (icon_scaled);
imlib_context_set_blend(1);
imlib_context_set_drawable(launcherIcon->area.pix);
imlib_render_image_on_drawable(0, 0);
imlib_context_set_image(icon_scaled);
if (server.real_transparency) {
render_image(launcherIcon->area.pix, 0, 0);
} else {
imlib_context_set_blend(1);
imlib_context_set_drawable(launcherIcon->area.pix);
imlib_render_image_on_drawable(0, 0);
}
}
Imlib_Image scale_icon(Imlib_Image original, int icon_size)
@@ -367,11 +372,14 @@ Imlib_Image scale_icon(Imlib_Image original, int icon_size)
if (original) {
imlib_context_set_image (original);
icon_scaled = imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), icon_size, icon_size);
imlib_context_set_image (icon_scaled);
imlib_image_set_has_alpha(1);
DATA32* data = imlib_image_get_data();
adjust_asb(data, icon_size, icon_size, launcher_alpha, (float)launcher_saturation/100, (float)launcher_brightness/100);
imlib_image_put_back_data(data);
imlib_context_set_image (icon_scaled);
} else {
icon_scaled = imlib_create_image(icon_size, icon_size);
imlib_context_set_image (icon_scaled);
@@ -487,9 +495,15 @@ void launcher_load_icons(Launcher *launcher)
// Populates the list_themes list
void launcher_load_themes(Launcher *launcher)
{
launcher->list_themes = load_themes(icon_theme_name_config
? icon_theme_name_config
: icon_theme_name_xsettings
? icon_theme_name_xsettings
: "hicolor");
launcher->list_themes = load_themes(launcher_icon_theme_override
? (icon_theme_name_config
? icon_theme_name_config
: icon_theme_name_xsettings
? icon_theme_name_xsettings
: "hicolor")
: (icon_theme_name_xsettings
? icon_theme_name_xsettings
: icon_theme_name_config
? icon_theme_name_config
: "hicolor"));
}

View File

@@ -42,6 +42,7 @@ extern int launcher_saturation;
extern int launcher_brightness;
extern char *icon_theme_name_xsettings; // theme name
extern char *icon_theme_name_config;
extern int launcher_icon_theme_override;
extern XSettingsClient *xsettings_client;
extern int startup_notifications;

View File

@@ -524,7 +524,9 @@ void set_panel_properties(Panel *p)
}
// Dock
long val = panel_dock ? server.atom._NET_WM_WINDOW_TYPE_DOCK : server.atom._NET_WM_WINDOW_TYPE_SPLASH;
long val = (!panel_dock && panel_layer == NORMAL_LAYER)
? server.atom._NET_WM_WINDOW_TYPE_SPLASH
: server.atom._NET_WM_WINDOW_TYPE_DOCK;
XChangeProperty (server.dsp, p->main_win, server.atom._NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, (unsigned char *) &val, 1);
val = ALLDESKTOP;

View File

@@ -601,7 +601,7 @@ void systray_render_icon_now(void* t)
adjust_asb(data, traywin->width, traywin->height, systray.alpha, (float)systray.saturation/100, (float)systray.brightness/100);
imlib_image_put_back_data(data);
XCopyArea(server.dsp, render_background, systray.area.pix, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x-systray.area.posx, traywin->y-systray.area.posy);
render_image(systray.area.pix, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height);
render_image(systray.area.pix, traywin->x-systray.area.posx, traywin->y-systray.area.posy);
XCopyArea(server.dsp, systray.area.pix, panel->main_win, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x, traywin->y);
imlib_free_image_and_decache();
XFreePixmap(server.dsp, tmp_pmap);

View File

@@ -348,9 +348,13 @@ void draw_task_icon (Task *tsk, int text_width)
// Render
imlib_context_set_image (tsk->icon[tsk->current_state]);
imlib_context_set_blend(1);
imlib_context_set_drawable(tsk->area.pix);
imlib_render_image_on_drawable(pos_x, panel->g_task.icon_posy);
if (server.real_transparency) {
render_image(tsk->area.pix, pos_x, panel->g_task.icon_posy);
} else {
imlib_context_set_blend(1);
imlib_context_set_drawable(tsk->area.pix);
imlib_render_image_on_drawable(pos_x, panel->g_task.icon_posy);
}
}
@@ -374,7 +378,7 @@ void draw_task (void *obj, cairo_t *c)
// pango use U+22EF or U+2026
pango_layout_set_width(layout, ((Taskbar*)tsk->area.parent)->text_width * PANGO_SCALE);
pango_layout_set_height(layout, panel->g_task.text_height * PANGO_SCALE);
pango_layout_set_wrap(layout, PANGO_WRAP_CHAR);
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
/* Center text */

View File

@@ -115,6 +115,7 @@ GtkWidget *launcher_background;
GtkWidget *startup_notifications;
IconThemeWrapper *icon_theme;
GtkWidget *launcher_tooltip;
GtkWidget *launcher_icon_theme_override;
GtkListStore *backgrounds;
GtkWidget *current_background,
@@ -174,7 +175,7 @@ void applyClicked(GtkWidget *widget, gpointer data)
config_save_file(file);
}
int unused = system("killall -SIGUSR1 tint2");
int unused = system("killall -SIGUSR1 tint2 || pkill -SIGUSR1 -x tint2");
(void)unused;
g_free(file);
g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL);
@@ -295,7 +296,7 @@ GtkWidget *create_properties()
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), addScrollBarToWidget(page_clock), label);
create_clock(page_clock);
label = gtk_label_new(_("Notification area"));
label = gtk_label_new(_("System tray"));
gtk_widget_show(label);
page_systemtray = gtk_vbox_new(FALSE, DEFAULT_HOR_SPACING);
gtk_container_set_border_width(GTK_CONTAINER(page_systemtray), 10);
@@ -1882,7 +1883,7 @@ void create_launcher(GtkWidget *parent)
icon_theme = NULL;
launcher_apps = gtk_list_store_new(appsNumCols, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
all_apps = gtk_list_store_new(appsNumCols, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
all_apps = gtk_list_store_new(appsNumCols, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
icon_themes = gtk_list_store_new(iconsNumCols, G_TYPE_STRING, G_TYPE_STRING);
launcher_apps_view = gtk_tree_view_new();
@@ -2153,6 +2154,12 @@ void create_launcher(GtkWidget *parent)
"tint2 will detect and use the icon theme of your desktop as long as you have "
"an XSETTINGS manager running (most desktop environments do).", NULL);
launcher_icon_theme_override = gtk_check_button_new_with_label("Overrides XSETTINGS");
gtk_widget_show(launcher_icon_theme_override);
gtk_table_attach(GTK_TABLE(table), launcher_icon_theme_override, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
col++;
gtk_tooltips_set_tip(tooltips, launcher_icon_theme_override, "If enabled, the icon theme selected here will override the one provided by XSETTINGS.", NULL);
row++, col = 2;
label = gtk_label_new(_("Startup notifications"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
@@ -2198,6 +2205,7 @@ void create_launcher(GtkWidget *parent)
fprintf(stderr, "Loading .desktop files\n");
load_desktop_files("/usr/share/applications");
load_desktop_files("/usr/local/share/applications");
gchar *path = g_build_filename(g_get_home_dir(), ".local/share/applications", NULL);
load_desktop_files(path);
g_free(path);

View File

@@ -127,6 +127,7 @@ extern GtkWidget *launcher_background;
extern GtkWidget *startup_notifications;
extern IconThemeWrapper *icon_theme;
extern GtkWidget *launcher_tooltip;
extern GtkWidget *launcher_icon_theme_override;
void load_desktop_file(const char *file, gboolean selected);
void set_current_icon_theme(const char *theme);

View File

@@ -469,6 +469,7 @@ void config_write_launcher(FILE *fp)
g_free(icon_theme);
icon_theme = NULL;
}
fprintf(fp, "launcher_icon_theme_override = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(launcher_icon_theme_override)) ? 1 : 0);
fprintf(fp, "startup_notifications = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(startup_notifications)) ? 1 : 0);
fprintf(fp, "launcher_tooltip = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(launcher_tooltip)) ? 1 : 0);
@@ -1283,6 +1284,9 @@ void add_entry(char *key, char *value)
else if (strcmp(key, "launcher_icon_theme") == 0) {
set_current_icon_theme(value);
}
else if (strcmp(key, "launcher_icon_theme_override") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(launcher_icon_theme_override), atoi(value));
}
else if (strcmp(key, "launcher_tooltip") == 0) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(launcher_tooltip), atoi(value));
}

View File

@@ -363,24 +363,30 @@ void createHeuristicMask(DATA32* data, int w, int h)
}
void render_image(Drawable d, int x, int y, int w, int h)
void render_image(Drawable d, int x, int y)
{
// in real_transparency mode imlib_render_image_on_drawable does not the right thing, because
// the operation is IMLIB_OP_COPY, but we would need IMLIB_OP_OVER (which does not exist)
// Therefore we have to do it with the XRender extension (i.e. copy what imlib is doing internally)
// But first we need to render the image onto itself with PictOpIn to adjust the colors to the alpha channel
Pixmap pmap_tmp = XCreatePixmap(server.dsp, server.root_win, w, h, 32);
imlib_context_set_drawable(pmap_tmp);
int w = imlib_image_get_width(), h = imlib_image_get_height();
Pixmap pixmap = XCreatePixmap(server.dsp, server.root_win, w, h, 32);
imlib_context_set_drawable(pixmap);
imlib_context_set_blend(0);
imlib_render_image_on_drawable(0, 0);
Picture pict_image = XRenderCreatePicture(server.dsp, pmap_tmp, XRenderFindStandardFormat(server.dsp, PictStandardARGB32), 0, 0);
Pixmap mask = XCreatePixmap(server.dsp, server.root_win, w, h, 32);
imlib_context_set_drawable(mask);
imlib_context_set_blend(0);
imlib_render_image_on_drawable(0, 0);
Picture pict = XRenderCreatePicture(server.dsp, pixmap, XRenderFindStandardFormat(server.dsp, PictStandardARGB32), 0, 0);
Picture pict_drawable = XRenderCreatePicture(server.dsp, d, XRenderFindVisualFormat(server.dsp, server.visual), 0, 0);
XRenderComposite(server.dsp, PictOpIn, pict_image, None, pict_image, 0, 0, 0, 0, 0, 0, w, h);
XRenderComposite(server.dsp, PictOpOver, pict_image, None, pict_drawable, 0, 0, 0, 0, x, y, w, h);
imlib_context_set_blend(1);
XFreePixmap(server.dsp, pmap_tmp);
XRenderFreePicture(server.dsp, pict_image);
Picture pict_mask = XRenderCreatePicture(server.dsp, mask, XRenderFindStandardFormat(server.dsp, PictStandardARGB32), 0, 0);
XRenderComposite(server.dsp, PictOpOver, pict, pict_mask, pict_drawable, 0, 0, 0, 0, x, y, w, h);
XRenderFreePicture(server.dsp, pict_mask);
XRenderFreePicture(server.dsp, pict_drawable);
XRenderFreePicture(server.dsp, pict);
XFreePixmap(server.dsp, mask);
XFreePixmap(server.dsp, pixmap);
}
void draw_text(PangoLayout *layout, cairo_t *c, int posx, int posy, Color *color, int font_shadow)

View File

@@ -6,7 +6,6 @@
#ifndef COMMON_H
#define COMMON_H
#define WM_CLASS_TINT "panel"
#include <Imlib2.h>
@@ -64,7 +63,7 @@ void extract_values (const char *value, char **value1, char **value2, char **val
void adjust_asb(DATA32 *data, int w, int h, int alpha, float satur, float bright);
void createHeuristicMask(DATA32* data, int w, int h);
void render_image(Drawable d, int x, int y, int w, int h);
void render_image(Drawable d, int x, int y);
void draw_text(PangoLayout *layout, cairo_t *c, int posx, int posy, Color *color, int font_shadow);