I have attached a patch that resolves the issue where --windowed
arguments were being ignored.

The Fix:
Modified include/winGL.h to change DEF_SDLGL_WINDOWED from 0 (Fullscreen) to 1 
(Windowed).

Investigation:
I audited the code execution flow to determine why the argument was failing:
1. gl_opt.c correctly parses the --windowed flag and sets the internal variable 
to 1.
2. Despite the parser working, the initialization logic in gl_main.c 
(specifically around detect_video_modes and SDL_SetVideoMode) appears to 
override this state or fallback to SDL_FULLSCREEN due to legacy resolution 
handling (800x600 defaults).
3. I considered modifying the C logic in gl_main.c to explicitly strip the 
fullscreen flag, but this introduces regression risks for legacy hardware.

Result:
Changing the default in the header (winGL.h) is the safest and most modern 
approach.
It aligns with modern desktop standards (Wayland/GNOME) where 800x600 
fullscreen is hostile to the user.
It resolves the "ignored argument" bug by ensuring the starting state is safe.
Users can still force fullscreen via --nowindowed, which I verified is 
correctly handled by the parser.

** Changed in: glhack (Ubuntu)
     Assignee: (unassigned) => YIN Renlong (renlong)

** Patch added: "Patch to set default mode to Windowed"
   
https://bugs.launchpad.net/ubuntu/+source/glhack/+bug/587459/+attachment/5939783/+files/fix_windowed_default.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/587459

Title:
  --windowed option doesn't do anything

To manage notifications about this bug go to:
https://bugs.launchpad.net/hundredpapercuts/+bug/587459/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to