VIDEO - DOSBox with no Window Frame

Here you can discuss the development of patches.

VIDEO - DOSBox with no Window Frame

Postby truth_deleted » 2013-7-13 @ 04:39

I removed the window frame and decorations from DOSBox 0.74/SVN (use output=surface). Attached is the win32 binary for testing by users and also a patch to view the code. I likely removed desirable features from the SDL window in removing the window frame, but posters have asked for no frame, so any trade-off in features may be worthwhile. The two batch files in the attachment allow the docking of dosbox in the top left or center of the screen. These may be further edited by the user. Also, the console window is removed by the batch files, so this is the ideal way to run this dosbox version.

[Edit: updated the SDL.dll library file so that the DOSBox window is borderless and movable. Right-click on the taskbar button for DOSBox and choose "Move", then use the keyboard arrow keys to move the window. Press Enter when finished. Also, the attached SDL defaults to the windib video driver. The modification doesn't seem to work with directx.]
You do not have the required permissions to view the files attached to this post.
Last edited by truth_deleted on 2013-7-17 @ 01:04, edited 2 times in total.
truth_deleted
 

Re: DOSBox with no Window Frame

Postby ykhwong » 2013-7-13 @ 08:04

This was discussed before. How can you move the window on the fly?
viewtopic.php?f=31&t=16034&p=111983
ykhwong
Oldbie
 
Posts: 627
Joined: 2004-3-17 @ 15:35

Re: DOSBox with no Window Frame

Postby truth_deleted » 2013-7-13 @ 08:28

ykhwong wrote:This was discussed before. How can you move the window on the fly?
viewtopic.php?f=31&t=16034&p=111983

I updated the parent post and attached binaries. The new version has a borderless window and the window can be moved on the fly.

[Old msg: Thank you for the reference to your past solution. I wonder if it is possible to bind four keys to move the window along the X and Y axes.]
truth_deleted
 

Re: DOSBox with no Window Frame

Postby ykhwong » 2013-7-13 @ 19:50

Thanks for the new binary. I like borderless window as it looks simple. I now can move the frameless window thanks to your updated instruction above though that's not that user-friendly.
I found SDL 2.0 RC implements SDL_GetWindowPosition/SDL_SetWindowPosition to handle window position while DOSBox is currently compatible with SDL 1.2 only. :depressed:

I found the following post which may help. Dunno if this will work under Windows.
http://devcry.heiho.net/2009/09/draggin ... indow.html

Some other ideas for better accessibility:
- When moving mouse cursor into the window, NOFRAME flag will be immediately removed and the title bar will be displayed so that users can move the window. The title bar will be still alive for about 3 seconds right after the cursor leaves from the window.
- Dragging the window while pressing shift key will move the window.
ykhwong
Oldbie
 
Posts: 627
Joined: 2004-3-17 @ 15:35

Re: DOSBox with no Window Frame

Postby truth_deleted » 2013-7-14 @ 06:04

ykhwong wrote:Thanks for the new binary. I like borderless window as it looks simple. I now can move the frameless window thanks to your updated instruction above though that's not that user-friendly.
I found SDL 2.0 RC implements SDL_GetWindowPosition/SDL_SetWindowPosition to handle window position while DOSBox is currently compatible with SDL 1.2 only. :depressed:

I found the following post which may help. Dunno if this will work under Windows.
http://devcry.heiho.net/2009/09/draggin ... indow.html

Some other ideas for better accessibility:
- When moving mouse cursor into the window, NOFRAME flag will be immediately removed and the title bar will be displayed so that users can move the window. The title bar will be still alive for about 3 seconds right after the cursor leaves from the window.
- Dragging the window while pressing shift key will move the window.

Ykhwong, thank you for the excellent suggestions for connecting the mouse with the window position. I learned of a way to move the dosbox window with the mouse and using the binaries from the parent post. If the dosbox button in the taskbar is pressed with the right mouse button, then the Move item appears; once the Move item is pressed by a left mouse click, then press a keyboard arrow key a single time; the cursor should now change from the arrow type to the typical mouse cursor. This will allow the window to move by mouse movements. The next mouse click will then exit this mode.

Second, I attached another SDL.dll library file to this post; it can be placed among the files from the parent post. It provides full movement of the dosbox window via the mouse. It just requires the left mouse button held down and then the window will move with the mouse. This is an ideal setup, however, this will exclude any capturing of the mouse cursor inside dosbox. So, this second method will only be applicable to running software that is keyboard driven within dosbox. If mouse capability is required, then we would use the first method which involves the keyboard.

I extensively tested other options, too. These did not work as well as the above ways. However, it is possible to implement a thin or thick border around the window. The Windows API allows for several variants on the border types. I did also note that the output=opengl is working with the above setup, but the openglhq code is not yet patched with the SDL library.
You do not have the required permissions to view the files attached to this post.
truth_deleted
 

Re: DOSBox with no Window Frame

Postby ykhwong » 2013-7-14 @ 17:47

I checked the last attachment and confirm that it is possible to move the window with convenience. :)
Did you use Windows APIs to allow the mouse movement for SDL? Does it work on platforms other than Windows?
ykhwong
Oldbie
 
Posts: 627
Joined: 2004-3-17 @ 15:35

Re: DOSBox with no Window Frame

Postby truth_deleted » 2013-7-14 @ 22:19

Yes, both the mouse movement and borders were generated by the Window API (via the SDL code). Unfortunately, these changes are specific to the Windows windib code and are implemented by by the "CreateWindow(Ex)" function. The mouse movement feature is an undocumented function of this API and so it appears very difficult to extend its functionality; any mouse event over the window will result in detection of a titlebar, even though it is not present. This prevented the mouse from being fully captured by dosbox.

It is reported that Winamp uses the Windows API, but calls a function to hide the titlebar. This is another strategy specific to Windows. However, this may exclude the possibility of capturing the mouse inside the application, as in the above case. Other solutions involved reinitializing the window, whether at the SDL or the Windows API level.

Another working solution is to enable the "toolbar window" option where the titlebar is thin and the font size reduced. This would allow normal window functions but just reduce the titlebar size and remove the window decorations.

I was also thinking about the openglhq mode. It should be possible to have a setting for "aspect ratio" and then calculate the dimensions of the screen for use by the SDL environmental variable.
truth_deleted
 

Re: DOSBox with no Window Frame

Postby ykhwong » 2013-7-15 @ 04:51

truth5678 wrote:The mouse movement feature is an undocumented function of this API and so it appears very difficult to extend its functionality; any mouse event over the window will result in detection of a titlebar, even though it is not present. This prevented the mouse from being fully captured by dosbox.


For the undocumented Windows APIs, you may refer to source code from ReactOS that has been noted for its information on them.
http://doxygen.reactos.org/d0/dcd/ntuse ... tml#l02930
ykhwong
Oldbie
 
Posts: 627
Joined: 2004-3-17 @ 15:35

Re: DOSBox with no Window Frame

Postby truth_deleted » 2013-7-15 @ 08:09

ykhwong wrote:
truth5678 wrote:The mouse movement feature is an undocumented function of this API and so it appears very difficult to extend its functionality; any mouse event over the window will result in detection of a titlebar, even though it is not present. This prevented the mouse from being fully captured by dosbox.

For the undocumented Windows APIs, you may refer to source code from ReactOS that has been noted for its information on them.
http://doxygen.reactos.org/d0/dcd/ntuse ... tml#l02930

Thank you for the informative reference. From further code changes, I now believe that the client area can not be altered in size without calling CreateWindow. Also, I believe the above undocumented function for window-based mouse movement is not extensible and that the titlebar is linked to any mouse-based window movement (in dosbox).
truth_deleted
 

Re: DOSBox with no Window Frame

Postby argenzul » 2013-10-01 @ 17:48

Hi, DOSBox without frame a really cool feature. Many times I have become frustrated by the frame and wished for someone to remove it.

However it doesn't work when I try to play a game with VESA resolutions (e.g. 640x480) like Star Trek - A Final Unity. Perhaps it has to do with the operations involved in resizing the window?
argenzul
Newbie
 
Posts: 6
Joined: 2008-8-21 @ 17:12

Re: DOSBox with no Window Frame

Postby truth_deleted » 2013-10-02 @ 03:55

I don't yet have a VESA game to test. Does Star Trek not work at all or does it work with a frame? Did you try different output modes (dosbox.conf)? Also, this "patch" will run with the windib driver, not the directx driver in SDL.
truth_deleted
 

Re: DOSBox with no Window Frame

Postby argenzul » 2013-10-02 @ 11:58

truth5678 wrote:Does Star Trek not work at all or does it work with a frame?

It does work in the original DOSBox 0.74 with a frame, except for a known issue with the dynamic core when you engage Romulan ships in battle (which is solved forcing a normal core). With your no-frame build, it simply crashes, leaving a completely clean stderr dump.

truth5678 wrote:Did you try different output modes (dosbox.conf)?

I made sure the conditions were the same for both the original 0.74 I normally use and the no-frame build. Here's what happened with the no-frame build:

  • Surface simply crashes when I run the executable.
  • Opengl allows me to watch a cropped intro cinematic, since it didn't change the resolution, then crashes.
  • Openglnb does the same as Opengl, cropped cinematic with no change in resolution, then crashes.
  • Overlay at least has the courtesy to center the cinematic, but it's still cropped and then crashes.
Trying the same stuff with the official build gave me no problem.
argenzul
Newbie
 
Posts: 6
Joined: 2008-8-21 @ 17:12

Re: DOSBox with no Window Frame

Postby truth_deleted » 2013-10-02 @ 15:53

The patch is against SVN code, not official build code (0.74). Test against SVN as indicated in the parent post.
truth_deleted
 

Re: DOSBox with no Window Frame

Postby argenzul » 2013-10-02 @ 22:55

My apologies for my lack of understanding :depressed:. I downloaded the latest SVN code, compiled and tested. The results are the same as with the official 0.74 build.
argenzul
Newbie
 
Posts: 6
Joined: 2008-8-21 @ 17:12

Re: DOSBox with no Window Frame

Postby truth_deleted » 2013-10-03 @ 04:29

I tested a game with VESA mode support, Warcraft 2, and it runs with the patch. This suggests that the problem with the patch is not solely related to the VESA modes. However, I attached an updated patch to configure the dosbox window at 640x480 which should provide better VESA mode support. This patch is for current SVN code.
You do not have the required permissions to view the files attached to this post.
truth_deleted
 

Re: DOSBox with no Window Frame

Postby Dominus » 2013-10-03 @ 05:53

Moving the topic to DOSBox Patches forum
User avatar
Dominus
DOSBox Moderator
 
Posts: 7616
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg


Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest