Pseudo-trans update fixes (Tres Melton).
SVN revision: 15126
This commit is contained in:
parent
d5527acf70
commit
f58025c168
6
src/E.h
6
src/E.h
|
@ -1866,13 +1866,17 @@ void ICCCM_ProcessPropertyChange(EWin * ewin, Atom atom_change);
|
|||
|
||||
/* iclass.c */
|
||||
int ImageclassConfigLoad(FILE * fs);
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
void TransparencySet(int transparency);
|
||||
int TransparencyEnabled(void);
|
||||
int TransparencyUpdateNeeded(void);
|
||||
int ImageclassIsTransparent(ImageClass * ic);
|
||||
#endif
|
||||
ImageState *ImageclassGetImageState(ImageClass * ic, int state,
|
||||
int active, int sticky);
|
||||
ImageClass *ImageclassCreateSimple(const char *name, const char *image);
|
||||
ImageClass *ImageclassFind(const char *name, int fallback);
|
||||
int ImageclassIsTransparent(ImageClass * ic);
|
||||
Imlib_Image *ImageclassGetImage(ImageClass * ic, int active, int sticky,
|
||||
int state);
|
||||
void ImageclassApply(ImageClass * ic, Window win, int w, int h,
|
||||
|
|
|
@ -524,7 +524,7 @@ DialogEwinMoveResize(EWin * ewin, int resize __UNUSED__)
|
|||
if (!d || Mode.mode != MODE_NONE)
|
||||
return;
|
||||
|
||||
if (TransparencyEnabled() || ImageclassIsTransparent(d->iclass))
|
||||
if (TransparencyUpdateNeeded() || ImageclassIsTransparent(d->iclass))
|
||||
DialogRedraw(d);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ typedef enum
|
|||
ESIGNAL_EWIN_DEICONIFY,
|
||||
ESIGNAL_EWIN_CHANGE_ICON,
|
||||
ESIGNAL_EWIN_CHANGE,
|
||||
ESIGNAL_THEME_TRANS_CHANGE,
|
||||
} e_signal_t;
|
||||
|
||||
#if 0 /* Maybe later */
|
||||
|
|
|
@ -473,7 +473,7 @@ doMoveResizeEwin(EWin * ewin, int desk, int x, int y, int w, int h, int flags)
|
|||
|
||||
if (Mode.mode == MODE_NONE)
|
||||
{
|
||||
if (TransparencyEnabled())
|
||||
if (TransparencyUpdateNeeded())
|
||||
EwinBorderDraw(ewin, resize, 1); /* Update the border */
|
||||
|
||||
SnapshotEwinUpdate(ewin, SNAP_USE_POS | SNAP_USE_SIZE);
|
||||
|
|
16
src/ewins.c
16
src/ewins.c
|
@ -1905,6 +1905,10 @@ EwinsInit(void)
|
|||
static void
|
||||
EwinsSighan(int sig, void *prm __UNUSED__)
|
||||
{
|
||||
EWin *ewin;
|
||||
EWin **ewin_lst;
|
||||
int win_cnt, i;
|
||||
|
||||
switch (sig)
|
||||
{
|
||||
case ESIGNAL_INIT:
|
||||
|
@ -1923,6 +1927,18 @@ EwinsSighan(int sig, void *prm __UNUSED__)
|
|||
case ESIGNAL_DESK_RESIZE:
|
||||
EwinsTouch();
|
||||
break;
|
||||
case ESIGNAL_THEME_TRANS_CHANGE:
|
||||
case ESIGNAL_BACKGROUND_CHANGE:
|
||||
/* FIXME - Only visible windows */
|
||||
/* FIXME - BG: Only affected desk */
|
||||
ewin_lst = (EWin **) EwinListStackGet(&win_cnt);
|
||||
for (i = 0; i < win_cnt; i++)
|
||||
{
|
||||
ewin = ewin_lst[i];
|
||||
if (EwinIsMapped(ewin))
|
||||
ResizeEwin(ewin, ewin->client.w, ewin->client.h);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
47
src/iclass.c
47
src/iclass.c
|
@ -24,17 +24,28 @@
|
|||
#include "E.h"
|
||||
#include "conf.h"
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
|
||||
static Imlib_Color_Modifier *icm = NULL;
|
||||
static DATA8 gray[256];
|
||||
static DATA8 alpha[256];
|
||||
|
||||
static int prev_alpha = -1;
|
||||
|
||||
int
|
||||
TransparencyEnabled(void)
|
||||
{
|
||||
return Conf.trans.alpha;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
|
||||
static Imlib_Color_Modifier *icm = NULL;
|
||||
static DATA8 gray[256];
|
||||
static DATA8 alpha[256];
|
||||
int
|
||||
TransparencyUpdateNeeded(void)
|
||||
{
|
||||
/* For this to work right prev_alpha needs set to zero on initialization */
|
||||
/* if transparency is disabled (by being set to zero). */
|
||||
/* FIXME - Check this. We call TransparencySet(Conf.trans.alpha) at startup */
|
||||
return Conf.trans.alpha || prev_alpha;
|
||||
}
|
||||
|
||||
static void
|
||||
TransparencyMakeColorModifier(void)
|
||||
|
@ -69,14 +80,24 @@ TransparencySet(int transparency)
|
|||
else if (transparency > 255)
|
||||
transparency = 255;
|
||||
|
||||
changed = Conf.trans.alpha != transparency;
|
||||
Conf.trans.alpha = transparency;
|
||||
|
||||
/* Generate the color modifier tables */
|
||||
TransparencyMakeColorModifier();
|
||||
|
||||
if (changed)
|
||||
DesksRefresh();
|
||||
/* This will render the initial startup stuff correctly since !changed */
|
||||
if (prev_alpha == -1)
|
||||
{
|
||||
prev_alpha = Conf.trans.alpha = transparency;
|
||||
/* Generate the color modifier tables */
|
||||
TransparencyMakeColorModifier();
|
||||
ModulesSignal(ESIGNAL_THEME_TRANS_CHANGE, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
changed = Conf.trans.alpha != transparency;
|
||||
prev_alpha = Conf.trans.alpha;
|
||||
Conf.trans.alpha = transparency;
|
||||
/* Generate the color modifier tables */
|
||||
TransparencyMakeColorModifier();
|
||||
if (changed)
|
||||
ModulesSignal(ESIGNAL_THEME_TRANS_CHANGE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -501,7 +501,7 @@ IconboxEwinMoveResize(EWin * ewin, int resize)
|
|||
{
|
||||
Iconbox *ib = ewin->data;
|
||||
|
||||
if (!resize && !ib->do_update && !TransparencyEnabled())
|
||||
if (!resize && !ib->do_update && !TransparencyUpdateNeeded())
|
||||
return;
|
||||
|
||||
ib->w = ewin->client.w;
|
||||
|
|
|
@ -183,7 +183,7 @@ MenuEwinMoveResize(EWin * ewin, int resize __UNUSED__)
|
|||
if (!m || Mode.mode != MODE_NONE)
|
||||
return;
|
||||
|
||||
if (TransparencyEnabled())
|
||||
if (TransparencyUpdateNeeded())
|
||||
m->redraw = 1;
|
||||
|
||||
if ((!m->style->use_item_bg && m->pmm.pmap == 0) || m->redraw)
|
||||
|
|
|
@ -87,6 +87,9 @@ CB_ThemeTransparency(Dialog * d __UNUSED__, int val __UNUSED__, void *data)
|
|||
tmp_theme_transparency);
|
||||
DialogItemTextSetText(di, s);
|
||||
DialogDrawItems(tr_sel_dialog, di, 0, 0, 99999, 99999);
|
||||
|
||||
/* FIXME - We may not want to do this unless things are speeded up */
|
||||
TransparencySet(tmp_theme_transparency);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue