mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-31 04:55:54 +01:00
change mind.
This commit is contained in:
@@ -1062,6 +1062,7 @@ static void
|
|||||||
handleTextFieldActionEvents(XEvent *event, void *data)
|
handleTextFieldActionEvents(XEvent *event, void *data)
|
||||||
{
|
{
|
||||||
TextField *tPtr = (TextField*)data;
|
TextField *tPtr = (TextField*)data;
|
||||||
|
static int move;
|
||||||
|
|
||||||
CHECK_CLASS(data, WC_TextField);
|
CHECK_CLASS(data, WC_TextField);
|
||||||
|
|
||||||
@@ -1085,29 +1086,40 @@ handleTextFieldActionEvents(XEvent *event, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tPtr->viewPosition > 0 && event->xmotion.x < 0) {
|
else if (tPtr->viewPosition > 0 && event->xmotion.x < 0) {
|
||||||
paintCursor(tPtr);
|
paintCursor(tPtr);
|
||||||
tPtr->viewPosition--;
|
tPtr->viewPosition--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tPtr->selection.count) {
|
if (!tPtr->selection.count) {
|
||||||
tPtr->selection.position = tPtr->cursorPosition;
|
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;
|
tPtr->selection.count = tPtr->cursorPosition - tPtr->selection.position;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
printf("notify %d %d\n",event->xmotion.x,tPtr->usableWidth);
|
printf("notify %d %d\n",event->xmotion.x,tPtr->usableWidth);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
paintCursor(tPtr);
|
paintCursor(tPtr);
|
||||||
paintTextField(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);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
|
move = 1;
|
||||||
switch (tPtr->flags.alignment) {
|
switch (tPtr->flags.alignment) {
|
||||||
int textWidth;
|
int textWidth;
|
||||||
case WARight:
|
case WARight:
|
||||||
@@ -1167,16 +1179,7 @@ handleTextFieldActionEvents(XEvent *event, void *data)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
{
|
move = 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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user