mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-18 20:10:29 +01:00
bug fix in wbutton.c, made mouse pointer go invisible when typing in
textfield, added option to Smooth workspaceBack
This commit is contained in:
@@ -16,7 +16,11 @@ Changes since version 0.53.0:
|
||||
- fixed bug with FullMaximize attribute
|
||||
- GNOME: button events not bound in wmaker are proxyized (to gmc)
|
||||
(Paul Warren <pdw@ferret.lmh.ox.ac.uk>)
|
||||
|
||||
- fixed bug with restoration of maximized window after restart with
|
||||
--enable-kde
|
||||
- added high-quality filtered rescaling (smoothed rescaling) to wrlib/wmsetbg
|
||||
- added SmoothWorkspaceBack
|
||||
- fixed crash bug in Paths section of WPrefs
|
||||
|
||||
Changes since version 0.52.0:
|
||||
.............................
|
||||
|
||||
6
NEWS
6
NEWS
@@ -4,6 +4,7 @@ NEWS for veteran Window Maker users
|
||||
|
||||
--- 0.54.0
|
||||
|
||||
|
||||
New Option For setstyle
|
||||
-----------------------
|
||||
|
||||
@@ -25,6 +26,11 @@ WorkspaceNameDisplayPosition =
|
||||
none/center/top/bottom/topleft/topright/bottomleft/bottomright
|
||||
|
||||
|
||||
SmoothWorkspaceBack = YES/NO
|
||||
|
||||
will enable smoothing of scaled workspace background images.
|
||||
|
||||
|
||||
root menu
|
||||
---------
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ changes since wmaker 0.53.0:
|
||||
|
||||
- added balloon help
|
||||
|
||||
|
||||
changes since wmaker 0.52.0:
|
||||
............................
|
||||
|
||||
|
||||
@@ -211,6 +211,8 @@ typedef struct W_Screen {
|
||||
|
||||
Cursor textCursor;
|
||||
|
||||
Cursor invisibleCursor;
|
||||
|
||||
Atom internalMessage; /* for ClientMessage */
|
||||
|
||||
Atom attribsAtom; /* GNUstepWindowAttributes */
|
||||
|
||||
@@ -281,6 +281,7 @@ WMSetButtonImage(WMButton *bPtr, WMPixmap *image)
|
||||
if (bPtr->dimage) {
|
||||
bPtr->dimage->pixmap = None;
|
||||
WMReleasePixmap(bPtr->dimage);
|
||||
bPtr->dimage = NULL;
|
||||
}
|
||||
|
||||
if (image) {
|
||||
|
||||
@@ -305,6 +305,7 @@ static unsigned char STIPPLE_BITS[] = {
|
||||
|
||||
|
||||
|
||||
|
||||
extern void W_ReadConfigurations(void);
|
||||
|
||||
|
||||
@@ -732,6 +733,19 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
|
||||
|
||||
scrPtr->textCursor = XCreateFontCursor(display, XC_xterm);
|
||||
|
||||
{
|
||||
XColor bla;
|
||||
Pixmap blank;
|
||||
|
||||
blank = XCreatePixmap(display, scrPtr->stipple, 1, 1, 1);
|
||||
XSetForeground(display, scrPtr->monoGC, 0);
|
||||
XFillRectangle(display, blank, scrPtr->monoGC, 0, 0, 1, 1);
|
||||
|
||||
scrPtr->invisibleCursor = XCreatePixmapCursor(display, blank, blank,
|
||||
&bla, &bla, 0, 0);
|
||||
XFreePixmap(display, blank);
|
||||
}
|
||||
|
||||
scrPtr->internalMessage = XInternAtom(display, "_WINGS_MESSAGE", False);
|
||||
|
||||
scrPtr->attribsAtom = XInternAtom(display, "_GNUSTEP_WM_ATTR", False);
|
||||
|
||||
@@ -418,6 +418,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
testGradientButtons(scr);
|
||||
|
||||
testTextField(scr);
|
||||
#if 0
|
||||
testOpenFilePanel(scr);
|
||||
testFontPanel(scr);
|
||||
@@ -428,7 +429,6 @@ int main(int argc, char **argv)
|
||||
testColorWell(scr);
|
||||
|
||||
testSlider(scr);
|
||||
testTextField(scr);
|
||||
testPullDown(scr);
|
||||
#endif
|
||||
/*
|
||||
|
||||
@@ -61,6 +61,8 @@ typedef struct W_TextField {
|
||||
|
||||
unsigned int secure:1; /* password entry style */
|
||||
|
||||
unsigned int pointerGrabbed:1;
|
||||
|
||||
/**/
|
||||
unsigned int notIllegalMovement:1;
|
||||
} flags;
|
||||
@@ -1111,58 +1113,75 @@ handleTextFieldActionEvents(XEvent *event, void *data)
|
||||
|
||||
switch (event->type) {
|
||||
case KeyPress:
|
||||
if (tPtr->flags.enabled && tPtr->flags.focused)
|
||||
if (tPtr->flags.enabled && tPtr->flags.focused) {
|
||||
handleTextFieldKeyPress(tPtr, event);
|
||||
|
||||
XGrabPointer(WMScreenDisplay(W_VIEW(tPtr)->screen),
|
||||
W_VIEW(tPtr)->window, False,
|
||||
PointerMotionMask|ButtonPressMask|ButtonReleaseMask,
|
||||
GrabModeAsync, GrabModeAsync, None,
|
||||
W_VIEW(tPtr)->screen->invisibleCursor,
|
||||
CurrentTime);
|
||||
tPtr->flags.pointerGrabbed = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
|
||||
if (tPtr->flags.pointerGrabbed) {
|
||||
tPtr->flags.pointerGrabbed = 0;
|
||||
XUngrabPointer(WMScreenDisplay(W_VIEW(tPtr)->screen), CurrentTime);
|
||||
}
|
||||
|
||||
if (tPtr->flags.enabled && (event->xmotion.state & Button1Mask)) {
|
||||
|
||||
|
||||
if (tPtr->viewPosition < tPtr->textLen && event->xmotion.x >
|
||||
if (tPtr->viewPosition < tPtr->textLen && event->xmotion.x >
|
||||
tPtr->usableWidth) {
|
||||
if (WMWidthOfString(tPtr->font,
|
||||
&(tPtr->text[tPtr->viewPosition]),
|
||||
tPtr->cursorPosition-tPtr->viewPosition)
|
||||
if (WMWidthOfString(tPtr->font,
|
||||
&(tPtr->text[tPtr->viewPosition]),
|
||||
tPtr->cursorPosition-tPtr->viewPosition)
|
||||
> tPtr->usableWidth) {
|
||||
tPtr->viewPosition++;
|
||||
}
|
||||
}
|
||||
else if (tPtr->viewPosition > 0 && event->xmotion.x < 0) {
|
||||
paintCursor(tPtr);
|
||||
tPtr->viewPosition--;
|
||||
}
|
||||
|
||||
if (!tPtr->selection.count) {
|
||||
tPtr->selection.position = tPtr->cursorPosition;
|
||||
}
|
||||
|
||||
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
|
||||
|
||||
tPtr->selection.count = tPtr->cursorPosition - tPtr->selection.position;
|
||||
|
||||
/*
|
||||
printf("notify %d %d\n",event->xmotion.x,tPtr->usableWidth);
|
||||
*/
|
||||
|
||||
paintCursor(tPtr);
|
||||
paintTextField(tPtr);
|
||||
|
||||
tPtr->viewPosition++;
|
||||
}
|
||||
} else if (tPtr->viewPosition > 0 && event->xmotion.x < 0) {
|
||||
paintCursor(tPtr);
|
||||
tPtr->viewPosition--;
|
||||
}
|
||||
|
||||
if (!tPtr->selection.count) {
|
||||
tPtr->selection.position = tPtr->cursorPosition;
|
||||
}
|
||||
|
||||
tPtr->cursorPosition =
|
||||
pointToCursorPosition(tPtr, event->xmotion.x);
|
||||
|
||||
tPtr->selection.count = tPtr->cursorPosition - tPtr->selection.position;
|
||||
|
||||
/*
|
||||
printf("notify %d %d\n",event->xmotion.x,tPtr->usableWidth);
|
||||
*/
|
||||
|
||||
paintCursor(tPtr);
|
||||
paintTextField(tPtr);
|
||||
|
||||
}
|
||||
if (move) {
|
||||
int count;
|
||||
XSetSelectionOwner(tPtr->view->screen->display,
|
||||
XA_PRIMARY, None, CurrentTime);
|
||||
count = tPtr->selection.count < 0
|
||||
? tPtr->selection.position + tPtr->selection.count
|
||||
: tPtr->selection.position;
|
||||
XStoreBuffer(tPtr->view->screen->display,
|
||||
&tPtr->text[count] , abs(tPtr->selection.count), 0);
|
||||
int count;
|
||||
XSetSelectionOwner(tPtr->view->screen->display,
|
||||
XA_PRIMARY, None, CurrentTime);
|
||||
count = tPtr->selection.count < 0
|
||||
? tPtr->selection.position + tPtr->selection.count
|
||||
: tPtr->selection.position;
|
||||
XStoreBuffer(tPtr->view->screen->display,
|
||||
&tPtr->text[count] , abs(tPtr->selection.count), 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ButtonPress:
|
||||
if (tPtr->flags.pointerGrabbed) {
|
||||
tPtr->flags.pointerGrabbed = 0;
|
||||
XUngrabPointer(WMScreenDisplay(W_VIEW(tPtr)->screen), CurrentTime);
|
||||
}
|
||||
|
||||
move = 1;
|
||||
switch (tPtr->flags.alignment) {
|
||||
int textWidth;
|
||||
@@ -1223,6 +1242,11 @@ handleTextFieldActionEvents(XEvent *event, void *data)
|
||||
break;
|
||||
|
||||
case ButtonRelease:
|
||||
if (tPtr->flags.pointerGrabbed) {
|
||||
tPtr->flags.pointerGrabbed = 0;
|
||||
XUngrabPointer(WMScreenDisplay(W_VIEW(tPtr)->screen), CurrentTime);
|
||||
}
|
||||
|
||||
move = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
SmoothWorkspaceBack = YES;
|
||||
WindozeCycling = NO;
|
||||
PopupSwitchMenu = NO;
|
||||
MenuStyle = normal;
|
||||
|
||||
Binary file not shown.
@@ -272,6 +272,7 @@ typedef struct WPreferences {
|
||||
|
||||
RImage *button_images; /* titlebar button images */
|
||||
|
||||
char smooth_workspace_back;
|
||||
char size_display; /* display type for resize geometry */
|
||||
char move_display; /* display type for move geometry */
|
||||
char window_placement; /* window placement mode */
|
||||
|
||||
@@ -516,6 +516,9 @@ WDefaultEntry optionList[] = {
|
||||
{"WorkspaceBack", "(solid, black)", NULL,
|
||||
NULL, getWSBackground,setWorkspaceBack
|
||||
},
|
||||
{"SmoothWorkspaceBack", "NO", NULL,
|
||||
NULL, getBool, NULL
|
||||
},
|
||||
{"IconBack", "(solid, gray)", NULL,
|
||||
NULL, getTexture, setIconTile
|
||||
},
|
||||
@@ -2789,7 +2792,10 @@ setWorkspaceSpecificBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
if (dup(filedes[0]) < 0) {
|
||||
wsyserror("dup() failed:can't set workspace specific background image");
|
||||
}
|
||||
execlp("wmsetbg", "wmsetbg", "-helper", "-d", NULL);
|
||||
if (wPreferences.smooth_workspace_back)
|
||||
execlp("wmsetbg", "wmsetbg", "-helper", "-S", "-d", NULL);
|
||||
else
|
||||
execlp("wmsetbg", "wmsetbg", "-helper", "-d", NULL);
|
||||
wsyserror("could not execute wmsetbg");
|
||||
exit(1);
|
||||
} else {
|
||||
@@ -2857,7 +2863,10 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
SetupEnvironment(scr);
|
||||
text = PLGetDescription(value);
|
||||
command = wmalloc(strlen(text)+40);
|
||||
sprintf(command, "wmsetbg -d -p '%s' &", text);
|
||||
if (wPreferences.smooth_workspace_back)
|
||||
sprintf(command, "wmsetbg -d -S -p '%s' &", text);
|
||||
else
|
||||
sprintf(command, "wmsetbg -d -p '%s' &", text);
|
||||
free(text);
|
||||
system(command);
|
||||
free(command);
|
||||
|
||||
@@ -1022,7 +1022,7 @@ makeClipOptionsMenu(WScreen *scr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
entry = wMenuAddCallback(menu, _("Keep on top"),
|
||||
entry = wMenuAddCallback(menu, _("Keep on Top"),
|
||||
toggleLoweredCallback, NULL);
|
||||
entry->flags.indicator = 1;
|
||||
entry->flags.indicator_on = 1;
|
||||
|
||||
@@ -67,9 +67,9 @@
|
||||
#define WKBD_WINDOW2 35
|
||||
#define WKBD_WINDOW3 36
|
||||
#define WKBD_WINDOW4 37
|
||||
#define WKBD_WINDOW5 38
|
||||
#define WKBD_WINDOW6 39
|
||||
#ifdef EXTEND_WINDOWSHORTCUT
|
||||
# define WKBD_WINDOW5 38
|
||||
# define WKBD_WINDOW6 39
|
||||
# define WKBD_WINDOW7 40
|
||||
# define WKBD_WINDOW8 41
|
||||
# define WKBD_WINDOW9 42
|
||||
@@ -82,10 +82,10 @@
|
||||
# endif /* KEEP_XKB_LOCK_STATUS */
|
||||
#else /* !EXTEND_WINDOWSHORTCUT */
|
||||
# ifdef KEEP_XKB_LOCK_STATUS
|
||||
# define WKBD_TOGGLE 38
|
||||
# define WKBD_LAST 39
|
||||
# define WKBD_TOGGLE 40
|
||||
# define WKBD_LAST 41
|
||||
# else
|
||||
# define WKBD_LAST 38
|
||||
# define WKBD_LAST 42
|
||||
# endif /* KEEP_XKB_LOCK_STATUS */
|
||||
#endif /* !EXTEND_WINDOWSHORTCUT */
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
#include <proplist.h>
|
||||
|
||||
#define PROG_VERSION "wmsetbg (Window Maker) 2.1"
|
||||
#define PROG_VERSION "wmsetbg (Window Maker) 2.2"
|
||||
|
||||
|
||||
#define WORKSPACE_COUNT (MAX_WORKSPACES+1)
|
||||
@@ -65,6 +65,10 @@ int scr;
|
||||
int scrWidth;
|
||||
int scrHeight;
|
||||
|
||||
|
||||
Bool smooth = False;
|
||||
|
||||
|
||||
Pixmap CurrentPixmap = None;
|
||||
char *PixmapPath = NULL;
|
||||
|
||||
@@ -408,7 +412,10 @@ parseTexture(RContext *rc, char *text)
|
||||
{
|
||||
RImage *simage;
|
||||
|
||||
simage = RScaleImage(image, w, h);
|
||||
if (smooth)
|
||||
simage = RSmoothScaleImage(image, w, h);
|
||||
else
|
||||
simage = RScaleImage(image, w, h);
|
||||
if (!simage) {
|
||||
wwarning("could not scale image:%s",
|
||||
RMessageForError(RErrorCode));
|
||||
@@ -1142,6 +1149,7 @@ print_help(char *ProgName)
|
||||
P(" -display display to use");
|
||||
P(" -d, --dither dither image");
|
||||
P(" -m, --match match colors");
|
||||
P(" -S, --smooth smooth scaled image");
|
||||
P(" -b, --back-color <color> background color");
|
||||
P(" -t, --tile tile image");
|
||||
P(" -e, --center center image");
|
||||
@@ -1257,6 +1265,9 @@ main(int argc, char **argv)
|
||||
|| strcmp(argv[i], "--match")==0) {
|
||||
render_mode = RM_MATCH;
|
||||
obey_user++;
|
||||
} else if (strcmp(argv[i], "-S")==0
|
||||
|| strcmp(argv[i], "--smooth")==0) {
|
||||
smooth = True;
|
||||
} else if (strcmp(argv[i], "-u")==0
|
||||
|| strcmp(argv[i], "--update-wmaker")==0) {
|
||||
update++;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* Raster graphics library
|
||||
*
|
||||
* Copyright (c) 1997 Alfredo K. Kojima
|
||||
* Copyright (c) 1997, 1998, 1999 Alfredo K. Kojima
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -34,6 +34,10 @@
|
||||
|
||||
#include "wraster.h"
|
||||
|
||||
|
||||
extern void _wraster_change_filter(int type);
|
||||
|
||||
|
||||
static Bool bestContext(Display *dpy, int screen_number, RContext *context);
|
||||
|
||||
static RContextAttributes DEFAULT_CONTEXT_ATTRIBS = {
|
||||
@@ -44,7 +48,8 @@ static RContextAttributes DEFAULT_CONTEXT_ATTRIBS = {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
True /* use_shared_memory */
|
||||
True, /* use_shared_memory */
|
||||
RMitchellFilter
|
||||
};
|
||||
|
||||
|
||||
@@ -409,7 +414,9 @@ RCreateContext(Display *dpy, int screen_number, RContextAttributes *attribs)
|
||||
|
||||
/* get configuration from environment variables */
|
||||
gatherconfig(context, screen_number);
|
||||
|
||||
|
||||
_wraster_change_filter(context->attribs->scaling_filter);
|
||||
|
||||
if ((context->attribs->flags & RC_VisualID)) {
|
||||
XVisualInfo *vinfo, templ;
|
||||
int nret;
|
||||
|
||||
@@ -275,6 +275,42 @@ double t;
|
||||
return(0.0);
|
||||
}
|
||||
|
||||
static double (*filterf)() = Mitchell_filter;
|
||||
static double fwidth = Mitchell_support;
|
||||
|
||||
void
|
||||
_wraster_change_filter(int type)
|
||||
{
|
||||
switch (type) {
|
||||
case RBoxFilter:
|
||||
filterf = box_filter;
|
||||
fwidth = box_support;
|
||||
break;
|
||||
case RTriangleFilter:
|
||||
filterf = triangle_filter;
|
||||
fwidth = triangle_support;
|
||||
break;
|
||||
case RBellFilter:
|
||||
filterf = bell_filter;
|
||||
fwidth = bell_support;
|
||||
break;
|
||||
case RBSplineFilter:
|
||||
filterf = B_spline_filter;
|
||||
fwidth = B_spline_support;
|
||||
break;
|
||||
case RLanczos3Filter:
|
||||
filterf = Lanczos3_filter;
|
||||
fwidth = Lanczos3_support;
|
||||
break;
|
||||
default:
|
||||
case RMitchellFilter:
|
||||
filterf = Mitchell_support;
|
||||
fwidth = Mitchell_filter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* image rescaling routine
|
||||
*/
|
||||
@@ -295,14 +331,9 @@ CLIST *contrib; /* array of contribution lists */
|
||||
#define CLAMP(v,l,h) ((v)<(l) ? (l) : (v) > (h) ? (h) : v)
|
||||
|
||||
|
||||
static double (*filterf)() = Mitchell_filter;
|
||||
static double fwidth = Mitchell_support;
|
||||
|
||||
|
||||
RImage*
|
||||
RSmoothScaleImage(RImage *src, int newWidth, int newHeight)
|
||||
{
|
||||
|
||||
{
|
||||
RImage *tmp; /* intermediate image */
|
||||
double xscale, yscale; /* zoom scale factors */
|
||||
int i, j, k; /* loop variables */
|
||||
|
||||
@@ -68,6 +68,9 @@
|
||||
/* use default instead of best visual */
|
||||
#define RC_DefaultVisual (1<<5)
|
||||
|
||||
/* filter type for smoothed scaling */
|
||||
#define RC_ScalingFilter (1<<6)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
@@ -81,6 +84,7 @@ typedef struct RContextAttributes {
|
||||
float bgamma; /* and blue */
|
||||
VisualID visualid; /* visual ID to use */
|
||||
int use_shared_memory; /* True of False */
|
||||
int scaling_filter;
|
||||
} RContextAttributes;
|
||||
|
||||
|
||||
@@ -174,6 +178,25 @@ typedef struct RXImage {
|
||||
#endif
|
||||
} RXImage;
|
||||
|
||||
|
||||
|
||||
/* image display modes */
|
||||
enum {
|
||||
RDitheredRendering = 0,
|
||||
RBestMatchRendering = 1
|
||||
};
|
||||
|
||||
|
||||
/* smoothed scaling filter types */
|
||||
enum {
|
||||
RBoxFilter,
|
||||
RTriangleFilter,
|
||||
RBellFilter,
|
||||
RBSplineFilter,
|
||||
RLanczos3Filter,
|
||||
RMitchellFilter
|
||||
};
|
||||
|
||||
|
||||
/* note that not all operations are supported in all functions */
|
||||
enum {
|
||||
@@ -185,16 +208,6 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
/* image display modes */
|
||||
enum {
|
||||
RDitheredRendering = 0,
|
||||
RBestMatchRendering = 1
|
||||
};
|
||||
|
||||
/* bw compat */
|
||||
#define RM_DITHER RDitheredRendering
|
||||
#define RM_MATCH RBestMatchRendering
|
||||
|
||||
enum {
|
||||
RAbsoluteCoordinates = 0,
|
||||
RRelativeCoordinates = 1
|
||||
|
||||
Reference in New Issue
Block a user