Recent

Author Topic: TDateTimePIcker calendar not responding in Linux gtk2。  (Read 2063 times)

jianwt

  • Jr. Member
  • **
  • Posts: 85
TDateTimePIcker calendar not responding in Linux gtk2。
« 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。

TRon

  • Hero Member
  • *****
  • Posts: 2432
Re: TDateTimePIcker calendar not responding in Linux gtk2。
« Reply #1 on: January 12, 2023, 05:27:17 am »
@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.
« Last Edit: January 12, 2023, 05:31:58 am by TRon »

balazsszekely

  • Guest
Re: TDateTimePIcker calendar not responding in Linux gtk2。
« Reply #2 on: January 12, 2023, 02:51:05 pm »
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。
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  [Select][+][-]
  1.   //...
  2.   if Assigned(DTPickersParentForm) then begin
  3.     DTPickersParentForm.AddHandlerOnVisibleChanged(@VisibleOfParentChanged);
  4.     DTPickersParentForm.FreeNotification(Self);  
  5.     {PopupParent := DTPickersParentForm;  //<- this one
  6.     PopupMode := pmExplicit;}
  7.     PopupMode := pmNone;                  //<- with this one
  8.   end else
  9.     PopupMode := pmAuto;    
  10.   //...
  11.  
4. Rebuild the IDE

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

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TDateTimePIcker calendar not responding in Linux gtk2。
« Reply #3 on: January 12, 2023, 03:03:46 pm »
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

  • Jr. Member
  • **
  • Posts: 85
Re: TDateTimePIcker calendar not responding in Linux gtk2。
« Reply #4 on: January 13, 2023, 01:58:00 am »
Thank you for your answers,It works!!
« Last Edit: January 13, 2023, 02:25:54 am by jianwt »

 

TinyPortal © 2005-2018