Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-10

SetFocus have no effect after TCustomForm.Show

14 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gabor Boros

Hi All,

The attached example works on Windows properly. But not with Linux Qt (KDE4). I want to see the green form above Form2 while Form2.Edit1 focused. (Press btnForm2 on Form1 and press Button1 on Form2.) If focus Edit1 manually the green form go under Form2. I reported some problem earlier as bug in the tracker but revealed just lack of my knowledge. Now try this place first...

Gabor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Show_SetFocus.tar.gz
Type: application/gzip
Size: 1734 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151016/b6c46532/attachment.bin>

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 8 lines
Hi All, The attached example works on Windows properly. But not with Linux Qt (KDE4). I want to see the green form above Form2 while Form2.Edit1 focused. (Press btnForm2 on Form1 and press Button1 on Form2.) If focus Edit1 manually the green form go under Form2. I reported some problem earlier as bug in the tracker but revealed just lack of my knowledge. Now try this place first...

hmmm...yes, using KDE4 green popup form is below modal form when I click into TEdit control. Better create issue and attach Show_SetFocus.tar.gz as example so it won't be forgotten.

zeljko

Reply by email

Zeljko
to Gabor Boros: The attached example works on Windows properly. But not with Linux Qt (KDE4). I want to…
Gabor Boros wrote 8 lines
Hi All, The attached example works on Windows properly. But not with Linux Qt (KDE4). I want to see the green form above Form2 while Form2.Edit1 focused. (Press btnForm2 on Form1 and press Button1 on Form2.) If focus Edit1 manually the green form go under Form2. I reported some problem earlier as bug in the tracker but revealed just lack of my knowledge. Now try this place first...
You can set FormStyle := fsStayOnTop for that popup form so you'll
achieve that effect.

zeljko

Reply by email

Gabor Boros
to Zeljko

2015.10.16. 13:14 keltez?ssel, Zeljko ?rta:

Show quoted text 5 lines
You can set FormStyle := fsStayOnTop for that popup form so you'll achieve that effect. zeljko

I tried this before wrote to the list but have a side effect. The green form showed above all other opened windows (not just form's of current application) in the OS with KDE4 and Windows too.

Gabor

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 10 lines
2015.10.16. 13:14 keltez?ssel, Zeljko ?rta: > > You can set FormStyle := fsStayOnTop for that popup form so you'll > achieve that effect. > > zeljko I tried this before wrote to the list but have a side effect. The green form showed above all other opened windows (not just form's of current application) in the OS with KDE4 and Windows too.

Please try with attached patch. In this case you can test without FormStyle := fsStayOnTop. FYI, in this patch I'm setting stayontop for X11 so that could make a problem.
Test with this patch and let me know if this is what you want. If not I have (maybe) another solution.

zeljko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_popup_fix.diff
Type: text/x-patch
Size: 1871 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151016/10c197fd/attachment.bin>

Reply by email

Gabor Boros
to Zeljko: Please try with attached patch. In this case you can test without FormStyle :=…

2015.10.16. 13:41 keltez?ssel, Zeljko ?rta:

Show quoted text 8 lines
Please try with attached patch. In this case you can test without FormStyle := fsStayOnTop. FYI, in this patch I'm setting stayontop for X11 so that could make a problem. Test with this patch and let me know if this is what you want. If not I have (maybe) another solution. zeljko
I see same as with FormStyle := fsStayOnTop.
Green form stay above every opened windows in the OS.

Is fsStayOnTop working properly? Because I see fsSystemStayOnTop exists too.

Gabor

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 15 lines
2015.10.16. 13:41 keltez?ssel, Zeljko ?rta: > > Please try with attached patch. In this case you can test without > FormStyle := fsStayOnTop. FYI, in this patch I'm setting stayontop for > X11 so that could make a problem. > Test with this patch and let me know if this is what you want. If not I > have (maybe) another solution. > > zeljko I see same as with FormStyle := fsStayOnTop. Green form stay above every opened windows in the OS. Is fsStayOnTop working properly? Because I see fsSystemStayOnTop exists too.

Under X11 they're same. Pls, try another patch which uses another approach (I've sent it in previous mail).

zeljko

Reply by email

Gabor Boros
to Zeljko

2015.10.16. 14:15 keltez?ssel, Zeljko ?rta:

Show quoted text 5 lines
> Is fsStayOnTop working properly? Because I see fsSystemStayOnTop exists > too. Under X11 they're same. Pls, try another patch which uses another approach (I've sent it in previous mail).

I nor see difference on Windows between fsStayOnTop and fsSystemStayOnTop.

Tried second patch with trunk and awesome. Works like a charm! The SetFocus problem is fixed also.

Gabor

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 11 lines
2015.10.16. 14:15 keltez?ssel, Zeljko ?rta: >> Is fsStayOnTop working properly? Because I see fsSystemStayOnTop exists >> too. > > Under X11 they're same. Pls, try another patch which uses another > approach (I've sent it in previous mail). I nor see difference on Windows between fsStayOnTop and fsSystemStayOnTop. Tried second patch with trunk and awesome. Works like a charm! The SetFocus problem is fixed also.

Ok, then please open issue about it and attach example as you attached in your e-mail, so then I'll commit patch and connect it to that issue (so it's easier to track possible regressions).

zeljko

Reply by email

Gabor Boros
to Zeljko: Ok, then please open issue about it and attach example as you attached in your e-mail, so…
Ok, then please open issue about it and attach example as you attached in your e-mail, so then I'll commit patch and connect it to that issue (so it's easier to track possible regressions).

I found a problem. See the attached example. With Form2 works like a charm after patch applied, but with Form1 works like before patch.

Gabor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Show_SetFocus2.tar.gz
Type: application/gzip
Size: 2170 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151016/243646df/attachment-0001.bin>

Reply by email

Zeljko
to Gabor Boros
Gabor Boros wrote 6 lines
> Ok, then please open issue about it and attach example as you attached > in your e-mail, so then I'll commit patch and connect it to that issue > (so it's easier to track possible regressions). I found a problem. See the attached example. With Form2 works like a charm after patch applied, but with Form1 works like before patch.

I don't understand. Can you explain better what's exact problem ?

zeljko

Reply by email

Gabor Boros
to Zeljko

2015.10.17. 14:34 keltez?ssel, Zeljko ?rta:

Show quoted text 6 lines
> I found a problem. See the attached example. With Form2 works like a > charm after patch applied, but with Form1 works like before patch. I don't understand. Can you explain better what's exact problem ? zeljko

Start the example project, go to Form2 press down arrow in the editbox. You see green form displayed above Form2 and editbox have the focus. Works as expected. Try same steps on Form1, green form displayed above Form1, but editbox not got the focus and if click into the editbox green form go under Form1. I see this problem with KDE4.

Gabor

Reply by email