mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58:08 +01:00
added patch with bugfixes for wings/textfield/panel exit with escape/bag etc
changed iconchooser to center icons/text updated po files
This commit is contained in:
@@ -133,11 +133,18 @@ processEvents(int event_count)
|
||||
void
|
||||
wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
{
|
||||
static WScreen *old_scr=NULL;
|
||||
|
||||
WWindow *old_focused;
|
||||
WWindow *focused=scr->focused_window;
|
||||
int timestamp=LastTimestamp;
|
||||
WApplication *oapp=NULL, *napp=NULL;
|
||||
int wasfocused;
|
||||
|
||||
if (!old_scr)
|
||||
old_scr=scr;
|
||||
old_focused=old_scr->focused_window;
|
||||
|
||||
LastFocusChange = timestamp;
|
||||
|
||||
/*
|
||||
@@ -148,13 +155,13 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
*/
|
||||
timestamp = CurrentTime;
|
||||
|
||||
if (focused)
|
||||
oapp = wApplicationOf(focused->main_window);
|
||||
if (old_focused)
|
||||
oapp = wApplicationOf(old_focused->main_window);
|
||||
|
||||
if (wwin == NULL) {
|
||||
XSetInputFocus(dpy, scr->no_focus_win, RevertToParent, timestamp);
|
||||
if (focused) {
|
||||
wWindowUnfocus(focused);
|
||||
if (old_focused) {
|
||||
wWindowUnfocus(old_focused);
|
||||
}
|
||||
if (oapp) {
|
||||
wAppMenuUnmap(oapp->menu);
|
||||
@@ -167,7 +174,10 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
wKWMSendEventMessage(NULL, WKWMFocusWindow);
|
||||
#endif
|
||||
return;
|
||||
} else if(old_scr != scr && old_focused) {
|
||||
wWindowUnfocus(old_focused);
|
||||
}
|
||||
|
||||
wasfocused = wwin->flags.focused;
|
||||
napp = wApplicationOf(wwin->main_window);
|
||||
|
||||
@@ -245,6 +255,7 @@ wSetFocusTo(WScreen *scr, WWindow *wwin)
|
||||
wKWMSendEventMessage(wwin, WKWMFocusWindow);
|
||||
#endif
|
||||
XFlush(dpy);
|
||||
old_scr=scr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
57
src/dialog.c
57
src/dialog.c
@@ -352,12 +352,14 @@ listIconPaths(WMList *lPtr)
|
||||
}
|
||||
|
||||
|
||||
void drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
|
||||
int state, WMRect *rect) {
|
||||
void
|
||||
drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
|
||||
int state, WMRect *rect)
|
||||
{
|
||||
IconPanel *panel = WMGetHangedData(lPtr);
|
||||
GC gc = panel->scr->draw_gc;
|
||||
GC copygc = panel->scr->copy_gc;
|
||||
char *buffer, *dirfile, *iconfile;
|
||||
char *buffer, *dirfile;
|
||||
WMPixmap *pixmap;
|
||||
WMColor *blackcolor;
|
||||
WMColor *whitecolor;
|
||||
@@ -383,29 +385,53 @@ void drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
|
||||
return;
|
||||
}
|
||||
|
||||
XClearArea(dpy, d, rect->pos.x,rect->pos.y, width, 64, False);
|
||||
XClearArea(dpy, d, rect->pos.x, rect->pos.y, width, rect->size.height,
|
||||
False);
|
||||
XSetClipMask(dpy, gc, None);
|
||||
XDrawRectangle(dpy, d, WMColorGC(whitecolor), rect->pos.x + 5,rect->pos.y +5, width - 10, 54);
|
||||
/*
|
||||
XDrawRectangle(dpy, d, WMColorGC(whitecolor), rect->pos.x + 5,
|
||||
rect->pos.y +5, width - 10, 54);
|
||||
*/
|
||||
XDrawLine(dpy, d, WMColorGC(whitecolor), rect->pos.x,
|
||||
rect->pos.y+rect->size.height-1, rect->pos.x+width,
|
||||
rect->pos.y+rect->size.height-1);
|
||||
|
||||
|
||||
if (state&WLDSSelected) {
|
||||
XFillRectangle(dpy, d, WMColorGC(whitecolor), rect->pos.x + 5,rect->pos.y +5, width - 10, 54);
|
||||
XFillRectangle(dpy, d, WMColorGC(whitecolor), rect->pos.x,
|
||||
rect->pos.y, width, rect->size.height);
|
||||
}
|
||||
|
||||
size = WMGetPixmapSize(pixmap);
|
||||
|
||||
XSetClipMask(dpy, copygc, WMGetPixmapMaskXID(pixmap));
|
||||
XSetClipOrigin(dpy, copygc, rect->pos.x, rect->pos.y);
|
||||
size = WMGetPixmapSize(pixmap);
|
||||
XSetClipOrigin(dpy, copygc, rect->pos.x + (width-size.width)/2,
|
||||
rect->pos.y+2);
|
||||
XCopyArea(dpy, WMGetPixmapXID(pixmap), d, copygc, 0, 0,
|
||||
size.width>100?100:size.width, size.height>64?64:size.height, rect->pos.x,rect->pos.y);
|
||||
size.width>100?100:size.width, size.height>64?64:size.height,
|
||||
rect->pos.x + (width-size.width)/2, rect->pos.y+2);
|
||||
|
||||
{
|
||||
int i,j;
|
||||
int fheight = WMFontHeight(panel->normalfont);
|
||||
int tlen = strlen(text);
|
||||
int twidth = WMWidthOfString(panel->normalfont, text, tlen);
|
||||
int ofx, ofy;
|
||||
|
||||
ofx = rect->pos.x + (width - twidth)/2;
|
||||
ofy = rect->pos.y + 64 - fheight;
|
||||
|
||||
for(i=-1;i<2;i++)
|
||||
for(j=-1;j<2;j++)
|
||||
WMDrawString(wmscr, d, WMColorGC(whitecolor), panel->normalfont , rect->pos.x+i+7, rect->pos.y+62+j-WMFontHeight(panel->normalfont), text, strlen(text));
|
||||
}
|
||||
WMDrawString(wmscr, d, WMColorGC(blackcolor), panel->normalfont , rect->pos.x+7, rect->pos.y+62-WMFontHeight(panel->normalfont), text, strlen(text));
|
||||
for(j=-1;j<2;j++)
|
||||
WMDrawString(wmscr, d, WMColorGC(whitecolor),
|
||||
panel->normalfont, ofx+i, ofy+j,
|
||||
text, tlen);
|
||||
|
||||
WMReleasePixmap(pixmap);
|
||||
WMDrawString(wmscr, d, WMColorGC(blackcolor), panel->normalfont,
|
||||
ofx, ofy, text, tlen);
|
||||
}
|
||||
|
||||
WMReleasePixmap(pixmap);
|
||||
/* I hope it is better to do not use cache / on my box it is fast nuff */
|
||||
XFlush(dpy);
|
||||
|
||||
@@ -413,6 +439,7 @@ void drawIconProc(WMList *lPtr, int index, Drawable d, char *text,
|
||||
WMReleaseColor(whitecolor);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
buttonCallback(void *self, void *clientData)
|
||||
{
|
||||
@@ -429,7 +456,7 @@ buttonCallback(void *self, void *clientData)
|
||||
} else if (bPtr==panel->previewButton) {
|
||||
/**** Previewer ****/
|
||||
WMSetButtonEnabled(bPtr, False);
|
||||
WMSetListUserDrawItemHeight(panel->iconList, 64);
|
||||
WMSetListUserDrawItemHeight(panel->iconList, 68);
|
||||
WMSetListUserDrawProc(panel->iconList, drawIconProc);
|
||||
WMRedisplayWidget(panel->iconList);
|
||||
/* for draw proc to access screen/gc */
|
||||
|
||||
10
src/misc.c
10
src/misc.c
@@ -157,13 +157,13 @@ MakeCPPArgs(char *path)
|
||||
tmp = wstrdup(path);
|
||||
buf = strchr(tmp+1, ' ');
|
||||
if (buf) {
|
||||
*buf = 0;
|
||||
}
|
||||
*buf = 0;
|
||||
}
|
||||
buf = strrchr(tmp, '/');
|
||||
if (buf) {
|
||||
*buf = 0; /* trunc filename */
|
||||
putdef(line, " -I", tmp);
|
||||
}
|
||||
*buf = 0; /* trunc filename */
|
||||
putdef(line, " -I", tmp);
|
||||
}
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user