Coder Social home page Coder Social logo

Comments (23)

ghaerr avatar ghaerr commented on May 28, 2024 1

Thanks for bringing this to my attention, I'll fix it.

Of course runapp isn't at all required to run the win32 api binaries, but the docs were rewritten to suggest using it to execute any binary so users don't have to know about nano-X versus win32 startup. Given that it already checks the binary for a "mw" prefix and skips the server start, I will have it skip the server presence check in that case.

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024 1

I see. Your design is actually very similar to the way that the Windows system emulator Parallels can be setup to run on OSX. That is, every emulated win32 application window can be setup to appear as a separate native-OS window. Kind of cool.

I will have to think about how this might work, basically the win32 binary would run natively, and all window calls would be allocated separate X11 windows to draw into. At first thought, this would mean that the Microwindows screen device would have to move from being a global, to being able to be created as seperate instances, each with its own drawing region. That's kind of hard.

In some sense, it might be easiest to just run a separate copy of MIcrowindows for each application, which just delays screen allocation until the CreateWindow call. And that would possibly work well until that same application threw up a dialog box, which would then have to run in a separate Microwindows instance, and that won't work.

I'll continue thinking about it!

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024 1

@rofl0r : I fixed runapp, finally.

Also added an experimental MW_FEATURE_RESIZEFRAME that resizes the outer OS frame around the application automatically as per your discussion above. This now works for win32 as well as Nano-X apps (requires LINK_APP_INTO_SERVER for Nano-X). Pretty cool actually, as it allows any Microwindows or Nano-X application to run standalone on the X11 desktop. Here's a screenshot.
MW Feature ResizeFrame

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

i'd suggest to look for the binary that's about to be launched instead

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

btw unrelated question, is there a way to make the win32 apps "free-floating" vs living inside a win95-colored window ?

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

What do you mean? Do you mean not running within a window within the 800x600 screen? So that it just displays using the full screen size but with no window frame?

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

exactly, so it behaves like any other x11 desktop app

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

If you create your main window without using the default style of WS_OVERLAPPEDWINDOW, but instead just use, perhaps WS_POPUP, and then specify the x,y params as 0,0 that should work, try that.

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

for clarification, this:
1
instead of
1

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

I just tested with WS_POPUP on demos/mwin/mwdemo2.c and that works... except that not only do you have to set x,y to 0,0 but the width, height to the screen size, which you can query using GetSystemMetrics(SM_CXSCREEN...

The system is compiled in to use a specific screen size, so this is problematic if you want to run different win32 apps and have them change the Microwindows screen size. But that could also be done with a patch, but it might be complicated given that the app would have to run before knowing the screen size expected.

Also, on the example above, its a bit more complicated, wince mwdvetest is actually a dialog box, rather than a standalone popup-window.

Which case are you looking for?

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

Screen Shot 2019-03-13 at 11 41 13 AM
Here's mwdemo2 with the mods suggested.

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

Which case are you looking for?

I've long played with the thought that the lack of a stable GUI toolkit is the reason we still haven't seen the year of the linux desktop, and that using the win32 api which is unchanged since win95 would be the optimal candidate, since it would allow GUI developers to use the same code for linux and windows (and it would allow to simply recompile existing OSS windows gui apps for linux by linking against -lgdi32 or similar)

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

(if you embed your patch snippet above into triple ` characters (each one on a line by itself) it would become way more readable)

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

An issue there will be that each application runs within its own Microwindows system, which is using then run again with X11, or on the single frame buffer linux console. Thus, multiple applications work on X11 but not on frame buffer.

I have a patch that I haven't submitted that allows multiple win32 apps to run at the same time, within a single frame buffer or X11 window. That's not quite what you need it seems though.

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

patch.txt
Thanks, here's the patch, you're right GitHub didn't take my last paste!

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

Mwin apps

Here's a screenshot of multiple win32 apps running in the same process.

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

I have a patch that I haven't submitted that allows multiple win32 apps to run at the same time, within a single frame buffer or X11 window. That's not quite what you need it seems though.

right, for my use case every program would need to create a standalone X11 window for every win32 windows it spawns, and not the "desktop mode" seen in your screenshot above

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

In order to make your idea work, we need to determine how the system will know the client window size by somehow running the client until the first CreateWindow call, then initializing the driver subsystem to the client window size. Currently the system isn't really written for that. But adding essentially a "realloc" might be feasible.

Another potential issue with your idea of a win32 linux desktop is that Microwindows only implements a small but usable subset of the user32 and gdi32, and real Windows programs typically require hugely more libs. Thus Wine was born, and look how big it is, in order to run everything!

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

determine how the system will know the client window size

client window size would mean the size of the X11 desktop? not following yet...

real Windows programs typically require hugely more libs. Thus Wine was born, and look how big it is

right... i was just playing around with wine sources and examined the "notepad" program source code. apart from the gui code, it seems to access the windows registry to get the dpi value of the desktop. without being very familiar with wine's internals, i suspect it will spin up some on-demand server processes to serve global registry accesses and other similar things.
which seems suboptimal/overdesigned for simple GUI purposes.
this could eventually be solved by mimicking the registry related api calls and just serving static values from a configuration file, or by simply patching out the related code and use a hardcoded dpi value...

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

A win32 "client size" is the size of the application's window not including the title bar and stuff that you don't want. What you are asking for is having both the win32 app (client size) equaling the size of the X11 window that Microwindows starts up. By default, Microwindows starts up with whatever you put in your config file, mine is 1024x768. So that would have to be down-sized to your win32 app's client size specified in the CreateWindow call. And that call is done way after Microwindows starts up, since Microwindows allocates the X11 display when starting, THEN runs the win32 app.

from microwindows.

ghaerr avatar ghaerr commented on May 28, 2024

I showed you a screen shot that was done in a 4 line patch where the win32 app was changed to display at 0,0, and the client size was 1024x768. But I think what you want is for the X11 display window to match the win32 app's requested window size, without window dressing. That's the problem I'm describing above.

In any case, let me know how I might help you, if you need a mod.

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

having both the win32 app (client size) equaling the size of the X11 window that Microwindows starts up

oh, alright. thinking about this design, would this even work if the main app window spawns other windows outside its own visible region (think gimp's floating toolkit windows)? i think it wouldn't. therefore in the theoretical mode i'm interested in, there would have to be no top "desktop" window, and each program window would need to be a separate X11 window, and microwindows wouldn't have to deal with mouse events outside the windows nor window positioning.

In any case, let me know how I might help you, if you need a mod.

even if my idea of having a win32-linux-desktop would need to be shelfed (still evaluating) i think this could be a very interesting usecase to get a number of existing win32 gui apps working as "native" linux/mac apps. i'm unsure whether the idea would play well with the existing code design, but maybe it could be implemented relatively easily and modular, without huge effort?

from microwindows.

rofl0r avatar rofl0r commented on May 28, 2024

cool, that looks really good! i'll try to test it out ASAP

from microwindows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.