Recent

Author Topic: Gtk2 small patch for focus-state  (Read 1343 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2479
    • UVviewsoft
Gtk2 small patch for focus-state
« on: December 02, 2023, 10:15:34 am »
From developer who added IME GTK2 support for ATSynEdit, I got small patch. What do you think about it?
It should make IME Gtk2 support better.

Code: Diff  [Select][+][-]
  1. --- a/lcl/interfaces/gtk2/gtk2callback.inc
  2. +++ b/lcl/interfaces/gtk2/gtk2callback.inc
  3. @@ -952,6 +952,7 @@ begin
  4.    Mess.msg := LM_SETFOCUS;
  5.    DeliverMessage(Data,  Mess);
  6.  
  7. +  GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
  8.    Result := CallBackDefaultReturn;
  9.    {$IFDEF VerboseFocus}
  10.    DebugLnExit('GTKFocusCB DONE');
  11. @@ -981,6 +982,7 @@ begin
  12.      DebugLn('GTKillFocusCB GetFocus=',dbgs(CurFocusWidget),' ParentLCLObject=',dbgsName(LCLObject));
  13.    end;
  14.    {$ENDIF}
  15. +  GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
  16.    Result:=CallBackDefaultReturn;
  17.  end;
  18.                

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Gtk2 small patch for focus-state
« Reply #1 on: December 02, 2023, 03:04:36 pm »
Most developers are not familiar with GTK2 + IME + GTK_HAS_FOCUS flag.
So there is a danger a useful patch gets ignored.
You should explain a little more though. How does it make IME GTK2 support better?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

parcel

  • Full Member
  • ***
  • Posts: 143
Re: Gtk2 small patch for focus-state
« Reply #2 on: December 02, 2023, 03:32:44 pm »
From developer who added IME GTK2 support for ATSynEdit, I got small patch. What do you think about it?
It should make IME Gtk2 support better.

Code: Diff  [Select][+][-]
  1. --- a/lcl/interfaces/gtk2/gtk2callback.inc
  2. +++ b/lcl/interfaces/gtk2/gtk2callback.inc
  3. @@ -952,6 +952,7 @@ begin
  4.    Mess.msg := LM_SETFOCUS;
  5.    DeliverMessage(Data,  Mess);
  6.  
  7. +  GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
  8.    Result := CallBackDefaultReturn;
  9.    {$IFDEF VerboseFocus}
  10.    DebugLnExit('GTKFocusCB DONE');
  11. @@ -981,6 +982,7 @@ begin
  12.      DebugLn('GTKillFocusCB GetFocus=',dbgs(CurFocusWidget),' ParentLCLObject=',dbgsName(LCLObject));
  13.    end;
  14.    {$ENDIF}
  15. +  GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
  16.    Result:=CallBackDefaultReturn;
  17.  end;
  18.                

I fogot to meation about it. SET/UNSET "GTK_HAS_FOCUS" make not good behavier.

 

TinyPortal © 2005-2018