wineconsole[4/6]: allow making selections with a mouse also when
not in the QuickEdit mode (corrected)
Mikołaj Zalewski
mikolaj at zalewski.pl
Thu Oct 19 12:35:02 CDT 2006
I removed the (wParam&MK_LBUTTON) condition from the WM_LBUTTONUP
handler as it is always false. I also remove the
PRIVATE(data)->has_selection=FALSE as leaving it would mean that the
selection will be deleted after this event. The only was to have some
use of the mouse selection would be to press enter while holding the
mouse button what's not very intuitive.
On the other hand if we only release the capture but leave
PRIVATE(data)->has_selection as TRUE the selection can still be copied
into the clipboard. The WM_MOUSEMOVE will have no effect on the
selection as the condition GetCapture() == PRIVATE(data)->hWnd condition
will be false.
-------------- next part --------------
diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c
index 557ccfc..0726ea6 100644
--- a/programs/wineconsole/user.c
+++ b/programs/wineconsole/user.c
@@ -1116,12 +1116,14 @@ static LRESULT CALLBACK WCUSER_Proc(HWND
WCUSER_GenerateKeyInputRecord(data, uMsg == WM_SYSKEYDOWN, wParam, lParam, TRUE);
break;
case WM_LBUTTONDOWN:
- if (data->curcfg.quick_edit)
+ if (data->curcfg.quick_edit || PRIVATE(data)->has_selection)
{
if (PRIVATE(data)->has_selection)
+ WCUSER_SetSelection(data, 0);
+
+ if (data->curcfg.quick_edit && PRIVATE(data)->has_selection)
{
PRIVATE(data)->has_selection = FALSE;
- WCUSER_SetSelection(data, 0);
}
else
{
@@ -1137,7 +1139,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND
}
break;
case WM_MOUSEMOVE:
- if (data->curcfg.quick_edit)
+ if (data->curcfg.quick_edit || PRIVATE(data)->has_selection)
{
if (GetCapture() == PRIVATE(data)->hWnd && PRIVATE(data)->has_selection &&
(wParam & MK_LBUTTON))
@@ -1151,14 +1153,12 @@ static LRESULT CALLBACK WCUSER_Proc(HWND
}
break;
case WM_LBUTTONUP:
- if (data->curcfg.quick_edit)
+ if (data->curcfg.quick_edit || PRIVATE(data)->has_selection)
{
- if (GetCapture() == PRIVATE(data)->hWnd && PRIVATE(data)->has_selection &&
- (wParam& MK_LBUTTON))
+ if (GetCapture() == PRIVATE(data)->hWnd && PRIVATE(data)->has_selection)
{
WCUSER_MoveSelection(data, PRIVATE(data)->selectPt1, WCUSER_GetCell(data, lParam));
ReleaseCapture();
- PRIVATE(data)->has_selection = FALSE;
}
}
else
--
1.4.2.3
More information about the wine-patches
mailing list