From 8370be7cc12264db8a3aff11ec4967e4e0ad4ae0 Mon Sep 17 00:00:00 2001 From: TheMorc Date: Sat, 6 Mar 2021 19:35:32 +0100 Subject: [PATCH 1/4] Add RoundedScreenCorners config setting This setting enables drawing of all rounded screen corners (small interesting thing: Mac OS 9 had rounded screen corners but they must've disabled them later because I don't have them on my snow 2003 iBook G3.) --- mlvwm/config.c | 6 ++++ mlvwm/menus.c | 97 +++++++++++++++++++++++++------------------------- mlvwm/screen.h | 1 + 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/mlvwm/config.c b/mlvwm/config.c index 842b065..64792f4 100644 --- a/mlvwm/config.c +++ b/mlvwm/config.c @@ -713,6 +713,11 @@ void SetEdgeResist( char *line, FILE *fp ) } } +void SetRoundedCorners( char *line, FILE *fp ) +{ + Scr.flags |= ROUNDEDCORNERS; +} + config_func main_config[]={ { "Desktopnum", SetDeskTopNum }, { "DoubleClickTime", SetDoubleClickTime }, @@ -734,6 +739,7 @@ config_func main_config[]={ { "Menu", SetMenu}, { "Read", ReadNewConfigFile }, { "RestartPreviousState", SetRstPrevState }, + { "RoundedScreenCorners", SetRoundedCorners }, { "ScrollBarWidth", SetBarWidth }, { "ShadeMap", SetShadeMap }, { "ShortCut", SetShortCut }, diff --git a/mlvwm/menus.c b/mlvwm/menus.c index 5fd571c..48d7f85 100644 --- a/mlvwm/menus.c +++ b/mlvwm/menus.c @@ -120,27 +120,32 @@ void RedrawMenuBar( void ) if( Scr.flags&SYSTEM8 ) DrawShadowBox( 0, 0, Scr.MyDisplayWidth, MENUB_H, Scr.MenuBar, 1, Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL ); - XFillRectangle( dpy, Scr.MenuBar, Scr.BlackGC, 0, 0, 7, 7 ); - XFillRectangle( dpy, Scr.MenuBar, - Scr.BlackGC, Scr.MyDisplayWidth-7, 0, 7, 7 ); - if( Scr.flags&SYSTEM8 && !(Scr.flags&STARTING) ){ - for( lp=0; lp<2; lp++ ){ - XDrawArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0, - 14-lp, 14-lp, 180*64, -(90*64) ); - XDrawArc( dpy, Scr.MenuBar, Scr.Gray1GC, Scr.MyDisplayWidth-15, 0, - 14-lp, 14-lp, 0, 90*64 ); - } - XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, 0, 0, - 14, 14, 180*64, -(90*64) ); - XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, Scr.MyDisplayWidth-15, 0, - 14, 14, 0, 90*64 ); - } - else{ - XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0, - 14, 14, 180*64, -(90*64) ); - XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, Scr.MyDisplayWidth-15, 0, - 14, 14, 0, 90*64 ); - } + if(Scr.flags&ROUNDEDCORNERS){ + XFillRectangle( dpy, Scr.MenuBar, Scr.BlackGC, 0, 0, 7, 7 ); + XFillRectangle( dpy, Scr.MenuBar, + Scr.BlackGC, Scr.MyDisplayWidth-7, 0, 7, 7 ); + if( Scr.flags&SYSTEM8 && !(Scr.flags&STARTING) ){ + for( lp=0; lp<2; lp++ ){ + XDrawArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0, + 14-lp, 14-lp, 180*64, -(90*64) ); + XDrawArc( dpy, Scr.MenuBar, Scr.Gray1GC, Scr.MyDisplayWidth-15, 0, + 14-lp, 14-lp, 0, 90*64 ); + } + XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, 0, 0, + 14, 14, 180*64, -(90*64) ); + XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, Scr.MyDisplayWidth-15, 0, + 14, 14, 0, 90*64 ); + } + else{ + XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0, + 14, 14, 180*64, -(90*64) ); + XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, Scr.MyDisplayWidth-15, 0, + 14, 14, 0, 90*64 ); + } + + XMapWindow( dpy, Scr.lbCorner ); + XMapWindow( dpy, Scr.rbCorner ); + } if( !(Scr.flags&SYSTEM8) ) XDrawLine( dpy, Scr.MenuBar, Scr.BlackGC, 0, MENUB_H-1, Scr.MyDisplayWidth, MENUB_H-1 ); @@ -1293,30 +1298,26 @@ Window PixmapWin (char **data_xpm, Window root, int x, int y) void CreateMenuBar( void ) { - static char *lbot_xpm[] = { - "7 7 2 1", - " c none s none", - "# c black", - "# ", - "# ", - "# ", - "## ", - "### ", - "#### ", - "#######" - }; - static char *rbot_xpm[] = { - "7 7 2 1", - " c none s none", - "# c black", - " #", - " #", - " #", - " ##", - " ###", - " ####", - "#######" - }; + static char *lbot_xpm[] = { + "5 5 2 1", + " c none s none", + "# c black", + "# ", + "# ", + "## ", + "### ", + "#####" + }; + static char *rbot_xpm[] = { + "5 5 2 1", + " c none s none", + "# c black", + " #", + " #", + " ##", + " ###", + "#####" + }; unsigned long valuemask; XSetWindowAttributes attributes; @@ -1331,11 +1332,9 @@ void CreateMenuBar( void ) CopyFromParent, InputOutput, CopyFromParent, valuemask, &attributes ); XMapWindow( dpy, Scr.MenuBar ); - Scr.lbCorner = PixmapWin( lbot_xpm, Scr.Root, 0, -1 ); - XMapWindow( dpy, Scr.lbCorner ); + Scr.lbCorner = PixmapWin( lbot_xpm, Scr.Root, 0, -1 ); + Scr.rbCorner = PixmapWin( rbot_xpm, Scr.Root, -1, -1 ); - Scr.rbCorner = PixmapWin( rbot_xpm, Scr.Root, -1, -1 ); - XMapWindow( dpy, Scr.rbCorner ); RedrawMenuBar( ); } diff --git a/mlvwm/screen.h b/mlvwm/screen.h index e5be422..4aafe92 100644 --- a/mlvwm/screen.h +++ b/mlvwm/screen.h @@ -141,6 +141,7 @@ typedef struct ScreenInfo #define OPAQUERESIZE 0x00008000 #define ONECLICKMENU 0x00010000 #define DEBUGOUT 0x00020000 +#define ROUNDEDCORNERS 0x00040000 #ifdef USE_LOCALE #define MENUBARFONT Scr.MenuBarFs From da399d1bd9462e9bef3d706e91921820bfd8ea01 Mon Sep 17 00:00:00 2001 From: Morgan Aldridge Date: Fri, 12 Mar 2021 12:05:40 -0500 Subject: [PATCH 2/4] Added RoundedScreenCorners config setting to manual page. Issue #15 --- man/mlvwm.man | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/mlvwm.man b/man/mlvwm.man index 1faab21..9055a76 100755 --- a/man/mlvwm.man +++ b/man/mlvwm.man @@ -151,6 +151,8 @@ It turns on FollowToMouse with the modification of not loosing focus when in the root window. .IP "\fBSystem8\fP" Change to window decoration to System 8(Only Color Monitor). +.IP "\fBRoundedScreenCorners\fP" +Enable rounded screen corners. .IP "\fBOpaqueMove\fP" Enable Opaque move. .IP "\fBOpaqueResize\fP" From e4a31ff47acf84150b6946d2af137519f7a89ddc Mon Sep 17 00:00:00 2001 From: Morgan Aldridge Date: Fri, 12 Mar 2021 12:09:00 -0500 Subject: [PATCH 3/4] Updated CHANGELOG regarding new RoundedScreenCorners configuration setting. Issue #15 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 8a28b9b..5855a48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ 0.9.2 -> 0.9.3 Fix RestartSystem()/Done() to correctly restart into other window managers +Add RoundedScreenCorners configuration 0.9.1 -> 0.9.2 Change sprintf() & strcat() to snprintf() From e0823a6a150e830cd119eef1c8d6140f77efb0aa Mon Sep 17 00:00:00 2001 From: Morgan Aldridge Date: Wed, 17 Mar 2021 15:08:33 -0400 Subject: [PATCH 4/4] Borders: Restore stripes around titlebar buttons & text on monochrome displays --- mlvwm/borders.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlvwm/borders.c b/mlvwm/borders.c index 67032dc..e073649 100644 --- a/mlvwm/borders.c +++ b/mlvwm/borders.c @@ -496,6 +496,8 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off ) else XDrawLine( dpy, t->title_w, Scr.Gray1GC, 0, lp, t->frame_w, lp ); } + else + XDrawLine( dpy, t->title_w, Scr.BlackGC, 0, lp, t->frame_w, lp ); } if( Scr.flags&SYSTEM8 ){