1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +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:
kojima
1999-04-28 23:50:52 +00:00
parent 5a156f9131
commit e50b7e9ca9
18 changed files with 193 additions and 70 deletions

View File

@@ -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
View File

@@ -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
---------

View File

@@ -3,7 +3,6 @@ changes since wmaker 0.53.0:
- added balloon help
changes since wmaker 0.52.0:
............................

View File

@@ -211,6 +211,8 @@ typedef struct W_Screen {
Cursor textCursor;
Cursor invisibleCursor;
Atom internalMessage; /* for ClientMessage */
Atom attribsAtom; /* GNUstepWindowAttributes */

View File

@@ -281,6 +281,7 @@ WMSetButtonImage(WMButton *bPtr, WMPixmap *image)
if (bPtr->dimage) {
bPtr->dimage->pixmap = None;
WMReleasePixmap(bPtr->dimage);
bPtr->dimage = NULL;
}
if (image) {

View File

@@ -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);

View File

@@ -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
/*

View File

@@ -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,14 +1113,26 @@ 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.enabled && (event->xmotion.state & Button1Mask)) {
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 >
tPtr->usableWidth) {
@@ -1128,8 +1142,7 @@ handleTextFieldActionEvents(XEvent *event, void *data)
> tPtr->usableWidth) {
tPtr->viewPosition++;
}
}
else if (tPtr->viewPosition > 0 && event->xmotion.x < 0) {
} else if (tPtr->viewPosition > 0 && event->xmotion.x < 0) {
paintCursor(tPtr);
tPtr->viewPosition--;
}
@@ -1138,7 +1151,8 @@ handleTextFieldActionEvents(XEvent *event, void *data)
tPtr->selection.position = tPtr->cursorPosition;
}
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
tPtr->cursorPosition =
pointToCursorPosition(tPtr, event->xmotion.x);
tPtr->selection.count = tPtr->cursorPosition - tPtr->selection.position;
@@ -1163,6 +1177,11 @@ handleTextFieldActionEvents(XEvent *event, void *data)
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;
}

View File

@@ -1,4 +1,5 @@
{
SmoothWorkspaceBack = YES;
WindozeCycling = NO;
PopupSwitchMenu = NO;
MenuStyle = normal;

Binary file not shown.

View File

@@ -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 */

View File

@@ -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,6 +2792,9 @@ setWorkspaceSpecificBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
if (dup(filedes[0]) < 0) {
wsyserror("dup() failed:can't set workspace specific background image");
}
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);
@@ -2857,6 +2863,9 @@ setWorkspaceBack(WScreen *scr, WDefaultEntry *entry, proplist_t value,
SetupEnvironment(scr);
text = PLGetDescription(value);
command = wmalloc(strlen(text)+40);
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);

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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,6 +412,9 @@ parseTexture(RContext *rc, char *text)
{
RImage *simage;
if (smooth)
simage = RSmoothScaleImage(image, w, h);
else
simage = RScaleImage(image, w, h);
if (!simage) {
wwarning("could not scale image:%s",
@@ -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++;

View File

@@ -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
};
@@ -410,6 +415,8 @@ 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;

View File

@@ -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 */

View File

@@ -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;
@@ -175,6 +179,25 @@ typedef struct RXImage {
} 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 {
RClearOperation, /* clear with 0 */
@@ -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