Forum > GTK
Gtk2 small patch for focus-state
(1/1)
AlexTP:
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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ------ a/lcl/interfaces/gtk2/gtk2callback.inc+++ b/lcl/interfaces/gtk2/gtk2callback.inc@@ -952,6 +952,7 @@ begin Mess.msg := LM_SETFOCUS; DeliverMessage(Data, Mess); + GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); Result := CallBackDefaultReturn; {$IFDEF VerboseFocus} DebugLnExit('GTKFocusCB DONE');@@ -981,6 +982,7 @@ begin DebugLn('GTKillFocusCB GetFocus=',dbgs(CurFocusWidget),' ParentLCLObject=',dbgsName(LCLObject)); end; {$ENDIF}+ GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); Result:=CallBackDefaultReturn; end;
JuhaManninen:
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?
parcel:
--- Quote from: AlexTP 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 [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ------ a/lcl/interfaces/gtk2/gtk2callback.inc+++ b/lcl/interfaces/gtk2/gtk2callback.inc@@ -952,6 +952,7 @@ begin Mess.msg := LM_SETFOCUS; DeliverMessage(Data, Mess); + GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); Result := CallBackDefaultReturn; {$IFDEF VerboseFocus} DebugLnExit('GTKFocusCB DONE');@@ -981,6 +982,7 @@ begin DebugLn('GTKillFocusCB GetFocus=',dbgs(CurFocusWidget),' ParentLCLObject=',dbgsName(LCLObject)); end; {$ENDIF}+ GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); Result:=CallBackDefaultReturn; end;
--- End quote ---
I fogot to meation about it. SET/UNSET "GTK_HAS_FOCUS" make not good behavier.
Navigation
[0] Message Index