mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 13:04:14 +02:00
gtk1+2 intf: replaced g_idle_add with gtk_timeout_add. g_idle_add is not called when app is busy (e.g. using OnIdle)
git-svn-id: trunk@16324 -
This commit is contained in:
parent
a4d5af1d31
commit
7329c36e1f
lcl/interfaces
@ -385,7 +385,7 @@ end;
|
||||
function gtkWSPopupMenuDeactivate(widget: PGtkWidget; data: gPointer): GBoolean; cdecl;
|
||||
begin
|
||||
Include(PWidgetInfo(Data)^.Flags, wwiValidQueuedEvent);
|
||||
g_idle_add(@gtkWSPopupDelayedClose, data);
|
||||
gtk_timeout_add(0,TGtkfunction(@gtkWSPopupDelayedClose), data);
|
||||
Result := CallBackDefaultReturn;
|
||||
end;
|
||||
|
||||
|
@ -38,12 +38,12 @@ Implementation
|
||||
|
||||
}
|
||||
|
||||
function UpdateMemoCursorCB(AStrings: TGtk2MemoStrings): guint; cdecl;
|
||||
function UpdateMemoCursorCB(AStrings: TGtk2MemoStrings): gboolean; cdecl;
|
||||
var
|
||||
TextMark: PGtkTextMark;
|
||||
CursorIter: TGtkTextIter;
|
||||
begin
|
||||
Result := Ord(False); // destroy this timer
|
||||
Result := gtk_false; // stop this timer
|
||||
|
||||
if AStrings.FQueueCursorMove = -1 then
|
||||
begin
|
||||
@ -198,7 +198,7 @@ begin
|
||||
// needed because there is a callback that updates the GtkBuffer
|
||||
// internally so that it actually knows where the cursor is
|
||||
if FQueueCursorMove = 0 then
|
||||
g_idle_add(TGSourceFunc(@UpdateMemoCursorCB), Pointer(Self));
|
||||
gtk_timeout_add(0,TGSourceFunc(@UpdateMemoCursorCB), Pointer(Self));
|
||||
FQueueCursorMove := APosition;
|
||||
end;
|
||||
|
||||
|
@ -1047,7 +1047,7 @@ end;
|
||||
function GtkPopupCloseUp(WidgetInfo: Pointer): gboolean; cdecl;
|
||||
begin
|
||||
LCLSendCloseUpMsg(TControl(PWidgetInfo(WidgetInfo)^.LCLObject));
|
||||
Result := False;
|
||||
Result := gtk_False;// stop the timer
|
||||
end;
|
||||
|
||||
procedure GtkNotifyCB(AObject: PGObject; pspec: PGParamSpec; WidgetInfo: PWidgetInfo); cdecl;
|
||||
@ -1062,7 +1062,7 @@ begin
|
||||
g_value_init(@AValue, G_TYPE_BOOLEAN); // initialize for boolean
|
||||
g_object_get_property(AObject, pspec^.name, @AValue); // get property value
|
||||
if AValue.data[0].v_int = 0 then // if 0 = False then it is close up
|
||||
g_idle_add(@GtkPopupCloseUp, WidgetInfo)
|
||||
gtk_timeout_add(0,@GtkPopupCloseUp, WidgetInfo)
|
||||
else // in other case it is drop down
|
||||
begin
|
||||
ComboBox:=WidgetInfo^.LCLObject as TCustomComboBox;
|
||||
|
Loading…
Reference in New Issue
Block a user