Recent

Author Topic: Ubuntu Launcher not using OnShow  (Read 3297 times)

KarenT

  • Full Member
  • ***
  • Posts: 120
Ubuntu Launcher not using OnShow
« on: April 20, 2018, 12:51:24 am »
Ubuntu 16.04, Laz 1.8.2
Hello, I have a program tha requires a password on a timeout after being Minimized to the Launcher.

I have tried using the OnShow and the OnActivate events but they are ignored after the initial start-up.

How can I trap the Maximizing action as clearly the OnShow is not being called?

Thank you.

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Ubuntu Launcher not using OnShow
« Reply #1 on: April 20, 2018, 12:57:08 am »
OnWindowStateChange:

 You need to log the values here each time so when ever the event is triggered you can then
test the last one and act on it.
« Last Edit: April 20, 2018, 01:10:13 am by jamie »
The only true wisdom is knowing you know nothing

KarenT

  • Full Member
  • ***
  • Posts: 120
Re: Ubuntu Launcher not using OnShow
« Reply #2 on: April 20, 2018, 07:46:51 pm »
OnWindowStateChange:

Thanks, I had not noticed that in the list. But, it shows the underlying frmMain while asking for the password. There may be stuff I do not want viewed until the password has been verified.
Is there some way I can hold-back the frmMain display until I am sure the password is OK?

I tried a few things (Font.Color, Visible etc) but they all recursively trigger the OnWindowStateChange. No surprises there I guess. :)

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Ubuntu Launcher not using OnShow
« Reply #3 on: April 20, 2018, 11:52:41 pm »
what manner are you using for the Password frontend ?

 Not sure how this all plays out on non-windows targets but I think you can switch
the MAIN form in the Application to your Password form and hide the prior main form..

 Switch back when ok.
The only true wisdom is knowing you know nothing

soerensen3

  • Full Member
  • ***
  • Posts: 213
Re: Ubuntu Launcher not using OnShow
« Reply #4 on: April 21, 2018, 12:29:27 am »
Maybe you should create your form manually because otherwise it is really simple to show a hidden window from another application so it would also be very simple to bypass the password.
Lazarus 1.9 with FPC 3.0.4
Target: Manjaro Linux 64 Bit (4.9.68-1-MANJARO)

KarenT

  • Full Member
  • ***
  • Posts: 120
Re: Ubuntu Launcher not using OnShow
« Reply #5 on: April 21, 2018, 05:31:30 pm »
It is really simple to show a hidden window from another application so it would also be very simple to bypass the password.

Thanks, but I am not concerned with someone messing with it like that. I just don't like that OnWndowStateChange shows the sensitive data while waiting for the password. No point getting a password if stuff can be read anyway.

Using OnWndowStateChange is too much brute force as I cannot do anything with that Main window without that event triggering.

This is only happening in Ubuntu/Linux as the windows version behaves as expected when changing WndowState. It seems Uniuty's Launcher is immune to good behavior, or Lazarus/FPC is incapable of joining in with Unity and playing nice. :)

I cannot even intercept it with the "Message" process.

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Ubuntu Launcher not using OnShow
« Reply #6 on: April 21, 2018, 08:09:21 pm »
Ok,,

Lay a Tpanel on the form, place all of the controls on that. When it times out of what ever, Hide the Tpanel and then

show another TPanel that has your password entry code on it..

 at least this way you still have a single form sitting there, just with different content.


The only true wisdom is knowing you know nothing

KarenT

  • Full Member
  • ***
  • Posts: 120
Re: Ubuntu Launcher not using OnShow
« Reply #7 on: April 21, 2018, 08:47:34 pm »
show another TPanel that has your password entry code on it..

Thanks, I am currently doing that but it is not slick.It looks weird and prone to causing confusion when the user gets a blank screen. I am actually setting the Font color to the same as the background, but has a similar approach to your suggestion.

soerensen3

  • Full Member
  • ***
  • Posts: 213
Re: Ubuntu Launcher not using OnShow
« Reply #8 on: April 21, 2018, 11:03:33 pm »
Or make the password window the main form and hide it when the password is entered and show the other form. After the timeout do the reverse.
Lazarus 1.9 with FPC 3.0.4
Target: Manjaro Linux 64 Bit (4.9.68-1-MANJARO)

KarenT

  • Full Member
  • ***
  • Posts: 120
Re: Ubuntu Launcher not using OnShow
« Reply #9 on: April 23, 2018, 12:38:24 am »
Or make the password window the main form and hide it when the password is entered and show the other form. After the timeout do the reverse.
If only I could. I am using the Ubuntu system password manager.

Pretty sure it is not going to let me take control of that Form.

For now though I have an overlaying panel with "Password required" on the Main Form and I make that visible so they are not looking at an empty Form. Kinda clunky but the best I can do with no event for the Minimize and Maximize control when they use the Unity-Launcher.

 

TinyPortal © 2005-2018