mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 09:39:30 +02:00
LCL-Gtk2: Fixed pasting text from Combobox to some other application when selecting/middle-clicking.
Makes its behavior consistent with TEdit. Also avoids accessing uninitialized variables. Follow-up of:18f1d06255
5f8eacc23d
This commit is contained in:
parent
33868eedbb
commit
7e1d786c38
@ -1053,12 +1053,9 @@ begin
|
|||||||
Info := GetWidgetInfo(Widget);
|
Info := GetWidgetInfo(Widget);
|
||||||
if Info <> nil then
|
if Info <> nil then
|
||||||
begin
|
begin
|
||||||
if (Info^.LCLObject is TCustomEdit) then
|
gtk_editable_get_selection_bounds(PGtkEditable(Widget),@AStart, @AEnd);
|
||||||
begin
|
Info^.CursorPos := Min(AStart, AEnd);
|
||||||
gtk_editable_get_selection_bounds(PGtkEditable(Widget),@AStart, @AEnd);
|
Info^.SelLength := Abs(AEnd - AStart);
|
||||||
Info^.CursorPos := Min(AStart, AEnd);
|
|
||||||
Info^.SelLength := Abs(AEnd - AStart);
|
|
||||||
end;
|
|
||||||
// Copy text to X-clipboard (paste = middle mouse button).
|
// Copy text to X-clipboard (paste = middle mouse button).
|
||||||
p := gtk_editable_get_chars(PGtkEditable(Widget), AStart, AEnd);
|
p := gtk_editable_get_chars(PGtkEditable(Widget), AStart, AEnd);
|
||||||
if AStart <> AEnd then
|
if AStart <> AEnd then
|
||||||
|
Loading…
Reference in New Issue
Block a user