Mr-Technician / BorderlessMinecraft

Application to run Minecraft as a borderless window.
GNU General Public License v3.0
128 stars 20 forks source link

3rd party launchers not being detected #9

Closed ghost closed 4 years ago

ghost commented 4 years ago

I always play minecraft with pvplauncher and your program doesn't recognize that. Maybe show every single window if a checkbox is marked or let the user add a window by entering the window title.

ghost commented 4 years ago

Even though you know your code better than I do I found that you seem to show the processes where Minecraft is included in the title in this file on line 95. I would suggest either removing the check to see whether a process contains the minecraft name and rebranding the product to "Borderless[Anything]" or supporting a few different launchers. Maybe add Forge, PvPLounge client Badlion Client and others.

Mr-Technician commented 4 years ago

There is a toggle to show all clients based on process name alone. When you use pvplauncher, does your task manager still show javaw.exe? @LaniJW

There is definitely room for improvement as most of this code was written about a year ago when I first started using C#. I need to rethink how I detect running windows as getting all processes isn't particularly efficient. Releasing this as a more generic application does sound like a good idea, but I would want to completely rewrite the application from the ground up.

ghost commented 4 years ago

What toggle would that be? Also, there's not process named javaw.exe running when I launch PVPLounge I assume that's because PVPLounge somehow embeds the JRE in its own process because I can see "Java Chromium Embedded Framework (JCEF) Helper" processes under the launcher.exe (PVPLounge process name) process. This sounds like a project I would actually quite like contributing but I sadly don't have much time and I would have to learn how to develop using C#.

Mr-Technician commented 4 years ago

The option is called "Show all clients" but it won't work if the process isn't javaw.exe. I had assumed that 3rd party clients would still run as javaw.exe, so this explains similar issues that others have had.

One thought I had would be to release the generic version of this with an installer and add the ability to "favorite" an application and have it always shown in the list of applications, otherwise there would be a "show all windows" button. It could further expand into a full window manager for resizing windows in ways that windows doesn't allow by default.

Edit: C# isn't hard to learn, if you've used Java or a similar language you could pick it up quickly.

ghost commented 4 years ago

Favoriting an application would definitely also help with the "efficiency" of querying all processes. Fixing this shouldn't be anything more than just deleting the check for "javaw" in the process name, no? Why would you bake the ability to favorite an application only in the installer? That would block you from changing that later, unless you save the settings to a file, but then it'll still be rather cumbersome for the average user to change it.

Regarding C#, I've already written a lot of Java, I actually work with Java and TypeScript every day and and work with JavaScript (I know it's not that similar, please don't hate me) on web dev projects too. I'm just saying I'd have to get into the whole GUI creation with WPF, which takes more time than I have atm.

Mr-Technician commented 4 years ago

Querying all processes is slow because it also detects all of the system processes, not just all windows. On my machine I probably have 30 windows open but 300+ processes according to the task manager.

True, I could have a standalone exe that looks for an associated config file that would store those favorites. Otherwise an installer would make it easier for the end user.

I work with C# for .NET and .NET core web development, so winforms is something I've done very little with (just this application). I also use Javascript a lot for client side stuff, but haven't done much with Java since taking AP Computer Science.