Forum > GTK

TDateTimePIcker calendar not responding in Linux gtk2。

(1/1)

jianwt:
 linux64  gtk2 lazarus (2.2.4)
TDateTimePIcker calendar not responding in Linux gtk2。
 the existing calendar dropdowns in tkDate mode do not respond to mouse clicks or keystrokes

How to solve this problem? Ask for help。

TRon:
@jainwt:
Although I understand why you made another report about this subject (it is now posted in the correct subforum) it is usually frowned upon to cross/double-post.

Reported by BobT: https://forum.lazarus.freepascal.org/index.php/topic,59974.0.html
Reported by jianwt: https://forum.lazarus.freepascal.org/index.php/topic,61824.0.html

I am able to confirm for 2.2.4 as well as 2.3.0 (Lazarus 2.3.0 (rev main-2_3-2689-g666ab2572e) FPC 3.2.2 x86_64-linux-gtk2)

It is a bug that should be corrected. Correcting a bug will take time (and should be reported in the bugtracker).

On a more general note: it is very nice for gitlab to have such a bugtracker but why on earth would I need to login first before being able to search for a specifc term (the old bugtracker did not have that restriction). imho It discourages people from contributing. I can't be arsed to login first in order to check whether or not a bug-report about this subject is present.

GetMem:

--- Quote from: jianwt on January 12, 2023, 03:03:05 am --- linux64  gtk2 lazarus (2.2.4)
TDateTimePIcker calendar not responding in Linux gtk2。
 the existing calendar dropdowns in tkDate mode do not respond to mouse clicks or keystrokes

How to solve this problem? Ask for help。

--- End quote ---
I did take a quick look, apparently gtk2 does not like explicit popup. Please do the following:
1. Open ../components/datetimectrls/datetimepicker.pas 
2. Search for pmExplicit, you should find it in TDTCalendarForm's constructor
3. Replace

--- Code: Pascal  [+][-]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";}};} ---  //...  if Assigned(DTPickersParentForm) then begin    DTPickersParentForm.AddHandlerOnVisibleChanged(@VisibleOfParentChanged);    DTPickersParentForm.FreeNotification(Self);       {PopupParent := DTPickersParentForm;  //<- this one    PopupMode := pmExplicit;}    PopupMode := pmNone;                  //<- with this one  end else    PopupMode := pmAuto;       //... 4. Rebuild the IDE

This will work with gtk2. For a more generic solution, an  ifdef lclgtk2 needed.

zeljko:
It is fixable inside gtk2 ws in that case: Do not set PopupMode to gtk2 window handle if modal form is active and our form.BorderStyle = bsNone.

jianwt:
Thank you for your answers,It works!!

Navigation

[0] Message Index

Go to full version