Multi desktops managing

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Multi desktops managing

Post by Olliv »

If it was able to manage graphic objects (world rendering, sprites, etc...) on one screen and manage basic OS GUI on the other screen, PureBASIC would reach a very high level.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Multi desktops managing

Post by Danilo »

Olliv wrote:If it was able to manage graphic objects (world rendering, sprites, etc...) on one screen and manage basic OS GUI on the other screen, PureBASIC would reach a very high level.
You can do that already. For the screen, open a borderless screen-size (maximized) window and use OpenWindowedScreen() on that win. On other screens use more GUI windows.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Multi desktops managing

Post by Olliv »

I don't think so!

It's sure we can do it technically! But after a big headache! And full screen works like windowed screen.

Mouse library is not adapted and full screen could be used too (excepted if the OS wastes graphic memory).

Mouse and OS GUI should have the same behavior in the full screen like in the windowed screen (and vice versa, actually, there is none better than the other one).

I could see any light bugs (no crash, what shows a future availability).

- window focus lost (full scr)
> I use taskbar to take it again (SetActiveWindow is tired)
- desktop mouse value lost (full scr)
> ReleaseMouse is tired however ExamineMouse is no used anymore. Just one time you use Examining, no more ever you could execute Releasing!
- mouse pointor lost (full scr) or "busy" (window scr)
> A new command should added to allow the user to have or not to have a personnal parade to display the mouse pointor. In the way I have a sprite or an entity etc... to represent the mouse, or in the way I prefer the OS standard mouse representation on the graphic screen.
- short dark flickering at the end of the program (full scr) on the OS GUI display.

I did not test keyboard. But I think excepted that there is no more bugs...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Multi desktops managing

Post by IdeasVacuum »

I can't see any bugs in your list - it's just that you have to code the solutions yourself, which is easier on Windows than the other platforms. There is a huge amount of code on the forum which tackles these issues.

I certainly agree that an official PB lib seamlessly supporting Window/Windowed Screen/Full Screen would be a fantastic enhancement.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Multi desktops managing

Post by Olliv »

IdeasVacuum wrote:I can't see any bugs in your list - it's just
that you have to code the solutions
yourself
In the list I give, you can see:
"
- short dark flickering at the end of the program (full scr) on the OS GUI display.
"

I am fair-play. If anybody could make a code which respond to this problem, I put 50E donation to Fantaisie Software. If there is some questions about this, sure I ll give more precisions about this "short dark flickering".

The first precision I can give is I am not under one or more molecules which affect my view!!! No, really I don't lie...
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Multi desktops managing

Post by coder14 »

@Danilo: What function do we use to select which desktop to use?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Multi desktops managing

Post by IdeasVacuum »

coder14 - it is usually the User that decides where the Window will be at any given time. It's often not a concern as to which monitor the User chose, but life can be tricky if there is a difference in size between the monitors being used.

In Windows OS, you can use MonitorFromWindow_() to find out which monitor the Window of interest is currently on.

Code: Select all

Enumeration 0 Step 1
#MONITOR_DEFAULTTONULL
#MONITOR_DEFAULTTOPRIMARY
#MONITOR_DEFAULTTONEAREST
EndEnumeration

Enumeration 0 Step 1
#MONITOR_CLIP
#MONITOR_CENTER
#MONITOR_WORKAREA
EndEnumeration

Structure MONITORINFO ;or MONITORINFOEX with added string for device name
cbSize.i
rcMonitor.RECT
rcWorkArea.RECT
flags.i
EndStructure

WinInfo.MONITORINFO

WinInfo\cbSize = SizeOf(WinInfo)
 WinInfo\flags = 0

;In your loop:
hMonWn.i = MonitorFromWindow_(WindowID(#WIN_H),#MONITOR_DEFAULTTONEAREST)
            GetMonitorInfo_(hMonWn,@WinInfo)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Multi desktops managing

Post by Olliv »

@IdeasVacuum

No time to test actually. I thank you for your code. Maybe coder14 wanted to know if we could set the monitor in which the graphic full screen will be displayed.

Because that's all right we (the user) can choose where a window will be displayed. I get it setting X window value equal the whole width of the desktop #0.

Code: Select all

examinedesktops()
openwindow(WinNo, desktopwidth(0),  etc...
This should display normally the window on the 2nd desktop.

But for the graphic full screen it s an other affair...


For the "short black flickering", perhaps freezing manually the os displaying.

Freeze__
CloseScreen()
UnFreeze__

Actually I don't see the solution.

Olliv
User avatar
Olliv
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Sep 22, 2009 10:41 pm

Re: Multi desktops managing

Post by Olliv »

Code above is okay!
Post Reply