Frameless window

--------------72A16F3D2A0409E7909ABDE5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi there,

I made a patch to SDL-1.1.6 that allows for the creation of a window
without a titlebar, title buttons and frame (Windows DIB and DX5 driver
only) by setting a videomode flag (SDL_NOWINTITLE).

Should I post the patch here? Does anyone want the patch?

Now I wanted to ask for some help on getting the same to work for
Xwindows.

The Gtk lib seems to be able to do just that by setting a WMHint that is
recognized my most modern windows managers. But I can’t figure it out
how to reimplement that without Gtk, nor could I find any applications
that do that without using the Gtk libs. A good example for an
application that makes use of this feature is xmms (Linux) or Winamp
(Windows) that has its own WM decoration and handling.

It seems a useful feature to add to SDL.

Ciao
Andreas–
| Andreas Schiffler aschiffler at home.com |
| Senior Systems Engineer - Deskplayer Inc., Buffalo |
| 4707 Eastwood Cres., Niagara Falls, Ont L2E 1B4, Canada |
| +1-905-371-3652 (private) - +1-905-371-8834 (work/fax) |

--------------72A16F3D2A0409E7909ABDE5
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public “-//w3c//dtd html 4.0 transitional//en”>

Hi there,

I made a patch to SDL-1.1.6 that allows for the creation of a window without a titlebar, title buttons and frame (Windows DIB and DX5 driver only) by setting a videomode flag (SDL_NOWINTITLE).

Should I post the patch here? Does anyone want the patch?

Now I wanted to ask for some help on getting the same to work for Xwindows.

The Gtk lib seems to be able to do just that by setting a WMHint that is recognized my most modern windows managers. But I can't figure it out how to reimplement that without Gtk, nor could I find any applications that do that without using the Gtk libs. A good example for an application that makes use of this feature is xmms (Linux) or Winamp (Windows) that has its own WM decoration and handling.

It seems a useful feature to add to SDL.

Ciao
Andreas
 

-- 
|  Andreas Schiffler                    aschiffler at home.com  |
|  Senior Systems Engineer    -    Deskplayer Inc., Buffalo  |
|  4707 Eastwood Cres., Niagara Falls, Ont  L2E 1B4, Canada  |
|  +1-905-371-3652 (private)  -  +1-905-371-8834 (work/fax)  |
 

--------------72A16F3D2A0409E7909ABDE5–

Wed, 03 Jan 2001 Andreas Schiffler wrote:

Hi there,

I made a patch to SDL-1.1.6 that allows for the creation of a window
without a titlebar, title buttons and frame (Windows DIB and DX5 driver
only) by setting a videomode flag (SDL_NOWINTITLE).

Should I post the patch here? Does anyone want the patch?

Now I wanted to ask for some help on getting the same to work for
Xwindows.

The Gtk lib seems to be able to do just that by setting a WMHint that is
recognized my most modern windows managers. But I can’t figure it out
how to reimplement that without Gtk, nor could I find any applications
that do that without using the Gtk libs. A good example for an
application that makes use of this feature is xmms (Linux) or Winamp
(Windows) that has its own WM decoration and handling.

It seems a useful feature to add to SDL.

I like the idea. :slight_smile:

As to the X implementation, the first place I’d look for a code example is in
the GTK source. (Probably actually in the GDK, as that’s where that kind of low
level stuff is, AFAIK.) There may be some Open Source programs that do it
directly on X, but I have a feeling that the GTK/GDK code is more likely to be
similar to what’s needed for SDL…

//David

…- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' ..- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -’

Should I post the patch here? Does anyone want the patch?

yes! what i actually need is to open windows with arbitrary shapes. your code
would help me get into the sdl.

It seems a useful feature to add to SDL.

definitely.

timo

This is a multi-part message in MIME format.
--------------3330113F043B90F2372F3E79
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Timo Peichl wrote:

Should I post the patch here? Does anyone want the patch?

yes! what i actually need is to open windows with arbitrary shapes. your code
would help me get into the sdl.

Attached …–
| Andreas Schiffler aschiffler at home.com |
| Senior Systems Engineer - Deskplayer Inc., Buffalo |
| 4707 Eastwood Cres., Niagara Falls, Ont L2E 1B4, Canada |
| +1-905-371-3652 (private) - +1-905-371-8834 (work/fax) |

--------------3330113F043B90F2372F3E79
Content-Type: text/plain; charset=us-ascii;
name="SDL-1.1.6-nowintitle.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename=“SDL-1.1.6-nowintitle.patch”

diff -rbd -U 5 SDL-1.1.6/include/SDL_video.h SDL-1.1.6-pa/include/SDL_video.h
— SDL-1.1.6/include/SDL_video.h Sat Sep 23 20:59:46 2000
+++ SDL-1.1.6-pa/include/SDL_video.h Wed Jan 3 08:29:45 2001
@@ -133,10 +133,11 @@
#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode /
#define SDL_FULLSCREEN 0x80000000 /
Surface is a full screen display /
#define SDL_OPENGL 0x00000002 /
Create an OpenGL rendering context /
#define SDL_OPENGLBLIT 0x0000000A /
Create an OpenGL rendering context and use it for blitting /
#define SDL_RESIZABLE 0x00000010 /
This video mode may be resized /
+#define SDL_NOWINTITLE 0x00000020 /
No title and frame for window /
/
Used internally (read-only) /
#define SDL_HWACCEL 0x00000100 /
Blit uses hardware acceleration /
#define SDL_SRCCOLORKEY 0x00001000 /
Blit uses a source color key /
#define SDL_RLEACCELOK 0x00002000 /
Private flag /
#define SDL_RLEACCEL 0x00004000 /
Colorkey blit is RLE accelerated */
diff -rbd -U 5 SDL-1.1.6/src/video/windib/SDL_dibevents.c SDL-1.1.6-pa/src/video/windib/SDL_dibevents.c
— SDL-1.1.6/src/video/windib/SDL_dibevents.c Sun Jul 16 22:39:36 2000
+++ SDL-1.1.6-pa/src/video/windib/SDL_dibevents.c Wed Jan 3 08:48:10 2001
@@ -304,16 +304,17 @@
return(keysym);
}

int DIB_CreateWindow(_THIS)
{

  • DWORD style;
    SDL_RegisterApp(“SDL_app”, CS_BYTEALIGNCLIENT, 0);
    if ( SDL_windowid ) {
    SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
    } else {
  •   SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
    
  •                    (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
    
  •   style=GetWindowLong(SDL_Window, GWL_STYLE);
    
  •   SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, style,
                                0, 0, 0, 0, NULL, NULL, SDL_Instance, NULL);
      if ( SDL_Window == NULL ) {
      	SDL_SetError("Couldn't create window");
      	return(-1);
      }
    

diff -rbd -U 5 SDL-1.1.6/src/video/windib/SDL_dibvideo.c SDL-1.1.6-pa/src/video/windib/SDL_dibvideo.c
— SDL-1.1.6/src/video/windib/SDL_dibvideo.c Mon Sep 25 02:14:38 2000
+++ SDL-1.1.6-pa/src/video/windib/SDL_dibvideo.c Wed Jan 3 08:48:56 2001
@@ -491,11 +491,15 @@
style = (WS_POPUP|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_MAXIMIZE);
} else {
if ( (prev_flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
ChangeDisplaySettings(NULL, 0);
}

  •   if ( (video->flags & SDL_NOWINTITLE) == SDL_NOWINTITLE ) {
    
  •   	style = WS_POPUP;
    
  •   } else {
      style = (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
    
  •   }
      if ( flags & SDL_RESIZABLE ) {
      	style |= WS_THICKFRAME|WS_MAXIMIZEBOX;
      	video->flags |= SDL_RESIZABLE;
      	if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
      }
    

diff -rbd -U 5 SDL-1.1.6/src/video/windx5/SDL_dx5events.c SDL-1.1.6-pa/src/video/windx5/SDL_dx5events.c
— SDL-1.1.6/src/video/windx5/SDL_dx5events.c Mon Oct 2 22:24:32 2000
+++ SDL-1.1.6-pa/src/video/windx5/SDL_dx5events.c Wed Jan 3 08:36:42 2001
@@ -745,10 +745,11 @@
}

int DX5_CreateWindow(_THIS)
{
int i;

  • DWORD style;

    /* Clear out DirectInput variables in case we fail /
    for ( i=0; i<MAX_INPUTS; ++i ) {
    SDL_DIdev[i] = NULL;
    SDL_DIevt[i] = NULL;
    @@ -758,12 +759,12 @@
    /
    Create the SDL window */
    SDL_RegisterApp(“SDL_app”, CS_BYTEALIGNCLIENT, 0);
    if ( SDL_windowid ) {
    SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
    } else {

  •   SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
    
  •                    (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
    
  •   style = GetWindowLong(SDL_Window, GWL_STYLE);
    
  •   SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, style,
                                0, 0, 0, 0, NULL, NULL, SDL_Instance, NULL);
      if ( SDL_Window == NULL ) {
      	SDL_SetError("Couldn't create window");
      	return(-1);
      }
    

diff -rbd -U 5 SDL-1.1.6/src/video/windx5/SDL_dx5video.c SDL-1.1.6-pa/src/video/windx5/SDL_dx5video.c
— SDL-1.1.6/src/video/windx5/SDL_dx5video.c Mon Oct 23 01:34:40 2000
+++ SDL-1.1.6-pa/src/video/windx5/SDL_dx5video.c Wed Jan 3 08:40:35 2001
@@ -1015,12 +1015,17 @@
style = GetWindowLong(SDL_Window, GWL_STYLE);
if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
style &= ~windowstyle;
style |= directstyle;
} else {

  •   if ( (flags & SDL_NOWINTITLE) == SDL_NOWINTITLE ) {
    
  •   	style &= ~windowstyle;
    
  •   	style |= directstyle;
    
  •   } else {	
      style &= ~directstyle;
      style |= windowstyle;
    
  •   }
      if ( flags & SDL_RESIZABLE ) {
      	style |= WS_THICKFRAME|WS_MAXIMIZEBOX;
      }
    
    }
    SetWindowLong(SDL_Window, GWL_STYLE, style);
    diff -rbd -U 5 SDL-1.1.6/test/testalpha.c SDL-1.1.6-pa/test/testalpha.c
    — SDL-1.1.6/test/testalpha.c Sun Oct 22 23:45:11 2000
    +++ SDL-1.1.6-pa/test/testalpha.c Wed Jan 3 12:53:51 2001
    @@ -304,10 +304,13 @@
    –argc;
    if ( strcmp(argv[argc-1], “-bpp”) == 0 ) {
    video_bpp = atoi(argv[argc]);
    –argc;
    } else
  •   if ( strcmp(argv[argc], "-notitle") == 0 ) {
    
  •   	videoflags |= SDL_NOWINTITLE;
    
  •   } else
      if ( strcmp(argv[argc], "-hw") == 0 ) {
      	videoflags |= SDL_HWSURFACE;
      } else
      if ( strcmp(argv[argc], "-warp") == 0 ) {
      	videoflags |= SDL_HWPALETTE;
    

--------------3330113F043B90F2372F3E79–

At 21:22 Uhr +0100 03.01.2001, David Olofson wrote:

Wed, 03 Jan 2001 Andreas Schiffler wrote:

Hi there,

I made a patch to SDL-1.1.6 that allows for the creation of a window
without a titlebar, title buttons and frame (Windows DIB and DX5 driver
only) by setting a videomode flag (SDL_NOWINTITLE).

Should I post the patch here? Does anyone want the patch?

Now I wanted to ask for some help on getting the same to work for
Xwindows.

The Gtk lib seems to be able to do just that by setting a WMHint that is
recognized my most modern windows managers. But I can’t figure it out
how to reimplement that without Gtk, nor could I find any applications
that do that without using the Gtk libs. A good example for an
application that makes use of this feature is xmms (Linux) or Winamp
(Windows) that has its own WM decoration and handling.

It seems a useful feature to add to SDL.

I like the idea. :slight_smile:

As to the X implementation, the first place I’d look for a code example is in
the GTK source. (Probably actually in the GDK, as that’s where that
kind of low
level stuff is, AFAIK.) There may be some Open Source programs that do it
directly on X, but I have a feeling that the GTK/GDK code is more likely to be
similar to what’s needed for SDL…

It is matter of a few seconds to implement this on MacOS (you only
need to specify a different WDEF ID), so maybe it is possible to add
this feature to SDL in the future, for all platforms?!?

Max–

Max Horn
International C/C++/Internet Development

email: mailto:Max_Horn
web: http://www.quendi.de
phone: (+49) 6151-494890

At 13:02 Uhr -0500 04.01.2001, Andreas Schiffler wrote:

Max,

It is matter of a few seconds to implement this on MacOS (you only
need to specify a different WDEF ID), so maybe it is possible to add
this feature to SDL in the future, for all platforms?!?

Great. Under XWindows/Linux it is possible but depends on the
Windows Manager. It seems most current WMs (Gnome, KDE) support the
feature.

Can you send me a patch for MacOS?

I can’t give a diff, but in file SDL_romvideo.c, replace lines 4901/491:

SDL_Window = NewCWindow(nil, &wrect, “\p”, true, noGrowDocProc,
(WindowPtr)-1, true, 0);

with the following:

short procID = noGrowDocProc;
if ( (flags & SDL_NOWINTITLE) == SDL_NOWINTITLE ) {
procID = plainDBox;
}

I haven’t tested this extensively, but it seems to work fine for Exult I did.

Max–

Max Horn
International C/C++/Internet Development

email: mailto:Max_Horn
web: http://www.quendi.de
phone: (+49) 6151-494890