Page 3 of 3

Re: Linux Workspace 2-4

Posted: Monday 31st October 2022 3:35pm
by AndyGable
Cool

thank you for the information

would there be a reason why when I have FMain.hide or FMain.visible = false the form is still shown

is the first form hide status ignored in Gambas?

Re: Linux Workspace 2-4

Posted: Monday 31st October 2022 4:39pm
by BruceSteers
Okay for screens use something like this...

Public Sub GoToScreen(iOpenOn As Integer)

  Me.Left = ((Screens[iOpenOn].W - Me.W) / 2) + Screens[iOpenOn].X
  Me.Top = ((Screens[iOpenOn].H - Me.H) / 2) + Screens[iOpenOn].Y

End

that will jump to the selected display center screen.

and you can use Me.Window.Screen to detect the display you are currently on but it does not work until the application has loaded (not in Form_Open or Form_Show)

Screens[0] is primary Screens[1] secondary

Re: Linux Workspace 2-4

Posted: Monday 31st October 2022 4:43pm
by BruceSteers
AndyGable wrote: Monday 31st October 2022 3:35pm Cool

thank you for the information

would there be a reason why when I have FMain.hide or FMain.visible = false the form is still shown

is the first form hide status ignored in Gambas?

Without seeing the code it's impossible to guess, but to answer the question, no, the main form is not restricted from hiding.

Public Sub btnHideMe_Click()

  Me.Hide
  Wait 3
  Me.show

End

If i do that my window hides then pops back 3 seconds later even without Persistent set true.
So it's your code somewhere either preventing the window closing or opening it again.

Is there a check to stop the form closing in Form_Close? (setting Persistent should fix that)
a LostFocus() event could be triggered, do you have one regaining focus?.
a .SetFocus() or .Activate() or .EnsureVisible call could cause form to re-show.

Re: Linux Workspace 2-4

Posted: Monday 31st October 2022 8:36pm
by BruceSteers
okay so now i have this app....

like before the workspace switching functions but they have been fixed to work with multiple displays.
if more than one monitor my size calculations were incorrect.

Added a class called it BigScreen
BigScreen.Width
BigScreen.Height


Will show the total screen size including both monitors if there are 2, this fixes my previous code.

also now the test app has a screen switching option as well as workspace switching.

It may require some debugging on systems i've not tested it on.

Best wishes

Re: Linux Workspace 2-4

Posted: Wednesday 2nd November 2022 9:05pm
by BruceSteers
Here's a little Workspace switcher i just made...

It has some updates/fixes to the classes in the above mentioned project.

It's set to work on a System tray icon but the code could probably be easily made to pop open the window via a button in your own project to visually switch workspaces.

I've tried to make it show windows on other workspaces in the selection window while the preview for the current desktop is a screenshot.

Enjoy :)

Re: Linux Workspace 2-4

Posted: Thursday 23rd March 2023 2:27pm
by ralphmeyer
I am aware this answer comes a bit late, but for others who might have the same question. To answer your question, yes, it is possible to have an application start on one workspace and then move it to another. In fact, most Linux desktop environments have a built-in feature to do just that.If you want to automate this process for multiple applications, you can use a tool like Devilspie, which allows you to define rules for how windows should behave, including which workspace they should appear on.As far as I know, the same option works for CentOS7 too. So, you may try it. But I've heard that it has reached its end of life. Anyway, if you're interested, you can verify it at https://tuxcare.com/extended-lifecycle-support/centos-7-extended-support/

Re: Linux Workspace 2-4

Posted: Thursday 23rd March 2023 8:11pm
by BruceSteers
ralphmeyer wrote: Thursday 23rd March 2023 2:27pm I am aware this answer comes a bit late, but for others who might have the same question. To answer your question, yes, it is possible to have an application start on one workspace and then move it to another. In fact, most Linux desktop environments have a built-in feature to do just that.If you want to automate this process
Well yes but his question was "can i do this with gambas?"

I'm guessing with the little coding adventure we went on he figured out a way to do it :)

I figured it out ,,, and then some... ;)