LCL: Do not force-clear mouse capture flag on creation of TCustomEdit and TCustomComboBox, issue #40379.

Fixes text selection of TEdit and TComboBox on Gtk2 widgetset.

This effectively reverts the following commits:

Commit 27d0c29fb7 (introduced long time
ago to workaround Qt* widgetsets problems, which will be fixed
separately).

Commit e4494cf4cd (workaround for Gtk2
problems caused by the first one).
This commit is contained in:
Maxim Ganetsky 2023-12-05 17:25:51 +03:00
parent ca219eca4b
commit 469e1318dd
3 changed files with 2 additions and 3 deletions

View File

@ -891,7 +891,6 @@ begin
inherited Create(TheOwner);
fCompStyle := csComboBox;
ControlStyle := ControlStyle - [csCaptureMouse];
with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY);
FItems := TStringListUTF8Fast.Create;

View File

@ -68,7 +68,7 @@ begin
inherited Create(AOwner);
//FCompStyle is set here because TEdit inherits from this.
//TCustomMemo also inherits from here but it's create changes fcompstyle to csMemo
ControlStyle := ControlStyle - [csCaptureMouse] + [csRequiresKeyboardInput];
ControlStyle := ControlStyle + [csRequiresKeyboardInput];
FCompStyle := csEdit;
FMaxLength := 0;
FHideSelection := True;

View File

@ -1529,7 +1529,7 @@ begin
if not (csDesigning in ACtl.ComponentState) and
not (csCaptureMouse in ACtl.ControlStyle) and
([ssLeft,ssRight,ssMiddle]*ShiftState <> []) and
not (ACtl is TCustomForm) and not (ACtl is TScrollBar) and not (ACtl is TCustomEdit)
not (ACtl is TCustomForm) and not (ACtl is TScrollBar)
and not DragManager.IsDragging then
begin
if (Event^.x < 0) or (Event^.y < 0) or