mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
- made deiconification not automatically focus window in sloppy focus
- fixed crash with DisableMiniwindows and icon pixmap changes - fixed crash when changing icon of window without WM_CLASS - added IAmAnnoyingAndDontWantWorkspaceNameDisplay - added hysteresys for offscreen menu scrollback - fixed bug with IgnoreFocusClick - fixed crash with windows with width == 1 (Alban Hertroys <dalroi@wit401310.student.utwente.nl>) - added SHEXEC command - fixed resizebarback for SHADOW_RESIZEBAR ( jim knoble jmknoble@pobox.com)
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -3,6 +3,16 @@ Changes since version 0.53.0:
|
||||
|
||||
- fixed a bug that caused icon overlaping in Clip, when icon was moved around.
|
||||
- this time really added libwmfun to distribution.
|
||||
- made deiconification not automatically focus window in sloppy focus
|
||||
- fixed crash with DisableMiniwindows and icon pixmap changes
|
||||
- fixed crash when changing icon of window without WM_CLASS
|
||||
- added IAmAnnoyingAndDontWantWorkspaceNameDisplay
|
||||
- added hysteresys for offscreen menu scrollback
|
||||
- fixed bug with IgnoreFocusClick
|
||||
- fixed crash with windows with width == 1 (Alban Hertroys
|
||||
<dalroi@wit401310.student.utwente.nl>)
|
||||
- added SHEXEC command
|
||||
- fixed resizebarback for SHADOW_RESIZEBAR ( jim knoble jmknoble@pobox.com)
|
||||
|
||||
|
||||
Changes since version 0.52.0:
|
||||
|
||||
34
NEWS
34
NEWS
@@ -2,15 +2,35 @@
|
||||
NEWS for veteran Window Maker users
|
||||
-----------------------------------
|
||||
|
||||
--- 0.53.1
|
||||
|
||||
New Option For setstyle
|
||||
-----------------------
|
||||
|
||||
The --ignore flag will tell setstyle to not change the option that is
|
||||
specified, when modifying the Window Maker configurations. For example:
|
||||
|
||||
setstyle --ignore MenuStyle sometheme.themed will cause the MenuStyle
|
||||
option to not be changed.
|
||||
|
||||
setstyle --ignore FTitleBack --ignore UTitleBack --ignore PTitleBack bla.themed
|
||||
will load the theme, but keep the titlebar background related options as
|
||||
before.
|
||||
|
||||
|
||||
root menu
|
||||
---------
|
||||
|
||||
EXEC <program> will execute the named program
|
||||
|
||||
SHEXEC <command> will execute the shell command.
|
||||
|
||||
If you want to execute something like blabla > /dev/null, then use SHEXEC
|
||||
|
||||
|
||||
|
||||
--- 0.53.0
|
||||
|
||||
|
||||
KDE 1.1 compatibility
|
||||
---------------------
|
||||
|
||||
|
||||
|
||||
|
||||
New Options
|
||||
-----------
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
changes since wmaker 0.53.0:
|
||||
............................
|
||||
|
||||
- added balloon help
|
||||
|
||||
|
||||
changes since wmaker 0.52.0:
|
||||
............................
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ libWINGs_a_SOURCES = \
|
||||
selection.c \
|
||||
userdefaults.c \
|
||||
wapplication.c \
|
||||
wballoon.c \
|
||||
wbrowser.c \
|
||||
wbutton.c \
|
||||
wcolor.c \
|
||||
|
||||
@@ -139,7 +139,7 @@ wmquery_LDADD = libWINGs.a $(LIBLIST)
|
||||
EXTRA_DIST = logo.xpm
|
||||
|
||||
# wbutton.c
|
||||
libWINGs_a_SOURCES = WINGs.h WINGsP.h configuration.c llist.h llist.c international.c notification.c selection.c userdefaults.c wapplication.c wbrowser.c wbutton.c wcolor.c wcolorpanel.c wcolorwell.c wevent.c wfilepanel.c wframe.c wfont.c wfontpanel.c widgets.c wlabel.c wlist.c wmisc.c wpanel.c wpixmap.c wpopupbutton.c wscroller.c wscrollview.c wslider.c wsplitview.c wtextfield.c wwindow.c wview.c error.c findfile.c hashtable.c memory.c usleep.c
|
||||
libWINGs_a_SOURCES = WINGs.h WINGsP.h configuration.c llist.h llist.c international.c notification.c selection.c userdefaults.c wapplication.c wballoon.c wbrowser.c wbutton.c wcolor.c wcolorpanel.c wcolorwell.c wevent.c wfilepanel.c wframe.c wfont.c wfontpanel.c widgets.c wlabel.c wlist.c wmisc.c wpanel.c wpixmap.c wpopupbutton.c wscroller.c wscrollview.c wslider.c wsplitview.c wtextfield.c wwindow.c wview.c error.c findfile.c hashtable.c memory.c usleep.c
|
||||
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/src -DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
|
||||
@@ -159,12 +159,12 @@ X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
libWINGs_a_LIBADD =
|
||||
libWINGs_a_OBJECTS = configuration.o llist.o international.o \
|
||||
notification.o selection.o userdefaults.o wapplication.o wbrowser.o \
|
||||
wbutton.o wcolor.o wcolorpanel.o wcolorwell.o wevent.o wfilepanel.o \
|
||||
wframe.o wfont.o wfontpanel.o widgets.o wlabel.o wlist.o wmisc.o \
|
||||
wpanel.o wpixmap.o wpopupbutton.o wscroller.o wscrollview.o wslider.o \
|
||||
wsplitview.o wtextfield.o wwindow.o wview.o error.o findfile.o \
|
||||
hashtable.o memory.o usleep.o
|
||||
notification.o selection.o userdefaults.o wapplication.o wballoon.o \
|
||||
wbrowser.o wbutton.o wcolor.o wcolorpanel.o wcolorwell.o wevent.o \
|
||||
wfilepanel.o wframe.o wfont.o wfontpanel.o widgets.o wlabel.o wlist.o \
|
||||
wmisc.o wpanel.o wpixmap.o wpopupbutton.o wscroller.o wscrollview.o \
|
||||
wslider.o wsplitview.o wtextfield.o wwindow.o wview.o error.o \
|
||||
findfile.o hashtable.o memory.o usleep.o
|
||||
AR = ar
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
|
||||
|
||||
@@ -108,9 +108,9 @@ GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WINGs/Resources/Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu WINGs/Resources/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -142,6 +142,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
subdir = WINGs/Resources
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WINGs/Resources/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
|
||||
@@ -639,6 +639,22 @@ extern char *WMViewSizeDidChangeNotification;
|
||||
|
||||
extern char *WMViewRealizedNotification;
|
||||
|
||||
|
||||
/* ....................................................................... */
|
||||
|
||||
void WMSetBalloonTextForView(char *text, WMView *view);
|
||||
|
||||
void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
|
||||
|
||||
void WMSetBalloonFont(WMScreen *scr, WMFont *font);
|
||||
|
||||
void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
|
||||
|
||||
void WMSetBalloonDelay(WMScreen *scr, int delay);
|
||||
|
||||
void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
|
||||
|
||||
|
||||
/* ....................................................................... */
|
||||
|
||||
WMWindow *WMCreateWindow(WMScreen *screen, char *name);
|
||||
|
||||
@@ -135,6 +135,8 @@ typedef struct W_Screen {
|
||||
|
||||
struct W_ColorPanel *sharedColorPanel;
|
||||
|
||||
Pixmap stipple;
|
||||
|
||||
/* colors */
|
||||
W_Color *white;
|
||||
W_Color *black;
|
||||
@@ -432,3 +434,8 @@ void W_FlushASAPNotificationQueue();
|
||||
|
||||
void W_FlushIdleNotificationQueue();
|
||||
|
||||
struct W_Balloon *W_CreateBalloon(WMScreen *scr);
|
||||
|
||||
void W_BalloonHandleEnterView(WMView *view);
|
||||
|
||||
void W_BalloonHandleLeaveView(WMView *view);
|
||||
|
||||
473
WINGs/wballoon.c
Normal file
473
WINGs/wballoon.c
Normal file
@@ -0,0 +1,473 @@
|
||||
|
||||
|
||||
|
||||
|
||||
#include "WINGsP.h"
|
||||
|
||||
#include <X11/extensions/shape.h>
|
||||
|
||||
|
||||
typedef struct W_Balloon {
|
||||
W_View *view;
|
||||
|
||||
WMHashTable *table; /* Table from view ptr to text */
|
||||
|
||||
WMColor *backColor;
|
||||
WMColor *textColor;
|
||||
WMFont *font;
|
||||
|
||||
WMHandlerID timer; /* timer for showing balloon */
|
||||
|
||||
WMHandlerID noDelayTimer;
|
||||
|
||||
int delay;
|
||||
|
||||
Window forWindow; /* window for which the balloon
|
||||
* is being show in the moment */
|
||||
|
||||
struct {
|
||||
WMAlignment alignment:2;
|
||||
unsigned enabled:1;
|
||||
unsigned noDelay:1;
|
||||
} flags;
|
||||
} Balloon;
|
||||
|
||||
|
||||
|
||||
#define DEFAULT_WIDTH 60
|
||||
#define DEFAULT_HEIGHT 14
|
||||
#define DEFAULT_ALIGNMENT WALeft
|
||||
#define DEFAULT_DELAY 500
|
||||
|
||||
#define NO_DELAY_DELAY 150
|
||||
|
||||
|
||||
static void destroyBalloon(Balloon *bPtr);
|
||||
|
||||
|
||||
static void handleEvents(XEvent *event, void *data);
|
||||
|
||||
static void showText(Balloon *bPtr, int x, int y, int w, int h, char *text);
|
||||
|
||||
|
||||
struct W_Balloon*
|
||||
W_CreateBalloon(WMScreen *scr)
|
||||
{
|
||||
Balloon *bPtr;
|
||||
|
||||
bPtr = wmalloc(sizeof(Balloon));
|
||||
memset(bPtr, 0, sizeof(Balloon));
|
||||
|
||||
bPtr->view = W_CreateTopView(scr);
|
||||
if (!bPtr->view) {
|
||||
free(bPtr);
|
||||
return NULL;
|
||||
}
|
||||
bPtr->view->self = bPtr;
|
||||
|
||||
bPtr->view->attribFlags |= CWOverrideRedirect;
|
||||
bPtr->view->attribs.override_redirect = True;
|
||||
|
||||
bPtr->textColor = WMRetainColor(bPtr->view->screen->black);
|
||||
|
||||
WMCreateEventHandler(bPtr->view, StructureNotifyMask, handleEvents, bPtr);
|
||||
|
||||
W_ResizeView(bPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||
bPtr->flags.alignment = DEFAULT_ALIGNMENT;
|
||||
|
||||
bPtr->table = WMCreateHashTable(WMIntHashCallbacks);
|
||||
|
||||
bPtr->delay = DEFAULT_DELAY;
|
||||
|
||||
bPtr->flags.enabled = 1;
|
||||
|
||||
return bPtr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment)
|
||||
{
|
||||
scr->balloon->flags.alignment = alignment;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBalloonTextForView(char *text, WMView *view)
|
||||
{
|
||||
char *oldText = NULL;
|
||||
WMScreen *scr = view->screen;
|
||||
|
||||
if (text) {
|
||||
oldText = WMHashInsert(scr->balloon->table, view, wstrdup(text));
|
||||
} else {
|
||||
oldText = WMHashGet(scr->balloon->table, view);
|
||||
|
||||
WMHashRemove(scr->balloon->table, view);
|
||||
}
|
||||
|
||||
if (oldText) {
|
||||
free(oldText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBalloonFont(WMScreen *scr, WMFont *font)
|
||||
{
|
||||
Balloon *bPtr = scr->balloon;
|
||||
|
||||
if (bPtr->font!=NULL)
|
||||
WMReleaseFont(bPtr->font);
|
||||
|
||||
if (font)
|
||||
bPtr->font = WMRetainFont(font);
|
||||
else
|
||||
bPtr->font = NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBalloonTextColor(WMScreen *scr, WMColor *color)
|
||||
{
|
||||
Balloon *bPtr = scr->balloon;
|
||||
|
||||
if (bPtr->textColor)
|
||||
WMReleaseColor(bPtr->textColor);
|
||||
|
||||
bPtr->textColor = WMRetainColor(color);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBalloonDelay(WMScreen *scr, int delay)
|
||||
{
|
||||
scr->balloon->delay = delay;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetBalloonEnabled(WMScreen *scr, Bool flag)
|
||||
{
|
||||
scr->balloon->flags.enabled = flag;
|
||||
|
||||
W_UnmapView(scr->balloon->view);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
clearNoDelay(void *data)
|
||||
{
|
||||
Balloon *bPtr = (Balloon*)data;
|
||||
|
||||
bPtr->flags.noDelay = 0;
|
||||
bPtr->noDelayTimer = NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
W_BalloonHandleLeaveView(WMView *view)
|
||||
{
|
||||
Balloon *bPtr = view->screen->balloon;
|
||||
|
||||
if (bPtr->view->flags.mapped && bPtr->forWindow == view->window) {
|
||||
W_UnmapView(bPtr->view);
|
||||
|
||||
if (bPtr->timer)
|
||||
WMDeleteTimerHandler(bPtr->timer);
|
||||
|
||||
bPtr->timer = NULL;
|
||||
|
||||
bPtr->noDelayTimer = WMAddTimerHandler(NO_DELAY_DELAY, clearNoDelay,
|
||||
bPtr);
|
||||
}
|
||||
bPtr->forWindow = None;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
showBalloon(void *data)
|
||||
{
|
||||
char *text;
|
||||
WMView *view = (WMView*)data;
|
||||
Balloon *bPtr = view->screen->balloon;
|
||||
int x, y;
|
||||
Window foo;
|
||||
|
||||
bPtr->timer = NULL;
|
||||
|
||||
text = WMHashGet(bPtr->table, view);
|
||||
if (!text)
|
||||
return;
|
||||
|
||||
XTranslateCoordinates(view->screen->display, view->window,
|
||||
view->screen->rootWin, 0, 0, &x, &y, &foo);
|
||||
|
||||
if (!bPtr->view->flags.realized)
|
||||
W_RealizeView(bPtr->view);
|
||||
|
||||
showText(bPtr, x, y, view->size.width, view->size.height, text);
|
||||
|
||||
bPtr->forWindow = view->window;
|
||||
|
||||
bPtr->flags.noDelay = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
W_BalloonHandleEnterView(WMView *view)
|
||||
{
|
||||
Balloon *bPtr = view->screen->balloon;
|
||||
char *text;
|
||||
|
||||
if (!bPtr->flags.enabled)
|
||||
return;
|
||||
|
||||
text = WMHashGet(bPtr->table, view);
|
||||
if (!text) {
|
||||
bPtr->forWindow = None;
|
||||
|
||||
if (bPtr->view->flags.realized)
|
||||
W_UnmapView(bPtr->view);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (bPtr->timer)
|
||||
WMDeleteTimerHandler(bPtr->timer);
|
||||
|
||||
if (bPtr->noDelayTimer)
|
||||
WMDeleteTimerHandler(bPtr->noDelayTimer);
|
||||
bPtr->noDelayTimer = NULL;
|
||||
|
||||
if (bPtr->flags.noDelay) {
|
||||
bPtr->timer = NULL;
|
||||
|
||||
showBalloon(view);
|
||||
} else {
|
||||
bPtr->timer = WMAddTimerHandler(bPtr->delay, showBalloon, view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define TOP 0
|
||||
#define BOTTOM 1
|
||||
#define LEFT 0
|
||||
#define RIGHT 2
|
||||
|
||||
#define TLEFT (TOP|LEFT)
|
||||
#define TRIGHT (TOP|RIGHT)
|
||||
#define BLEFT (BOTTOM|LEFT)
|
||||
#define BRIGHT (BOTTOM|RIGHT)
|
||||
|
||||
|
||||
|
||||
#define SPACE 12
|
||||
|
||||
|
||||
static void
|
||||
drawBalloon(Display *dpy, Pixmap pix, GC gc, int x, int y, int w, int h,
|
||||
int side)
|
||||
{
|
||||
int rad = h*3/10;
|
||||
XPoint pt[3];
|
||||
|
||||
XFillArc(dpy, pix, gc, x, y, rad, rad, 90*64, 90*64);
|
||||
XFillArc(dpy, pix, gc, x, y+h-1-rad, rad, rad, 180*64, 90*64);
|
||||
|
||||
XFillArc(dpy, pix, gc, x+w-1-rad, y, rad, rad, 0*64, 90*64);
|
||||
XFillArc(dpy, pix, gc, x+w-1-rad, y+h-1-rad, rad, rad, 270*64, 90*64);
|
||||
|
||||
XFillRectangle(dpy, pix, gc, x, y+rad/2, w, h-rad);
|
||||
XFillRectangle(dpy, pix, gc, x+rad/2, y, w-rad, h);
|
||||
|
||||
if (side & BOTTOM) {
|
||||
pt[0].y = y+h-1;
|
||||
pt[1].y = y+h-1+SPACE;
|
||||
pt[2].y = y+h-1;
|
||||
} else {
|
||||
pt[0].y = y;
|
||||
pt[1].y = y-SPACE;
|
||||
pt[2].y = y;
|
||||
}
|
||||
if (side & RIGHT) {
|
||||
pt[0].x = x+w-h+2*h/16;
|
||||
pt[1].x = x+w-h+11*h/16;
|
||||
pt[2].x = x+w-h+7*h/16;
|
||||
} else {
|
||||
pt[0].x = x+h-2*h/16;
|
||||
pt[1].x = x+h-11*h/16;
|
||||
pt[2].x = x+h-7*h/16;
|
||||
}
|
||||
XFillPolygon(dpy, pix, gc, pt, 3, Convex, CoordModeOrigin);
|
||||
}
|
||||
|
||||
|
||||
static Pixmap
|
||||
makePixmap(WMScreen *scr, int width, int height, int side, Pixmap *mask)
|
||||
{
|
||||
Display *dpy = WMScreenDisplay(scr);
|
||||
Pixmap bitmap;
|
||||
Pixmap pixmap;
|
||||
int x, y;
|
||||
WMColor *black = WMBlackColor(scr);
|
||||
WMColor *white = WMWhiteColor(scr);
|
||||
|
||||
bitmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE, 1);
|
||||
|
||||
XSetForeground(dpy, scr->monoGC, 0);
|
||||
XFillRectangle(dpy, bitmap, scr->monoGC, 0, 0, width+SPACE, height+SPACE);
|
||||
|
||||
pixmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE,
|
||||
scr->depth);
|
||||
|
||||
XFillRectangle(dpy, pixmap, WMColorGC(black), 0, 0,
|
||||
width+SPACE, height+SPACE);
|
||||
|
||||
if (side & BOTTOM) {
|
||||
y = 0;
|
||||
} else {
|
||||
y = SPACE;
|
||||
}
|
||||
x = 0;
|
||||
|
||||
XSetForeground(dpy, scr->monoGC, 1);
|
||||
drawBalloon(dpy, bitmap, scr->monoGC, x, y, width, height, side);
|
||||
drawBalloon(dpy, pixmap, WMColorGC(white), x+1, y+1, width-2, height-2,
|
||||
side);
|
||||
|
||||
*mask = bitmap;
|
||||
|
||||
WMReleaseColor(black);
|
||||
WMReleaseColor(white);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
showText(Balloon *bPtr, int x, int y, int h, int w, char *text)
|
||||
{
|
||||
WMScreen *scr = bPtr->view->screen;
|
||||
Display *dpy = WMScreenDisplay(scr);
|
||||
int width;
|
||||
int height;
|
||||
Pixmap pixmap;
|
||||
Pixmap mask;
|
||||
WMFont *font = bPtr->font ? bPtr->font : scr->normalFont;
|
||||
int textHeight;
|
||||
int side = 0;
|
||||
int ty;
|
||||
int bx, by;
|
||||
|
||||
{
|
||||
int w;
|
||||
char *ptr, *ptr2;
|
||||
|
||||
ptr = text;
|
||||
width = 0;
|
||||
while (ptr && ptr2) {
|
||||
ptr2 = strchr(ptr, '\n');
|
||||
if (ptr2) {
|
||||
w = WMWidthOfString(font, ptr, ptr2 - ptr);
|
||||
} else {
|
||||
w = WMWidthOfString(font, ptr, strlen(ptr));
|
||||
}
|
||||
if (w > width)
|
||||
width = w;
|
||||
ptr = ptr2 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
width += 16;
|
||||
|
||||
textHeight = W_GetTextHeight(font, text, width, False);
|
||||
|
||||
height = textHeight + 4;
|
||||
|
||||
if (height < 16)
|
||||
height = 16;
|
||||
if (width < height)
|
||||
width = height;
|
||||
|
||||
if (x + width > scr->rootView->size.width) {
|
||||
side = RIGHT;
|
||||
bx = x - width + w/2;
|
||||
if (bx < 0)
|
||||
bx = 0;
|
||||
} else {
|
||||
side = LEFT;
|
||||
bx = x + w/2;
|
||||
}
|
||||
if (bx + width > scr->rootView->size.width)
|
||||
bx = scr->rootView->size.width - width;
|
||||
|
||||
if (y - (height + SPACE) < 0) {
|
||||
side |= TOP;
|
||||
by = y+h-1;
|
||||
ty = SPACE;
|
||||
} else {
|
||||
side |= BOTTOM;
|
||||
by = y - (height + SPACE);
|
||||
ty = 0;
|
||||
}
|
||||
pixmap = makePixmap(scr, width, height, side, &mask);
|
||||
|
||||
W_PaintText(bPtr->view, pixmap, font, 8, ty + (height - textHeight)/2,
|
||||
width, bPtr->flags.alignment,
|
||||
WMColorGC(bPtr->textColor ? bPtr->textColor : scr->black),
|
||||
False, text, strlen(text));
|
||||
|
||||
XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap);
|
||||
|
||||
W_ResizeView(bPtr->view, width, height+SPACE);
|
||||
|
||||
XFreePixmap(dpy, pixmap);
|
||||
|
||||
XShapeCombineMask(dpy, bPtr->view->window, ShapeBounding, 0, 0, mask,
|
||||
ShapeSet);
|
||||
XFreePixmap(dpy, mask);
|
||||
|
||||
W_MoveView(bPtr->view, bx, by);
|
||||
|
||||
W_MapView(bPtr->view);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
handleEvents(XEvent *event, void *data)
|
||||
{
|
||||
Balloon *bPtr = (Balloon*)data;
|
||||
|
||||
switch (event->type) {
|
||||
case DestroyNotify:
|
||||
destroyBalloon(bPtr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
destroyBalloon(Balloon *bPtr)
|
||||
{
|
||||
WMHashEnumerator e;
|
||||
char *str;
|
||||
|
||||
e = WMEnumerateHashTable(bPtr->table);
|
||||
|
||||
while ((str = WMNextHashEnumeratorItem(&e))) {
|
||||
free(str);
|
||||
}
|
||||
WMFreeHashTable(bPtr->table);
|
||||
|
||||
if (bPtr->textColor)
|
||||
WMReleaseColor(bPtr->textColor);
|
||||
|
||||
if (bPtr->font)
|
||||
WMReleaseFont(bPtr->font);
|
||||
|
||||
free(bPtr);
|
||||
}
|
||||
@@ -17,6 +17,8 @@ typedef struct W_Button {
|
||||
W_Pixmap *image;
|
||||
W_Pixmap *altImage;
|
||||
|
||||
W_Pixmap *dimage;
|
||||
|
||||
void *clientData;
|
||||
WMAction *action;
|
||||
|
||||
@@ -231,6 +233,44 @@ WMCreateButton(WMWidget *parent, WMButtonType type)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
updateDisabledMask(WMButton *bPtr)
|
||||
{
|
||||
WMScreen *scr = WMWidgetScreen(bPtr);
|
||||
Display *dpy = scr->display;
|
||||
|
||||
if (bPtr->image) {
|
||||
XGCValues gcv;
|
||||
|
||||
bPtr->dimage->mask = XCreatePixmap(dpy, scr->stipple,
|
||||
bPtr->dimage->width,
|
||||
bPtr->dimage->height, 1);
|
||||
|
||||
XSetForeground(dpy, scr->monoGC, 0);
|
||||
XFillRectangle(dpy, bPtr->dimage->mask, scr->monoGC, 0, 0,
|
||||
bPtr->dimage->width, bPtr->dimage->height);
|
||||
|
||||
gcv.foreground = 1;
|
||||
gcv.background = 0;
|
||||
gcv.stipple = scr->stipple;
|
||||
gcv.fill_style = FillStippled;
|
||||
gcv.clip_mask = bPtr->image->mask;
|
||||
gcv.clip_x_origin = 0;
|
||||
gcv.clip_y_origin = 0;
|
||||
|
||||
XChangeGC(dpy, scr->monoGC, GCForeground|GCBackground|GCStipple
|
||||
|GCFillStyle|GCClipMask|GCClipXOrigin|GCClipYOrigin, &gcv);
|
||||
|
||||
XFillRectangle(dpy, bPtr->dimage->mask, scr->monoGC, 0, 0,
|
||||
bPtr->dimage->width, bPtr->dimage->height);
|
||||
|
||||
gcv.fill_style = FillSolid;
|
||||
gcv.clip_mask = None;
|
||||
XChangeGC(dpy, scr->monoGC, GCFillStyle|GCClipMask, &gcv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WMSetButtonImage(WMButton *bPtr, WMPixmap *image)
|
||||
{
|
||||
@@ -238,6 +278,16 @@ WMSetButtonImage(WMButton *bPtr, WMPixmap *image)
|
||||
WMReleasePixmap(bPtr->image);
|
||||
bPtr->image = WMRetainPixmap(image);
|
||||
|
||||
if (bPtr->dimage) {
|
||||
bPtr->dimage->pixmap = None;
|
||||
WMReleasePixmap(bPtr->dimage);
|
||||
}
|
||||
|
||||
bPtr->dimage = WMCreatePixmapFromXPixmaps(WMWidgetScreen(bPtr),
|
||||
image->pixmap, None,
|
||||
image->width, image->height,
|
||||
image->depth);
|
||||
updateDisabledMask(bPtr);
|
||||
|
||||
if (bPtr->view->flags.realized) {
|
||||
paintButton(bPtr);
|
||||
@@ -502,7 +552,10 @@ paintButton(Button *bPtr)
|
||||
|
||||
gc = NULL;
|
||||
caption = bPtr->caption;
|
||||
if (bPtr->flags.enabled)
|
||||
image = bPtr->image;
|
||||
else
|
||||
image = bPtr->dimage;
|
||||
offset = 0;
|
||||
if (bPtr->flags.bordered)
|
||||
relief = WRRaised;
|
||||
@@ -705,6 +758,12 @@ destroyButton(Button *bPtr)
|
||||
if (bPtr->image)
|
||||
WMReleasePixmap(bPtr->image);
|
||||
|
||||
if (bPtr->dimage) {
|
||||
/* yuck.. kluge */
|
||||
bPtr->dimage->pixmap = None;
|
||||
|
||||
WMReleasePixmap(bPtr->dimage);
|
||||
}
|
||||
if (bPtr->altImage)
|
||||
WMReleasePixmap(bPtr->altImage);
|
||||
|
||||
|
||||
@@ -637,6 +637,12 @@ WMHandleEvent(XEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
/* do balloon stuffs */
|
||||
if (event->type == EnterNotify)
|
||||
W_BalloonHandleEnterView(view);
|
||||
else if (event->type == LeaveNotify)
|
||||
W_BalloonHandleLeaveView(view);
|
||||
|
||||
/* This is a hack. It will make the panel be secure while
|
||||
* the event handlers are handled, as some event handler
|
||||
* might destroy the widget. */
|
||||
|
||||
@@ -297,10 +297,9 @@ static char *CHECK_MARK[] = {
|
||||
"#%======="};
|
||||
|
||||
|
||||
#define STIPPLE_WIDTH 8
|
||||
#define STIPPLE_HEIGHT 8
|
||||
static unsigned char STIPPLE_BITS[] = {
|
||||
0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};
|
||||
#define STIPPLE_WIDTH 2
|
||||
#define STIPPLE_HEIGHT 2
|
||||
static unsigned char STIPPLE_BITS[] = {0x01, 0x02};
|
||||
|
||||
|
||||
extern void W_ReadConfigurations(void);
|
||||
@@ -632,8 +631,7 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
/* we need a 1bpp drawable for the monoGC, so borrow this one */
|
||||
scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL);
|
||||
|
||||
XFreePixmap(display, stipple);
|
||||
|
||||
scrPtr->stipple = stipple;
|
||||
|
||||
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, 12);
|
||||
|
||||
@@ -741,6 +739,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
|
||||
scrPtr->rootView = W_CreateRootView(scrPtr);
|
||||
|
||||
|
||||
scrPtr->balloon = W_CreateBalloon(scrPtr);
|
||||
|
||||
|
||||
W_InitApplication(scrPtr);
|
||||
|
||||
return scrPtr;
|
||||
|
||||
@@ -22,6 +22,7 @@ WMReleasePixmap(WMPixmap *pixmap)
|
||||
pixmap->refCount--;
|
||||
|
||||
if (pixmap->refCount<1) {
|
||||
if (pixmap->pixmap)
|
||||
XFreePixmap(pixmap->screen->display, pixmap->pixmap);
|
||||
if (pixmap->mask)
|
||||
XFreePixmap(pixmap->screen->display, pixmap->mask);
|
||||
|
||||
@@ -143,6 +143,8 @@ testGradientButtons(WMScreen *scr)
|
||||
WMSetButtonAltImage(btn, pix2);
|
||||
WMSetButtonText(btn, "Cool");
|
||||
|
||||
WMSetBalloonTextForView("This is a button", WMWidgetView(btn));
|
||||
|
||||
btn = WMCreateButton(win, WBTMomentaryChange);
|
||||
WMResizeWidget(btn, 60, 24);
|
||||
WMMoveWidget(btn, 90, 100);
|
||||
@@ -152,6 +154,8 @@ testGradientButtons(WMScreen *scr)
|
||||
WMSetButtonAltImage(btn, pix2);
|
||||
WMSetButtonText(btn, "Button");
|
||||
|
||||
WMSetBalloonTextForView("This is another button", WMWidgetView(btn));
|
||||
|
||||
btn = WMCreateButton(win, WBTMomentaryChange);
|
||||
WMResizeWidget(btn, 60, 24);
|
||||
WMMoveWidget(btn, 160, 100);
|
||||
@@ -161,6 +165,9 @@ testGradientButtons(WMScreen *scr)
|
||||
WMSetButtonAltImage(btn, pix2);
|
||||
WMSetButtonText(btn, "Test");
|
||||
|
||||
WMSetBalloonTextForView("This is yet another button.\nBut the balloon has 3 lines.\nYay!",
|
||||
WMWidgetView(btn));
|
||||
|
||||
WMRealizeWidget(win);
|
||||
WMMapSubwidgets(win);
|
||||
WMMapWidget(win);
|
||||
@@ -409,15 +416,17 @@ int main(int argc, char **argv)
|
||||
*
|
||||
* Put the testSomething() function you want to test here.
|
||||
*/
|
||||
testGradientButtons(scr);
|
||||
|
||||
#if 0
|
||||
testOpenFilePanel(scr);
|
||||
testFontPanel(scr);
|
||||
testList(scr);
|
||||
testGradientButtons(scr);
|
||||
testScrollView(scr);
|
||||
#endif
|
||||
|
||||
testColorWell(scr);
|
||||
#if 1
|
||||
|
||||
testSlider(scr);
|
||||
testTextField(scr);
|
||||
testPullDown(scr);
|
||||
|
||||
@@ -102,43 +102,6 @@ adoptChildView(W_View *view, W_View *child)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
handleEvents(XEvent *event, void *data)
|
||||
{
|
||||
W_View *view = (W_View*)data;
|
||||
|
||||
if (event->type == ConfigureNotify) {
|
||||
|
||||
if (event->xconfigure.width != view->size.width
|
||||
|| event->xconfigure.height != view->size.height) {
|
||||
|
||||
view->size.width = event->xconfigure.width;
|
||||
view->size.height = event->xconfigure.height;
|
||||
|
||||
if (view->flags.notifySizeChanged) {
|
||||
WMPostNotificationName(WMViewSizeDidChangeNotification,
|
||||
view, NULL);
|
||||
}
|
||||
}
|
||||
if (event->xconfigure.x != view->pos.x
|
||||
|| event->xconfigure.y != view->pos.y) {
|
||||
|
||||
if (event->xconfigure.send_event) {
|
||||
view->pos.x = event->xconfigure.x;
|
||||
view->pos.y = event->xconfigure.y;
|
||||
} else {
|
||||
Window foo;
|
||||
|
||||
XTranslateCoordinates(view->screen->display,
|
||||
view->window, view->screen->rootWin,
|
||||
event->xconfigure.x, event->xconfigure.y,
|
||||
&view->pos.x, &view->pos.y, &foo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static W_View*
|
||||
createView(W_Screen *screen, W_View *parent)
|
||||
{
|
||||
@@ -213,9 +176,6 @@ W_CreateTopView(W_Screen *screen)
|
||||
view->flags.topLevel = 1;
|
||||
view->attribs.event_mask |= StructureNotifyMask;
|
||||
|
||||
/* catch changes in the toplevel window (resize from user etc.) */
|
||||
WMCreateEventHandler(view, StructureNotifyMask, handleEvents, view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,8 +172,8 @@ WMCreateWindowWithStyle(WMScreen *screen, char *name, int style)
|
||||
screen->windowList = win;
|
||||
|
||||
WMCreateEventHandler(win->view, ExposureMask|StructureNotifyMask
|
||||
|ClientMessageMask|FocusChangeMask, handleEvents,
|
||||
win);
|
||||
|ClientMessageMask|FocusChangeMask,
|
||||
handleEvents, win);
|
||||
|
||||
W_ResizeView(win->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||
|
||||
@@ -616,6 +616,7 @@ static void
|
||||
handleEvents(XEvent *event, void *clientData)
|
||||
{
|
||||
_Window *win = (_Window*)clientData;
|
||||
W_View *view = win->view;
|
||||
|
||||
|
||||
switch (event->type) {
|
||||
@@ -629,12 +630,43 @@ handleEvents(XEvent *event, void *clientData)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case UnmapNotify:
|
||||
WMUnmapWidget(win);
|
||||
break;
|
||||
|
||||
case DestroyNotify:
|
||||
destroyWindow(win);
|
||||
break;
|
||||
|
||||
case ConfigureNotify:
|
||||
if (event->xconfigure.width != view->size.width
|
||||
|| event->xconfigure.height != view->size.height) {
|
||||
|
||||
view->size.width = event->xconfigure.width;
|
||||
view->size.height = event->xconfigure.height;
|
||||
|
||||
if (view->flags.notifySizeChanged) {
|
||||
WMPostNotificationName(WMViewSizeDidChangeNotification,
|
||||
view, NULL);
|
||||
}
|
||||
}
|
||||
if (event->xconfigure.x != view->pos.x
|
||||
|| event->xconfigure.y != view->pos.y) {
|
||||
|
||||
if (event->xconfigure.send_event) {
|
||||
view->pos.x = event->xconfigure.x;
|
||||
view->pos.y = event->xconfigure.y;
|
||||
} else {
|
||||
Window foo;
|
||||
|
||||
XTranslateCoordinates(view->screen->display,
|
||||
view->window, view->screen->rootWin,
|
||||
event->xconfigure.x, event->xconfigure.y,
|
||||
&view->pos.x, &view->pos.y, &foo);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,23 +101,25 @@ enum {
|
||||
|
||||
enum {
|
||||
CpExec = 0,
|
||||
CpArrange = 1,
|
||||
CpHide = 2,
|
||||
CpShow = 3,
|
||||
CpExit = 4,
|
||||
CpShutdown = 5,
|
||||
CpRestart = 6,
|
||||
CpRestartWM = 7,
|
||||
CpSaveSession = 8,
|
||||
CpClearSession = 9,
|
||||
CpRefresh = 10,
|
||||
CpInfo = 11,
|
||||
CpLegal = 12
|
||||
CpShExec = 1,
|
||||
CpArrange = 2,
|
||||
CpHide = 3,
|
||||
CpShow = 4,
|
||||
CpExit = 5,
|
||||
CpShutdown = 6,
|
||||
CpRestart = 7,
|
||||
CpRestartWM = 8,
|
||||
CpSaveSession = 9,
|
||||
CpClearSession = 10,
|
||||
CpRefresh = 11,
|
||||
CpInfo = 12,
|
||||
CpLegal = 13
|
||||
};
|
||||
|
||||
enum {
|
||||
TNothing,
|
||||
TExec,
|
||||
TShExec,
|
||||
TSimpleCommand,
|
||||
TRestart,
|
||||
TRestartWM,
|
||||
@@ -375,7 +377,8 @@ updateForItemType(_Panel *panel, int type)
|
||||
} else {
|
||||
WMMapWidget(panel->shoF);
|
||||
}
|
||||
if (type==TExec || type==TRestart || type==TExternalMenu) {
|
||||
if (type==TExec || type == TShExec || type==TRestart
|
||||
|| type==TExternalMenu) {
|
||||
WMMapWidget(panel->proF);
|
||||
} else {
|
||||
WMUnmapWidget(panel->proF);
|
||||
@@ -403,7 +406,9 @@ updateForItemType(_Panel *panel, int type)
|
||||
if (type == TRestart) {
|
||||
WMSetFrameTitle(panel->proF, _("Window Manager"));
|
||||
} else if (type == TExternalMenu) {
|
||||
WMSetFrameTitle(panel->proF, _("Program to open files"));
|
||||
WMSetFrameTitle(panel->proF, _("Program to Open Files"));
|
||||
} else if (type == TShExec) {
|
||||
WMSetFrameTitle(panel->proF, _("Command to Execute"));
|
||||
} else {
|
||||
WMSetFrameTitle(panel->proF, _("Program to Run"));
|
||||
}
|
||||
@@ -623,6 +628,10 @@ browserClick(WMWidget *w, void *data)
|
||||
WMSetTextFieldText(panel->proT, getItemParameter(item));
|
||||
WMSetPopUpButtonSelectedItem(panel->cmdP, CpExec);
|
||||
updateForItemType(panel, TExec);
|
||||
} else if (strcmp(command, "SHEXEC")==0) {
|
||||
WMSetTextFieldText(panel->proT, getItemParameter(item));
|
||||
WMSetPopUpButtonSelectedItem(panel->cmdP, CpShExec);
|
||||
updateForItemType(panel, TShExec);
|
||||
} else if (strcmp(command, "WORKSPACE_MENU")==0) {
|
||||
updateForItemType(panel, TWSMenu);
|
||||
} else if (strcmp(command, "EXIT")==0) {
|
||||
@@ -734,6 +743,7 @@ changedItem(void *observerData, WMNotification *notification)
|
||||
|
||||
WMRedisplayWidget(list);
|
||||
} else if (strcmp(command, "EXEC")==0
|
||||
|| strcmp(command, "SHEXEC")==0
|
||||
|| strcmp(command, "RESTART")==0) {
|
||||
if (t == panel->proT) {
|
||||
str = WMGetTextFieldText(t);
|
||||
@@ -821,6 +831,15 @@ changedCommand(WMWidget *w, void *data)
|
||||
updateForItemType(panel, TExec);
|
||||
}
|
||||
break;
|
||||
case CpShExec:
|
||||
if (strcmp(getItemCommand(panel->editedItem), "SHEXEC")!=0) {
|
||||
changeItemCommand(panel->editedItem, "SHEXEC");
|
||||
tmp = WMGetTextFieldText(panel->proT);
|
||||
changeItemParameter(panel->editedItem, tmp);
|
||||
free(tmp);
|
||||
updateForItemType(panel, TShExec);
|
||||
}
|
||||
break;
|
||||
case CpArrange:
|
||||
if (strcmp(getItemCommand(panel->editedItem), "ARRANGE_ICONS")!=0) {
|
||||
changeItemCommand(panel->editedItem, "ARRANGE_ICONS");
|
||||
@@ -993,7 +1012,6 @@ scrolledBrowser(void *observerData, WMNotification *notification)
|
||||
{
|
||||
_Panel *panel = (_Panel*)observerData;
|
||||
int column;
|
||||
WMList *list;
|
||||
proplist_t item;
|
||||
|
||||
column = WMGetBrowserFirstVisibleColumn(panel->browser);
|
||||
@@ -1132,12 +1150,13 @@ createPanel(_Panel *p)
|
||||
WMResizeWidget(panel->cmdP, 170, 20);
|
||||
WMMoveWidget(panel->cmdP, 10, 20);
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Run Program"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Execute Shell Command"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Arrange Icons"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Hide Others"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Show All Windows"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Exit WindowMaker"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Exit X Session"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Start window manager"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Start Window Manager"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Restart WindowMaker"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Save Session"));
|
||||
WMAddPopUpButtonItem(panel->cmdP, _("Clear Session"));
|
||||
|
||||
@@ -303,7 +303,8 @@ createMainWindow(WMScreen *scr)
|
||||
WMResizeWidget(WPrefs.versionL, FRAME_WIDTH-20, 20);
|
||||
WMMoveWidget(WPrefs.versionL, 10, 65);
|
||||
WMSetLabelTextAlignment(WPrefs.versionL, WACenter);
|
||||
sprintf(buffer, _("Version %s for Window Maker %s"), WVERSION, WMVERSION);
|
||||
sprintf(buffer, _("Version %s for Window Maker %s or newer"), WVERSION,
|
||||
WMVERSION);
|
||||
WMSetLabelText(WPrefs.versionL, buffer);
|
||||
|
||||
WPrefs.statusL = WMCreateLabel(WPrefs.banner);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
/****/
|
||||
|
||||
#define WVERSION "0.31"
|
||||
#define WMVERSION "0.52.x"
|
||||
#define WMVERSION "0.53.x"
|
||||
|
||||
|
||||
extern char *NOptionValueChanged;
|
||||
|
||||
@@ -120,9 +120,9 @@ all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .mo .po
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/po/Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/po/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -135,6 +135,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
subdir = WPrefs.app/po
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WPrefs.app/po/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
|
||||
@@ -109,9 +109,9 @@ GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WPrefs.app/xpm/Makefile
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu WPrefs.app/xpm/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -143,6 +143,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
subdir = WPrefs.app/xpm
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu WPrefs.app/xpm/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
|
||||
@@ -100,6 +100,6 @@
|
||||
("Start BlackBox", RESTART, blackbox),
|
||||
("Start kwm", RESTART, kwm),
|
||||
("Start IceWM", RESTART, icewm),
|
||||
("Exit...", EXIT),
|
||||
("Exit...", EXIT)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ AC_INIT(src/WindowMaker.h)
|
||||
|
||||
|
||||
|
||||
AM_INIT_AUTOMAKE(WindowMaker, 0.53.0)
|
||||
AM_INIT_AUTOMAKE(WindowMaker, 0.53.1)
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
@@ -319,7 +319,7 @@ dnl
|
||||
dnl Disable some stuff that are duplicated in kde
|
||||
dnl ---------------------------------------------
|
||||
AC_ARG_ENABLE(lite,
|
||||
[ --enable-lite disable stuff duplicated in KDE/GNOME ],
|
||||
[ --enable-lite disable some stuff (dont use it) ],
|
||||
[if test x$enableval = xyes; then
|
||||
LITE=yes
|
||||
AC_DEFINE(LITE)
|
||||
|
||||
@@ -369,6 +369,9 @@ typedef struct WPreferences {
|
||||
char window_balloon;
|
||||
char miniwin_balloon;
|
||||
char appicon_balloon;
|
||||
|
||||
char no_workspace_name_display;
|
||||
|
||||
#ifdef WEENDOZE_CYCLE
|
||||
char windoze_cycling; /* Windoze 95 style Alt+Tabbing */
|
||||
char popup_switchmenu; /* Popup the switchmenu when Alt+Tabbing */
|
||||
|
||||
@@ -1150,8 +1150,8 @@ wDeiconifyWindow(WWindow *wwin)
|
||||
wwin->icon = NULL;
|
||||
}
|
||||
XUngrabServer(dpy);
|
||||
if (wPreferences.focus_mode==WKF_CLICK
|
||||
|| wPreferences.focus_mode==WKF_SLOPPY)
|
||||
|
||||
if (wPreferences.focus_mode==WKF_CLICK)
|
||||
wSetFocusTo(wwin->screen_ptr, wwin);
|
||||
|
||||
#ifdef ANIMATIONS
|
||||
|
||||
@@ -492,7 +492,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|
||||
|| (wwin->wm_hints->flags & IconWindowHint)) {
|
||||
WApplication *wapp;
|
||||
|
||||
if (wwin->flags.miniaturized) {
|
||||
if (wwin->flags.miniaturized && wwin->icon) {
|
||||
wIconUpdate(wwin->icon);
|
||||
}
|
||||
wapp = wApplicationOf(wwin->main_window);
|
||||
|
||||
@@ -387,6 +387,9 @@ WDefaultEntry optionList[] = {
|
||||
{"CycleWorkspaces", "NO", NULL,
|
||||
&wPreferences.ws_cycle, getBool, NULL
|
||||
},
|
||||
{"IAmAnnoyingAndDontWantWorkspaceNameDisplay", "NO",NULL,
|
||||
&wPreferences.no_workspace_name_display, getBool, NULL
|
||||
},
|
||||
{"StickyIcons", "NO", NULL,
|
||||
&wPreferences.sticky_icons, getBool, setStickyIcons
|
||||
},
|
||||
@@ -522,7 +525,7 @@ WDefaultEntry optionList[] = {
|
||||
{"DisplayFont", DEF_INFO_TEXT_FONT, NULL,
|
||||
NULL, getFont, setDisplayFont
|
||||
},
|
||||
{"LargeDisplayFont" DEF_WORKSPACE_NAME_FONT, NULL,
|
||||
{"LargeDisplayFont",DEF_WORKSPACE_NAME_FONT, NULL,
|
||||
NULL, getFont, setLargeDisplayFont
|
||||
},
|
||||
{"HighlightColor", "white", NULL,
|
||||
|
||||
@@ -496,7 +496,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
|
||||
if (tmp && (instance || class))
|
||||
sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class);
|
||||
else
|
||||
tmp = _("Icon Chooser");
|
||||
strcpy(tmp, _("Icon Chooser"));
|
||||
|
||||
wwin = wManageInternalWindow(scr, parent, None, tmp,
|
||||
(scr->scr_width - 450)/2,
|
||||
|
||||
@@ -579,11 +579,21 @@ renderResizebarTexture(WScreen *scr, WTexture *texture, int width, int height,
|
||||
ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height-1, &dark);
|
||||
ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height-1, &light);
|
||||
|
||||
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2, width-cwidth-2,
|
||||
height-1, &dark);
|
||||
if (width > 1)
|
||||
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2,
|
||||
width-cwidth-2, height-1, &dark);
|
||||
ROperateLine(img, RAddOperation, width-cwidth-1, 2, width-cwidth-1,
|
||||
height-1, &light);
|
||||
|
||||
#ifdef SHADOW_RESIZEBAR
|
||||
ROperateLine(img, RAddOperation, 0, 1, 0, height-1, &light);
|
||||
ROperateLine(img, RSubtractOperation, width-1, 1, width-1, height-1,
|
||||
&dark);
|
||||
ROperateLine(img, RSubtractOperation, 0, height-1, width-1, height-1,
|
||||
&dark);
|
||||
#endif /* SHADOW_RESIZEBAR */
|
||||
|
||||
|
||||
if (!RConvertImage(scr->rcontext, img, pmap)) {
|
||||
wwarning(_("error rendering image: %s"), RMessageForError(RErrorCode));
|
||||
}
|
||||
|
||||
@@ -1938,8 +1938,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
smenu = parentMenu(menu);
|
||||
old_frame_x = smenu->frame_x;
|
||||
old_frame_y = smenu->frame_y;
|
||||
}
|
||||
else if (event->xbutton.window == menu->frame->core->window) {
|
||||
} else if (event->xbutton.window == menu->frame->core->window) {
|
||||
/* This is true if the menu was launched with right click on root window */
|
||||
delayed_select = 1;
|
||||
d_data.delayed_select = &delayed_select;
|
||||
@@ -2195,8 +2194,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
if (((WMenu*)desc->parent)->flags.brother || close_on_exit
|
||||
|| !smenu)
|
||||
if (((WMenu*)desc->parent)->flags.brother || close_on_exit || !smenu)
|
||||
closeCascade(desc->parent);
|
||||
|
||||
/* close the cascade windows that should not remain opened */
|
||||
|
||||
@@ -1436,7 +1436,7 @@ ExecuteShellCommand(WScreen *scr, char *command)
|
||||
#ifdef HAVE_SETPGID
|
||||
setpgid(0, 0);
|
||||
#endif
|
||||
execl(shell, shell, "-c", wstrappend("exec ", command), NULL);
|
||||
execl(shell, shell, "-c", command, NULL);
|
||||
wsyserror("could not execute %s -c %s", shell, command);
|
||||
Exit(-1);
|
||||
} else if (pid < 0) {
|
||||
|
||||
@@ -114,6 +114,7 @@ static Shortcut *shortcutList = NULL;
|
||||
* REFRESH - forces the desktop to be repainted
|
||||
* EXIT [QUICK] - exit the window manager [without confirmation]
|
||||
* EXEC <program> - execute an external program
|
||||
* SHEXEC <command> - execute a shell command
|
||||
* WORKSPACE_MENU - places the workspace submenu
|
||||
* ARRANGE_ICONS
|
||||
* RESTART [<window manager>] - restarts the window manager
|
||||
@@ -807,7 +808,18 @@ addMenuEntry(WMenu *menu, char *title, char *shortcut, char *command,
|
||||
wwarning(_("%s:missing parameter for menu command \"%s\""),
|
||||
file_name, command);
|
||||
else {
|
||||
entry = wMenuAddCallback(menu, title, execCommand, wstrdup(params));
|
||||
entry = wMenuAddCallback(menu, title, execCommand,
|
||||
wstrappend("exec ", params));
|
||||
entry->free_cdata = free;
|
||||
shortcutOk = True;
|
||||
}
|
||||
} else if (strcmp(command, "SHEXEC")==0) {
|
||||
if (!params)
|
||||
wwarning(_("%s:missing parameter for menu command \"%s\""),
|
||||
file_name, command);
|
||||
else {
|
||||
entry = wMenuAddCallback(menu, title, execCommand,
|
||||
wstrdup(params));
|
||||
entry->free_cdata = free;
|
||||
shortcutOk = True;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* session.h
|
||||
*
|
||||
* Copyright (c) 1998 Dan Pascu
|
||||
* Copyright (c) 1999 Alfredo K. Kojima
|
||||
*
|
||||
* Window Maker window manager
|
||||
*
|
||||
@@ -68,4 +68,6 @@ Bool wSessionIsManaged(void);
|
||||
|
||||
#endif
|
||||
|
||||
Bool wSessionGetStateFor(WWindow *wwin, WSessionData *state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -362,7 +362,10 @@
|
||||
/* delay for menu item selection hysteresis */
|
||||
#define MENU_SELECT_DELAY 200
|
||||
|
||||
/* animation speed constants */
|
||||
/* delay for jumpback of scrolled menus */
|
||||
#define MENU_JUMP_BACK_DELAY 200
|
||||
|
||||
/* *** animation speed constants *** */
|
||||
|
||||
/* icon slide */
|
||||
#define ICON_SLIDE_SLOWDOWN_UF 20
|
||||
@@ -400,7 +403,7 @@
|
||||
|
||||
#define MENU_SCROLL_STEPS_U 1
|
||||
#define MENU_SCROLL_DELAY_U 8
|
||||
#define MENU_JUMP_BACK_DELAY 0
|
||||
0
|
||||
|
||||
/* shade animation */
|
||||
#define SHADE_STEPS_UF 5
|
||||
@@ -418,6 +421,12 @@
|
||||
#define SHADE_STEPS_U 20
|
||||
#define SHADE_DELAY_U 10
|
||||
|
||||
|
||||
/* workspace name on switch display */
|
||||
#define WORKSPACE_NAME_FADE_DELAY 30
|
||||
|
||||
#define WORKSPACE_NAME_DELAY 500
|
||||
|
||||
/* window birth animation steps (DO NOT MAKE IT RUN-TIME) */
|
||||
#define WINDOW_BIRTH_STEPS 20
|
||||
|
||||
|
||||
@@ -1552,10 +1552,10 @@ wWindowFocus(WWindow *wwin, WWindow *owin)
|
||||
|
||||
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
|
||||
|
||||
wWindowResetMouseGrabs(wwin);
|
||||
|
||||
wwin->flags.focused = 1;
|
||||
|
||||
wWindowResetMouseGrabs(wwin);
|
||||
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
||||
|
||||
if (owin == wwin || !owin)
|
||||
@@ -1621,6 +1621,7 @@ wWindowUnfocus(WWindow *wwin)
|
||||
}
|
||||
}
|
||||
wwin->flags.focused = 0;
|
||||
|
||||
wWindowResetMouseGrabs(wwin);
|
||||
|
||||
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
|
||||
@@ -2334,7 +2335,7 @@ wWindowResetMouseGrabs(WWindow *wwin)
|
||||
GrabModeAsync, None, None);
|
||||
}
|
||||
|
||||
if (!wwin->flags.focused) {
|
||||
if (!wwin->flags.focused && !WFLAGP(wwin, no_focusable)) {
|
||||
/* the passive grabs to focus the window */
|
||||
if (wPreferences.focus_mode == WKF_CLICK)
|
||||
XGrabButton(dpy, AnyButton, AnyModifier, wwin->client_win,
|
||||
|
||||
@@ -141,7 +141,6 @@ typedef struct {
|
||||
unsigned int olwm_transient:1;
|
||||
unsigned int olwm_warp_to_pin:1;
|
||||
#endif
|
||||
|
||||
} WWindowAttributes;
|
||||
|
||||
|
||||
|
||||
@@ -252,7 +252,8 @@ hideWorkpaceName(void *data)
|
||||
RImage *img = RCloneImage(scr->workspace_name_data->back);
|
||||
Pixmap pix;
|
||||
|
||||
scr->workspace_name_timer = WMAddTimerHandler(30, hideWorkpaceName,
|
||||
scr->workspace_name_timer =
|
||||
WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkpaceName,
|
||||
scr);
|
||||
|
||||
RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text,
|
||||
@@ -289,6 +290,8 @@ showWorkspaceName(WScreen *scr, int workspace)
|
||||
XUnmapWindow(dpy, scr->workspace_name);
|
||||
XFlush(dpy);
|
||||
}
|
||||
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY,
|
||||
hideWorkpaceName, scr);
|
||||
|
||||
if (scr->workspace_name_data) {
|
||||
RDestroyImage(scr->workspace_name_data->back);
|
||||
@@ -307,8 +310,10 @@ showWorkspaceName(WScreen *scr, int workspace)
|
||||
h = scr->workspace_name_font->height;
|
||||
|
||||
XResizeWindow(dpy, scr->workspace_name, w+4, h+4);
|
||||
XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2,
|
||||
XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2, 0);
|
||||
/*
|
||||
(scr->scr_height - (h+4))/2);
|
||||
*/
|
||||
|
||||
text = XCreatePixmap(dpy, scr->w_win, w+4, h+4, scr->w_depth);
|
||||
mask = XCreatePixmap(dpy, scr->w_win, w+4, h+4, 1);
|
||||
@@ -374,11 +379,12 @@ showWorkspaceName(WScreen *scr, int workspace)
|
||||
|
||||
scr->workspace_name_data = data;
|
||||
|
||||
scr->workspace_name_timer = WMAddTimerHandler(300, hideWorkpaceName, scr);
|
||||
|
||||
return;
|
||||
|
||||
erro:
|
||||
if (scr->workspace_name_timer)
|
||||
WMDeleteTimerHandler(scr->workspace_name_timer);
|
||||
|
||||
if (data->text)
|
||||
RDestroyImage(data->text);
|
||||
if (data->back)
|
||||
@@ -387,7 +393,9 @@ erro:
|
||||
|
||||
scr->workspace_name_data = NULL;
|
||||
|
||||
scr->workspace_name_timer = WMAddTimerHandler(600, hideWorkpaceName, scr);
|
||||
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY +
|
||||
10*WORKSPACE_NAME_FADE_DELAY,
|
||||
hideWorkpaceName, scr);
|
||||
}
|
||||
|
||||
|
||||
@@ -401,6 +409,7 @@ wWorkspaceChange(WScreen *scr, int workspace)
|
||||
if (workspace != scr->current_workspace) {
|
||||
wWorkspaceForceChange(scr, workspace);
|
||||
} else {
|
||||
if (!wPreferences.no_workspace_name_display)
|
||||
showWorkspaceName(scr, workspace);
|
||||
}
|
||||
}
|
||||
@@ -568,6 +577,7 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
|
||||
}
|
||||
}
|
||||
|
||||
if (!wPreferences.no_workspace_name_display)
|
||||
showWorkspaceName(scr, workspace);
|
||||
|
||||
#ifdef GNOME_STUFF
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#define PROG_VERSION "setstyle (Window Maker) 0.4"
|
||||
#define PROG_VERSION "setstyle (Window Maker) 0.5"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "../src/wconfig.h"
|
||||
|
||||
#define MAX_OPTIONS 128
|
||||
|
||||
char *FontOptions[] = {
|
||||
"IconTitleFont",
|
||||
@@ -345,12 +346,12 @@ print_help()
|
||||
puts("Reads style/theme configuration from FILE and updates Window Maker.");
|
||||
puts("");
|
||||
puts(" --no-fonts ignore font related options");
|
||||
puts(" --ignore <option> ignore changes in the specified option");
|
||||
puts(" --help display this help and exit");
|
||||
puts(" --version output version information and exit");
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@@ -359,6 +360,8 @@ main(int argc, char **argv)
|
||||
char *file = NULL;
|
||||
struct stat statbuf;
|
||||
int i;
|
||||
int ignoreCount = 0;
|
||||
char *ignoreList[MAX_OPTIONS];
|
||||
|
||||
dpy = XOpenDisplay("");
|
||||
|
||||
@@ -371,7 +374,15 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp("--no-fonts", argv[i])==0) {
|
||||
if (strcmp("--ignore", argv[i])==0) {
|
||||
i++;
|
||||
if (i == argc) {
|
||||
printf("%s: missing argument for option --ignore", ProgName);
|
||||
exit(1);
|
||||
}
|
||||
ignoreList[ignoreCount++] = argv[i];
|
||||
|
||||
} else if (strcmp("--no-fonts", argv[i])==0) {
|
||||
ignoreFonts = 1;
|
||||
} else if (strcmp("--version", argv[i])==0) {
|
||||
puts(PROG_VERSION);
|
||||
@@ -461,6 +472,12 @@ main(int argc, char **argv)
|
||||
|
||||
hackStyle(style);
|
||||
|
||||
if (ignoreCount > 0) {
|
||||
for (i = 0; i < ignoreCount; i++) {
|
||||
PLRemoveDictionaryEntry(style, PLMakeString(ignoreList[i]));
|
||||
}
|
||||
}
|
||||
|
||||
PLMergeDictionaries(prop, style);
|
||||
|
||||
PLSave(prop, YES);
|
||||
|
||||
@@ -610,20 +610,20 @@ parseTexture(RContext *rc, char *text)
|
||||
|
||||
handle = dlopen(lib, RTLD_LAZY);
|
||||
if (!handle) {
|
||||
wwarning(_("could not find library %s"), lib);
|
||||
wwarning("could not find library %s", lib);
|
||||
goto function_cleanup;
|
||||
}
|
||||
|
||||
initFunc = dlsym(handle, "initWindowMaker");
|
||||
if (!initFunc) {
|
||||
wwarning(_("could not initialize library %s"), lib);
|
||||
wwarning("could not initialize library %s", lib);
|
||||
goto function_cleanup;
|
||||
}
|
||||
initFunc(dpy, DefaultColormap(dpy, scr));
|
||||
|
||||
mainFunc = dlsym(handle, func);
|
||||
if (!mainFunc) {
|
||||
wwarning(_("could not find function %s::%s"), lib, func);
|
||||
wwarning("could not find function %s::%s", lib, func);
|
||||
goto function_cleanup;
|
||||
}
|
||||
image = mainFunc(argc, argv, scrWidth, scrHeight, 0);
|
||||
|
||||
Reference in New Issue
Block a user