Page 1 of 1

Multi desktops managing

Posted: Sun Jul 21, 2013 12:56 am
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.

Re: Multi desktops managing

Posted: Sun Jul 21, 2013 2:23 am
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.

Re: Multi desktops managing

Posted: Sun Jul 21, 2013 10:37 am
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...

Re: Multi desktops managing

Posted: Sun Jul 21, 2013 11:36 am
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.

Re: Multi desktops managing

Posted: Sun Jul 21, 2013 1:38 pm
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...

Re: Multi desktops managing

Posted: Thu Jul 25, 2013 6:35 am
by coder14
@Danilo: What function do we use to select which desktop to use?

Re: Multi desktops managing

Posted: Fri Jul 26, 2013 12:14 am
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)

Re: Multi desktops managing

Posted: Fri Jul 26, 2013 5:24 pm
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

Re: Multi desktops managing

Posted: Sat Jul 27, 2013 7:02 am
by Olliv
Code above is okay!