Compare commits

...

3 Commits

Author SHA1 Message Date
o9000
71f8a01d48 Release 0.12.5 2016-01-24 14:15:31 +01:00
o9000
418119a1ab Refactor a bit the last change 2016-01-24 13:59:37 +01:00
o9000
1ecfdf5289 Fix bad clear of panel pixmap when display compositing is disabled 2016-01-24 13:39:52 +01:00
6 changed files with 57 additions and 59 deletions

View File

@@ -1,3 +1,7 @@
2016-01-24 0.12.5
- Fixes:
- Fix rendering corruption triggered occasionally when the compositor is disabled (regression in 0.12.4)
2016-01-23 0.12.4 2016-01-23 0.12.4
- Enhancements: - Enhancements:
- Support for NETWM viewports (as used by Compiz or Unity) (issue #94) - Support for NETWM viewports (as used by Compiz or Unity) (issue #94)

View File

@@ -1,5 +1,5 @@
# New stable release: 0.12.4 # New stable release: 0.12.5
Changes: https://gitlab.com/o9000/tint2/blob/0.12.4/ChangeLog Changes: https://gitlab.com/o9000/tint2/blob/0.12.5/ChangeLog
Documentation: https://gitlab.com/o9000/tint2/wikis/Configure Documentation: https://gitlab.com/o9000/tint2/wikis/Configure
@@ -7,7 +7,7 @@ Try it out with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/In
``` ```
git clone https://gitlab.com/o9000/tint2.git git clone https://gitlab.com/o9000/tint2.git
cd tint2 cd tint2
git checkout 0.12.4 git checkout 0.12.5
mkdir build mkdir build
cd build cd build
cmake .. cmake ..

View File

@@ -34,6 +34,8 @@
#include "panel.h" #include "panel.h"
#include "tooltip.h" #include "tooltip.h"
void panel_clear_background(void *obj);
int signal_pending; int signal_pending;
MouseAction mouse_left; MouseAction mouse_left;
@@ -198,6 +200,7 @@ void init_panel()
p->area.resize_needed = 1; p->area.resize_needed = 1;
p->area.size_mode = LAYOUT_DYNAMIC; p->area.size_mode = LAYOUT_DYNAMIC;
p->area._resize = resize_panel; p->area._resize = resize_panel;
p->area._clear = panel_clear_background;
init_panel_size_and_position(p); init_panel_size_and_position(p);
// add children according to panel_items // add children according to panel_items
for (int k = 0; k < strlen(panel_items_order); k++) { for (int k = 0; k < strlen(panel_items_order); k++) {
@@ -688,75 +691,40 @@ void set_panel_properties(Panel *p)
XFree(classhint); XFree(classhint);
} }
void set_panel_background(Panel *p) void panel_clear_background(void *obj)
{ {
if (p->area.pix) Panel *p = obj;
XFreePixmap(server.display, p->area.pix); clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height);
p->area.pix = XCreatePixmap(server.display, server.root_win, p->area.width, p->area.height, server.depth); if (!server.real_transparency) {
int xoff = 0, yoff = 0;
if (panel_horizontal && panel_position & BOTTOM)
yoff = p->area.height - p->hidden_height;
else if (!panel_horizontal && panel_position & RIGHT)
xoff = p->area.width - p->hidden_width;
if (server.real_transparency) {
clear_pixmap(p->area.pix, 0, 0, p->area.width, p->area.height);
} else {
get_root_pixmap(); get_root_pixmap();
// copy background (server.root_pmap) in panel.area.pix // copy background (server.root_pmap) in panel.area.pix
Window dummy; Window dummy;
int x, y; int x, y;
XTranslateCoordinates(server.display, p->main_win, server.root_win, 0, 0, &x, &y, &dummy); XTranslateCoordinates(server.display, p->main_win, server.root_win, 0, 0, &x, &y, &dummy);
if (panel_autohide && p->is_hidden) { if (panel_autohide && p->is_hidden) {
int xoff = 0, yoff = 0;
if (panel_horizontal && panel_position & BOTTOM)
yoff = p->area.height - p->hidden_height;
else if (!panel_horizontal && panel_position & RIGHT)
xoff = p->area.width - p->hidden_width;
x -= xoff; x -= xoff;
y -= yoff; y -= yoff;
} }
XSetTSOrigin(server.display, server.gc, -x, -y); XSetTSOrigin(server.display, server.gc, -x, -y);
XFillRectangle(server.display, p->area.pix, server.gc, 0, 0, p->area.width, p->area.height); XFillRectangle(server.display, p->area.pix, server.gc, 0, 0, p->area.width, p->area.height);
} }
}
// draw background panel void set_panel_background(Panel *p)
cairo_surface_t *cs = cairo_xlib_surface_create(server.display, p->area.pix, server.visual, p->area.width, p->area.height); {
cairo_t *c = cairo_create(cs); panel_clear_background(p);
draw_background(&p->area, c); schedule_redraw(&p->area);
cairo_destroy(c);
cairo_surface_destroy(cs);
if (panel_autohide) { if (p->hidden_pixmap) {
if (p->hidden_pixmap) XFreePixmap(server.display, p->hidden_pixmap);
XFreePixmap(server.display, p->hidden_pixmap); p->hidden_pixmap = 0;
p->hidden_pixmap = XCreatePixmap(server.display, server.root_win, p->hidden_width, p->hidden_height, server.depth);
XCopyArea(server.display,
p->area.pix,
p->hidden_pixmap,
server.gc,
xoff,
yoff,
p->hidden_width,
p->hidden_height,
0,
0);
}
// redraw panel's object
for (GList *l = p->area.children; l; l = l->next) {
Area *a = (Area *)l->data;
schedule_redraw(a);
}
// reset task/taskbar 'state_pix'
Taskbar *taskbar;
for (int i = 0; i < p->num_desktops; i++) {
taskbar = &p->taskbar[i];
schedule_redraw(&taskbar->area);
schedule_redraw(&taskbar->bar_name.area);
GList *l = taskbar->area.children;
if (taskbarname_enabled)
l = l->next;
for (; l; l = l->next) {
schedule_redraw((Area *)l->data);
}
} }
} }

View File

@@ -1484,6 +1484,24 @@ start:
Panel *panel = &panels[i]; Panel *panel = &panels[i];
if (panel->is_hidden) { if (panel->is_hidden) {
if (!panel->hidden_pixmap) {
panel->hidden_pixmap = XCreatePixmap(server.display, server.root_win, panel->hidden_width, panel->hidden_height, server.depth);
int xoff = 0, yoff = 0;
if (panel_horizontal && panel_position & BOTTOM)
yoff = panel->area.height - panel->hidden_height;
else if (!panel_horizontal && panel_position & RIGHT)
xoff = panel->area.width - panel->hidden_width;
XCopyArea(server.display,
panel->area.pix,
panel->hidden_pixmap,
server.gc,
xoff,
yoff,
panel->hidden_width,
panel->hidden_height,
0,
0);
}
XCopyArea(server.display, XCopyArea(server.display,
panel->hidden_pixmap, panel->hidden_pixmap,
panel->main_win, panel->main_win,

View File

@@ -379,9 +379,14 @@ void draw(Area *a)
a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] = a->pix; a->pix_by_state[a->has_mouse_over_effect ? a->mouse_state : 0] = a->pix;
// Add layer of root pixmap (or clear pixmap if real_transparency==true) // Add layer of root pixmap (or clear pixmap if real_transparency==true)
if (server.real_transparency) if (!a->_clear) {
clear_pixmap(a->pix, 0, 0, a->width, a->height); clear_pixmap(a->pix, 0, 0, a->width, a->height);
XCopyArea(server.display, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0); if (!server.real_transparency) {
XCopyArea(server.display, ((Panel *)a->panel)->temp_pmap, a->pix, server.gc, a->posx, a->posy, a->width, a->height, 0, 0);
}
} else {
a->_clear(a);
}
cairo_surface_t *cs = cairo_xlib_surface_create(server.display, a->pix, server.visual, a->width, a->height); cairo_surface_t *cs = cairo_xlib_surface_create(server.display, a->pix, server.visual, a->width, a->height);
cairo_t *c = cairo_create(cs); cairo_t *c = cairo_create(cs);

View File

@@ -202,6 +202,9 @@ typedef struct Area {
// Callbacks // Callbacks
// Called on draw before any drawing takes place, obj = pointer to the Area
void (*_clear)(void *obj);
// Called on draw, obj = pointer to the Area // Called on draw, obj = pointer to the Area
void (*_draw_foreground)(void *obj, cairo_t *c); void (*_draw_foreground)(void *obj, cairo_t *c);