FVWM full screen SDL

A while back I sent this email:

https://www.mail-archive.com/fvwm-workers@fvwm.org/msg04870.html

I got no feedback that I remember. The problem was that Fvwm tries to decorate SDL fullscreen apps.
I just got email from a user telling me:

SDL 2 applications that set the flags
SDL_WINDOW_BORDERLESS and SDL_WINDOW_FULLSCREEN_DESKTOP still have
window decorations shown by Fvwm.

So it appears SDL expects window managers to look for these flags. This seems wrong to me, SDL should be setting some generic flag either ICCM or EMWH if there are such flags. But baring that if Fvwm started checking for those flags, at least SDL2 full screen apps would work correctly.

For myself, I just turned off decoration for the one app I was running. Not an ideal solution but it worked.

Hey @Dan,

Ah – I do remember this, and apologies this fell through the cracks. I’ve just taken a look…

Thanks to your instructions, I installed SDL2 and compiled the example program:

// Modification History
// Created on 04/09/20 by Dan Espen:
// - Demo fullscreen with SDL2
// - Full screen 640x480 window,
//   terminate with escape,
//   times out after a few secs.
#include <SDL2/SDL.h>

int main(int argc, char *argv[]) {
	SDL_Window* window = NULL;
	SDL_Renderer* renderer;
	if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_EVENTS) != 0) {
		SDL_Log("Failed to initialize SDL: %s", SDL_GetError());
		return 1;
	}
	// fixme, the WM is adding titlebar and borders,
	// To remove decoration, Run:
	// FvwmCommand 'Style "mywind" NoTitle, BorderWidth 0, HandleWidth 0'
	window = SDL_CreateWindow("mywind",
			SDL_WINDOWPOS_UNDEFINED,
			SDL_WINDOWPOS_UNDEFINED,
			640, 480,
			SDL_WINDOW_FULLSCREEN_DESKTOP
			|SDL_WINDOW_BORDERLESS);
	renderer = SDL_CreateRenderer(window, -1, 0);
	SDL_SetRenderDrawColor(renderer,
			0x80, 0x80, 0xFF, 0xFF); // RGBA
	SDL_RenderClear(renderer);
	SDL_RenderPresent(renderer);

	bool quitting = false;
	int how_long = 0;
	while(!quitting) {
		SDL_Event event;
		while( SDL_PollEvent(&event) ) {
			switch (event.type) {
				case SDL_QUIT:
					quitting = true;
					break;
				case SDL_KEYDOWN:
					switch (event.key.keysym.scancode) { 
						case SDL_SCANCODE_Q:
						case SDL_SCANCODE_ESCAPE:
							quitting = true;
							printf("quit on key\n");
							break;
					}
			}
		}
		SDL_Delay(300);
		if (how_long++ > 500) {
			quitting = true;
			printf("quit on count\n");
		}
	}
	SDL_DestroyWindow(window);
	SDL_Quit();
	exit(0);
}

But, when I run it, I get a fullscreened window (a nice blue colour, I must say!) without a border.

When I look at xprop(1) on this window, I see this:

_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0

I assume therefore this is what will fix things for you:

Style mywind MwmDecor

I have MwmDecor set globally, which is why things worked fine for me to begin with.

Kindly,
Thomas

Thanks, that helps.
As you said, the test program now comes up borderless and with no titlebar.
I find when I run the app I was using I still get the titlebar.
I have the source code so I’ll try to track down what’s different between my sample program and the app.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.