mirror of
https://github.com/morgant/mlvwm.git
synced 2024-06-03 00:29:50 +00:00
Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8eb3738420 | ||
|
5d6b7e17c5 | ||
|
7a3daaebf4 | ||
|
2d324d13cf | ||
|
f6b4a84199 | ||
|
692432b807 | ||
|
b039615084 | ||
|
24578885f2 | ||
|
694d9c26a1 | ||
|
70e08cf7cf | ||
|
71b9f4bb7a | ||
|
7bbc1f1bde | ||
|
9aaa7f42a6 | ||
|
eb4c348b6a | ||
|
885f80f1e0 | ||
|
1abad78a41 | ||
|
6984cda115 | ||
|
5fd232652b | ||
|
708a30f602 | ||
|
9a32e76a33 | ||
|
e822ec57b9 | ||
|
c4fc6df49c | ||
|
e0823a6a15 | ||
|
89a829e8e2 | ||
|
817ec609b9 | ||
|
c1c65d7a44 | ||
|
6822305905 | ||
|
da10f2cf46 | ||
|
95da6807a5 | ||
|
352a147fc8 | ||
|
7d51d64c60 | ||
|
e4a31ff47a | ||
|
da399d1bd9 | ||
|
30eecc92de | ||
|
8370f234a2 | ||
|
b36ef7942d | ||
|
ed66d041e8 | ||
|
464b322653 | ||
|
02d34fa5dd | ||
|
b02b7a0a95 | ||
|
d40c836bba | ||
|
5770821197 | ||
|
9ea97d0641 | ||
|
882e556d35 | ||
|
0a3517159f | ||
|
4cd1d76fe1 | ||
|
8370be7cc1 | ||
|
4910df83f7 | ||
|
09ea1b39d4 |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
man/mlvwm._man
|
||||
mlvwm/mlvwm
|
||||
**/Makefile*
|
||||
**/*.o
|
||||
mlvwm.*
|
||||
**/*.swp
|
13
CHANGELOG
13
CHANGELOG
|
@ -1,3 +1,16 @@
|
|||
0.9.2 -> 0.9.4
|
||||
Improved config command parsing in ReadConfigFile()
|
||||
Add SwallowFocusClick configuration command
|
||||
Fixed handle_configure_request() to support moving windows
|
||||
|
||||
0.9.2 -> 0.9.3
|
||||
Fix RestartSystem()/Done() to correctly restart into other window managers
|
||||
Add RoundedScreenCorners configuration
|
||||
Changed default font size to 12px
|
||||
Changed default scroll bar width/height to 16px
|
||||
Changed default menu bar height to 20px
|
||||
More accurate sizing & styling of window title bars & controls, scroll bars, and resize handle
|
||||
|
||||
0.9.1 -> 0.9.2
|
||||
Change sprintf() & strcat() to snprintf()
|
||||
|
||||
|
|
37
CONTRIBUTING.md
Normal file
37
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Contributing to MLVWM
|
||||
|
||||
We welcome feedback, bug fixes, and feature request. Ultimately, what gets accepted and merged into the project is up to the current project maintainer ([Morgan Aldridge](https://github.com/morgant)) and what they feel is appropriate for all users of the project, but you are encouraged to submit any suggestions.
|
||||
|
||||
Please submit bugs and feature requests via the project’s [issue tracker](https://github.com/morgant/mlvwm/issues).
|
||||
|
||||
## What You Need
|
||||
|
||||
You will need the following to contribute:
|
||||
|
||||
* A [GitHub](http://github.com) account for submitting pull requests
|
||||
* X11
|
||||
|
||||
## Making Changes
|
||||
|
||||
Follow these steps when making changes. That way, they will most likely be accepted with few headaches and very little back and forth.
|
||||
|
||||
1. Fork the [mlvwm](https://github.com/morgant/mlvwm) project on GitHub.
|
||||
2. Create a topic branch from the `master` branch. Name your branch appropriately, reflecting the intended changes (e.g. “sprintf-to-snprintf” or “scroll-bar-theme-improvements”)
|
||||
3. Make your edits (please try to conform to our [style guide](#style-guide)).
|
||||
4. Make commits in logical units and with concise but explanatory commit messages. Please reference any appropriate issue numbers, e.g. "Issue #16".
|
||||
5. Ensure your changes build without additional warnings or errors. We suggest testing in `Xephyr`.
|
||||
|
||||
## Submitting Changes
|
||||
|
||||
When you’ve completed your changes and are ready to merge them into the main project, follow these steps to submit them for review.
|
||||
|
||||
1. Push the changes to your fork of the [mlvwm](https://github.com/morgant/mlvwm) project on GitHub
|
||||
2. Submit a pull request to the [mlvwm](https://github.com/morgant/mlvwm) project
|
||||
|
||||
That’s all there is to it.
|
||||
|
||||
If you followed the [making changes](#making-changes) guidelines and the changes are aligned with the vision of the project, it should be a smooth process to merge them.
|
||||
|
||||
## Style Guide
|
||||
|
||||
This is a very old codebase from before syle guides were a thing and we haven't yet tackled standardizing the formatting. So, for the time being, please try to use the same style as surrounding code, including either spaces or tabs for indendation (whichever is used locally), spacing around parentheses, etc. Please remove any trailing whitespace from lines.
|
26
README.md
26
README.md
|
@ -1,5 +1,7 @@
|
|||
# MLVWM
|
||||
|
||||
[![MLVWM System 7 Theme](/img/System7-640x360.png?raw=true)](#SCREENSHOTS)
|
||||
|
||||
## OVERVIEW
|
||||
|
||||
MLVWM (Macintosh-Like Virtual Window Manager) is an X11 window manager with a classic MacOS appearance. Its primary features include:
|
||||
|
@ -23,8 +25,20 @@ MLVWM (Macintosh-Like Virtual Window Manager) is an X11 window manager with a cl
|
|||
* Global keyboard shortcuts
|
||||
* Numerous configuration options to tune functionality
|
||||
|
||||
## SCREENSHOTS
|
||||
|
||||
Default theme (System 7-like):
|
||||
|
||||
[![Default System 7 Theme](/img/System7-640x360.png?raw=true)](/img/System7-1920x1080.png)
|
||||
|
||||
`System8` theme (MacOS 8/9-like):
|
||||
|
||||
[![MacOS 8/9 Theme](/img/MacOS8-640x360.png?raw=true)](/img/MacOS8-1920x1080.png)
|
||||
|
||||
## INSTALLATION
|
||||
|
||||
### Building from Source
|
||||
|
||||
Build & installation currently still requires [imake](https://en.wikipedia.org/wiki/Imake) & make. While the original documentation says that `xmkmf -a` should work, we've found it's usually necessary to do the following:
|
||||
|
||||
cd man && xmkmf && cd -
|
||||
|
@ -33,6 +47,12 @@ Build & installation currently still requires [imake](https://en.wikipedia.org/w
|
|||
xmkmf
|
||||
make && make install
|
||||
|
||||
### Package Managers
|
||||
|
||||
Native packages are provided on some operating systems, including:
|
||||
|
||||
* OpenBSD: `pkg_add mlvwm`
|
||||
|
||||
## CONFIGURATION
|
||||
|
||||
While some sample configuration files are included in the `sample_rc` directory, we highly suggest using the configuration files from the [mlvwmrc](https://github.com/morgant/mlvwmrc) project.
|
||||
|
@ -48,9 +68,13 @@ We suggest reading the manual page (`man mlvwm`; English), but you may also find
|
|||
|
||||
Note: the English documentation above was automatically generated from the Japanese documentation.
|
||||
|
||||
## CONTRIBUTING
|
||||
|
||||
Contributions are welcome and appreciated. Please read and follow the [CONTRIBUTING](CONTRIBUTING.md) guidelines.
|
||||
|
||||
## HISTORY
|
||||
|
||||
MLVWM was originally developed in 1997 by Takashi HASEGAWAi, based on FVWM, while studying at Nagoya University. Active development proceeded through 2000. In 2020, Morgan Aldridge obtained permission to continue maintenance & development.
|
||||
MLVWM was originally developed in 1997 by Takashi HASEGAWA, based on FVWM, while studying at Nagoya University. Active development proceeded through 2000. In 2020, Morgan Aldridge obtained permission to continue maintenance & development.
|
||||
|
||||
## LICENSE
|
||||
|
||||
|
|
BIN
img/MacOS8-1920x1080.png
Normal file
BIN
img/MacOS8-1920x1080.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
BIN
img/MacOS8-640x360.png
Normal file
BIN
img/MacOS8-640x360.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
BIN
img/System7-1920x1080.png
Normal file
BIN
img/System7-1920x1080.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 132 KiB |
BIN
img/System7-640x360.png
Normal file
BIN
img/System7-640x360.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
|
@ -149,8 +149,13 @@ focus in the current one. This is not set up by default.
|
|||
.IP "\fBSlopyFocus\fP"
|
||||
It turns on FollowToMouse with the modification of not loosing
|
||||
focus when in the root window.
|
||||
.IP "\fBSwallowFocusClick\fP"
|
||||
Initial clicks in inactive windows will be ignored. This is not set by
|
||||
default.
|
||||
.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"
|
||||
|
@ -171,7 +176,7 @@ WindowShade is regarded as Inocify.
|
|||
.IP "\fBIconifyHide\fP"
|
||||
HideWindow is regarded as Iconify.
|
||||
.IP "\fBScrollBarWidth\fP \fIn\fP
|
||||
The variable scroll window is set \fIn\fP and defaults to 19 if
|
||||
The variable scroll window is set \fIn\fP and defaults to 16 if
|
||||
unspecified.
|
||||
.IP "\fBFlushMenu\fP \fIspeed\fP \fIflashes\fP"
|
||||
Determines how fast the flashes are when you choose an option from a menu,
|
||||
|
|
|
@ -2,7 +2,7 @@ XCOMM Imakefile for MLVWM
|
|||
|
||||
#include "../configure.h"
|
||||
|
||||
VERSION = 0.9.1
|
||||
VERSION = 0.9.4
|
||||
COMPILE_OPTIONS = -DVERSION=\"$(VERSION)\" \
|
||||
-DCONFIGNAME=\"$(MLVWMRC)\" \
|
||||
-DMLVWMLIBDIR=\"$(MLVWMLIBDIR)\"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
VERSION=\"0.9.0\"
|
||||
VERSION=\"0.9.3\"
|
||||
CFLAGS = -g -Wall -DVERSION=$(VERSION) -fpcc-struct-return -DCONFIGNAME=\".mlvwmrc\" -DUSE_LOCALE -DMLVWMLIBDIR=\"/usr/X11R6/lib/X11/mlvwm\"
|
||||
CC = gcc
|
||||
LDFLAGS = -lXpm -lXext -lX11
|
||||
|
|
|
@ -204,7 +204,7 @@ void create_titlebar( MlvwmWindow *tmp_win )
|
|||
if( tmp_win->flags&CLOSER ){
|
||||
attributes.cursor = Scr.MlvwmCursors[DESTROY];
|
||||
tmp_win->close_b = XCreateWindow( dpy, tmp_win->title_w,
|
||||
Scr.flags&SYSTEM8?4:BOXSIZE+1,
|
||||
Scr.flags&SYSTEM8?2:BOXSIZE-3,
|
||||
(TITLE_HEIGHT-BOXSIZE)/2,
|
||||
BOXSIZE, BOXSIZE, 0,
|
||||
CopyFromParent, InputOutput,
|
||||
|
@ -215,7 +215,7 @@ void create_titlebar( MlvwmWindow *tmp_win )
|
|||
if( tmp_win->flags&MINMAXR ){
|
||||
attributes.cursor = Scr.MlvwmCursors[SELECT];
|
||||
tmp_win->minmax_b = XCreateWindow( dpy, tmp_win->title_w,
|
||||
tmp_win->frame_w-BOXSIZE*2-1,
|
||||
tmp_win->frame_w-(BOXSIZE*2-3),
|
||||
(TITLE_HEIGHT-BOXSIZE)/2,
|
||||
BOXSIZE, BOXSIZE, 0,
|
||||
CopyFromParent, InputOutput,
|
||||
|
|
178
mlvwm/borders.c
178
mlvwm/borders.c
|
@ -55,13 +55,13 @@ void DrawShadowBox( int x, int y, int w, int h, Window win, int d, GC hilight, G
|
|||
h--;
|
||||
for( lp=0; lp<d; lp++ ){
|
||||
if( mode&SHADOW_BOTTOM )
|
||||
XDrawLine( dpy, win, shadow, x+lp, y+h-lp, x+w-lp, y+h-lp );
|
||||
XDrawLine( dpy, win, shadow, x+lp+1, y+h-lp, x+w-lp, y+h-lp );
|
||||
if( mode&SHADOW_LEFT )
|
||||
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+lp, y+h-lp );
|
||||
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+lp, y+h-lp-1 );
|
||||
if( mode&SHADOW_TOP )
|
||||
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+w-lp, y+lp );
|
||||
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+w-lp-1, y+lp );
|
||||
if( mode&SHADOW_RIGHT )
|
||||
XDrawLine( dpy, win, shadow, x+w-lp, y+lp, x+w-lp, y+h-lp );
|
||||
XDrawLine( dpy, win, shadow, x+w-lp, y+lp+1, x+w-lp, y+h-lp-1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,15 +129,15 @@ void SetUpFrame( MlvwmWindow *t, int x, int y, int w, int h, Bool sendEvent )
|
|||
if( t->flags&MINMAXR ){
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
XMoveWindow(dpy, t->minmax_b,
|
||||
w-BOXSIZE-9-(t->flags&SHADER?BOXSIZE+4:0),
|
||||
w-BOXSIZE-7-(t->flags&SHADER?BOXSIZE+4:0),
|
||||
(TITLE_HEIGHT-BOXSIZE)/2);
|
||||
else
|
||||
XMoveWindow(dpy, t->minmax_b,
|
||||
w-BOXSIZE*2-1,
|
||||
w-(BOXSIZE*2-2),
|
||||
(TITLE_HEIGHT-BOXSIZE)/2);
|
||||
}
|
||||
if( t->flags&SHADER )
|
||||
XMoveWindow(dpy, t->shade_b, w-BOXSIZE-9,
|
||||
XMoveWindow(dpy, t->shade_b, w-BOXSIZE-8,
|
||||
(TITLE_HEIGHT-BOXSIZE)/2);
|
||||
if( !(t->flags&SHADE) ){
|
||||
if( t->flags & ( TITLE | SBARV | SBARH | RESIZER ) ){
|
||||
|
@ -246,21 +246,21 @@ void SetUpFrame( MlvwmWindow *t, int x, int y, int w, int h, Bool sendEvent )
|
|||
if( (!(t->wShaped) || t->flags&SHADE) &&
|
||||
t->flags & ( TITLE | SBARV | SBARH | RESIZER )){
|
||||
int lp;
|
||||
XRectangle rect[7];
|
||||
XRectangle rect[5];
|
||||
|
||||
rect[0].x = -1; rect[0].y = -1;
|
||||
rect[0].width = t->frame_w-1; rect[0].height = t->frame_h-1;
|
||||
|
||||
for( lp=0; lp<3; lp++ ){
|
||||
for( lp=0; lp<2; lp++ ){
|
||||
rect[lp+1].x = t->frame_w-2+lp; rect[lp+1].y = lp;
|
||||
rect[lp+1].width = 1; rect[lp+1].height = t->frame_h+1-lp;
|
||||
rect[lp+1].width = 1; rect[lp+1].height = t->frame_h-lp;
|
||||
}
|
||||
for( lp=0; lp<3; lp++ ){
|
||||
rect[lp+4].x = lp; rect[lp+4].y = t->frame_h-2+lp;
|
||||
rect[lp+4].width = t->frame_w+1-lp; rect[lp+4].height = 1;
|
||||
for( lp=0; lp<2; lp++ ){
|
||||
rect[lp+3].x = lp; rect[lp+3].y = t->frame_h-2+lp;
|
||||
rect[lp+3].width = t->frame_w-lp; rect[lp+3].height = 1;
|
||||
}
|
||||
XShapeCombineRectangles(dpy,t->frame,ShapeBounding,
|
||||
0,0,rect,7,ShapeSet,YSorted);
|
||||
0,0,rect,5,ShapeSet,YSorted);
|
||||
}
|
||||
if( t->wShaped ) SetShape( t, w );
|
||||
if (sendEvent && !(t->flags&SHADE) ){
|
||||
|
@ -334,13 +334,13 @@ void DrawCloseBox( MlvwmWindow *t, Bool on )
|
|||
if( Scr.flags&SYSTEM8 ){
|
||||
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
|
||||
4, (TITLE_HEIGHT-BOXSIZE)/2-2,
|
||||
BOXSIZE+7, BOXSIZE+2 );
|
||||
BOXSIZE+2, BOXSIZE+2 );
|
||||
FillGradation( t->close_b );
|
||||
}
|
||||
else{
|
||||
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
|
||||
BOXSIZE-1, (TITLE_HEIGHT-BOXSIZE)/2-1,
|
||||
BOXSIZE+4, BOXSIZE+1 );
|
||||
BOXSIZE-4, (TITLE_HEIGHT-BOXSIZE)/2-1,
|
||||
BOXSIZE+2, BOXSIZE+1 );
|
||||
DrawShadowBox( 0, 0, BOXSIZE, BOXSIZE, t->close_b, 1,
|
||||
Scr.BlackGC, Scr.WhiteGC, SHADOW_ALL );
|
||||
DrawShadowBox( 1, 1, BOXSIZE-2, BOXSIZE-2, t->close_b, 1,
|
||||
|
@ -376,23 +376,23 @@ void DrawMinMax( MlvwmWindow *t, Bool on )
|
|||
if( on ){
|
||||
if( Scr.flags&SYSTEM8 ){
|
||||
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
|
||||
t->frame_w-BOXSIZE-15-
|
||||
t->frame_w-BOXSIZE-9-
|
||||
(t->flags&SHADER?BOXSIZE+6:0),
|
||||
(TITLE_HEIGHT-BOXSIZE)/2-1,
|
||||
BOXSIZE+8, BOXSIZE+2 );
|
||||
FillGradation( t->minmax_b );
|
||||
XDrawRectangle( dpy, t->minmax_b, Scr.BlackGC,
|
||||
1, 1, BOXSIZE-6, BOXSIZE-6 );
|
||||
1, 1, BOXSIZE-7, BOXSIZE-7 );
|
||||
}
|
||||
else{
|
||||
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
|
||||
t->frame_w-BOXSIZE*2-3,(TITLE_HEIGHT-BOXSIZE)/2-1,
|
||||
BOXSIZE+4, BOXSIZE+1 );
|
||||
t->frame_w-(BOXSIZE*2-1),(TITLE_HEIGHT-BOXSIZE)/2-1,
|
||||
BOXSIZE+2, BOXSIZE+1 );
|
||||
DrawShadowBox( 0, 0, BOXSIZE, BOXSIZE, t->minmax_b, 1,
|
||||
Scr.BlackGC, Scr.WhiteGC, SHADOW_ALL );
|
||||
DrawShadowBox( 1, 1, BOXSIZE-2, BOXSIZE-2, t->minmax_b, 1,
|
||||
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
|
||||
DrawShadowBox( 1, 1, BOXSIZE-6, BOXSIZE-6, t->minmax_b, 1,
|
||||
DrawShadowBox( 1, 1, BOXSIZE-5, BOXSIZE-5, t->minmax_b, 1,
|
||||
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
|
||||
}
|
||||
}
|
||||
|
@ -488,42 +488,32 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
|
|||
while( w+20>drawable && titlelength>0 );
|
||||
|
||||
if( on_off ){
|
||||
for( lp=4; lp<14; lp+=3 ){
|
||||
if( Scr.d_depth>1 ){
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
DrawShadowBox( 4, lp-2, t->frame_w-15, 2, t->title_w, 1,
|
||||
if( Scr.d_depth>1 && Scr.flags&SYSTEM8 ){
|
||||
for( lp=4; lp<16; lp+=2 ){
|
||||
DrawShadowBox( 4, lp-1, t->frame_w-14, 2, t->title_w, 1,
|
||||
Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL );
|
||||
else
|
||||
DrawShadowBox( 4, lp-1, t->frame_w-11, 2, t->title_w, 1,
|
||||
Scr.Gray1GC, Scr.WhiteGC, SHADOW_ALL );
|
||||
}
|
||||
else
|
||||
XDrawLine( dpy, t->title_w, Scr.BlackGC,
|
||||
4, lp-1, t->frame_w-7, lp-1 );
|
||||
}
|
||||
if( Scr.d_depth>1 ){
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
DrawShadowBox( 4, 14, t->frame_w-15, 2, t->title_w, 1,
|
||||
Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL );
|
||||
else
|
||||
XDrawLine( dpy, t->title_w, Scr.Gray1GC,
|
||||
4, 15, t->frame_w-9, 15 );
|
||||
}
|
||||
else
|
||||
XDrawLine( dpy, t->title_w, Scr.BlackGC,
|
||||
4, 15, t->frame_w-7, 15 );
|
||||
if( Scr.flags&SYSTEM8 ){
|
||||
|
||||
DrawShadowBox( 0, 0, t->frame_w-2, TITLE_HEIGHT, t->title_w,
|
||||
1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_TOP );
|
||||
if( !(t->flags&SHADE) )
|
||||
XDrawLine( dpy, t->title_w, Scr.Gray2GC,
|
||||
2, TITLE_HEIGHT-1, t->frame_w-9, TITLE_HEIGHT-1 );
|
||||
}
|
||||
else
|
||||
else{
|
||||
for( lp=3; lp<15; lp+=2 ){
|
||||
if( Scr.d_depth>1 )
|
||||
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 );
|
||||
}
|
||||
|
||||
DrawShadowBox( 0, 0, t->frame_w-2, TITLE_HEIGHT, t->title_w,
|
||||
1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
|
||||
}
|
||||
|
||||
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
|
||||
(t->frame_w-w)/2-10, 1, w+20, TITLE_HEIGHT-2 );
|
||||
(t->frame_w-w)/2-5, 1, w+10, TITLE_HEIGHT-2 );
|
||||
dispgc = Scr.BlackGC;
|
||||
}
|
||||
else{
|
||||
|
@ -535,7 +525,7 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
|
|||
if( t->flags&SHADER ) DrawShadeR( t, on_off );
|
||||
|
||||
XDRAWSTRING( dpy, t->title_w, WINDOWFONT, dispgc, (t->frame_w-w)/2,
|
||||
TITLE_HEIGHT/2-offset, t->name, titlelength );
|
||||
TITLE_HEIGHT/2-offset+(Scr.flags&SYSTEM8?0:1), t->name, titlelength );
|
||||
if( Scr.d_depth<2 && !on_off ){
|
||||
xgcv.function = GXor;
|
||||
mask = GCFunction;
|
||||
|
@ -549,11 +539,11 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
|
|||
}
|
||||
}
|
||||
|
||||
void DrawArrow( Window w, int direction, GC color )
|
||||
void DrawArrow( Window w, int direction, GC fill, GC outline )
|
||||
{
|
||||
XPoint arrow_p[] = {
|
||||
{9,3},{2,10},{6,10},{6,15},{12,15},{12,10},{16,10},{9,3}, {0,0}},
|
||||
arrow_p8[] = {{15,11},{9,5},{3,11},{15,11}, {0,0}};
|
||||
{7,3},{2,8},{5,8},{5,12},{9,12},{9,8},{12,8},{7,3}, {0,0}},
|
||||
arrow_p8[] = {{7,6},{4,9},{11,9},{8,6},{7,6}, {0,0}};
|
||||
XPoint *use_p;
|
||||
int lp, JunkX, point;
|
||||
|
||||
|
@ -561,8 +551,8 @@ void DrawArrow( Window w, int direction, GC color )
|
|||
else use_p = arrow_p;
|
||||
|
||||
for( point=0; use_p[point].x!=0; point++ ){
|
||||
use_p[point].x = use_p[point].x*SBAR_WH/19.+0.5;
|
||||
use_p[point].y = use_p[point].y*SBAR_WH/19.+0.5;
|
||||
use_p[point].x = use_p[point].x*SBAR_WH/16.;
|
||||
use_p[point].y = use_p[point].y*SBAR_WH/16.;
|
||||
}
|
||||
|
||||
if( direction==C_SBAR_LEFT || direction==C_SBAR_RIGHT ){
|
||||
|
@ -578,8 +568,8 @@ void DrawArrow( Window w, int direction, GC color )
|
|||
if( direction==C_SBAR_DOWN )
|
||||
for( lp=0; lp<point; lp++ ) use_p[lp].y = SBAR_WH-use_p[lp].y-1;
|
||||
|
||||
XFillPolygon( dpy, w, color, use_p, point, Nonconvex, CoordModeOrigin );
|
||||
XDrawLines( dpy, w, Scr.BlackGC, use_p, point, CoordModeOrigin );
|
||||
XFillPolygon( dpy, w, fill, use_p, point, Nonconvex, CoordModeOrigin );
|
||||
XDrawLines( dpy, w, outline, use_p, point, CoordModeOrigin );
|
||||
}
|
||||
|
||||
void DrawSbarAnk( MlvwmWindow *t, int context, Bool on_off )
|
||||
|
@ -618,18 +608,17 @@ void DrawSbarAnk( MlvwmWindow *t, int context, Bool on_off )
|
|||
|
||||
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, win, 1,
|
||||
Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
|
||||
scale = 11*SBAR_WH/19.+0.5;
|
||||
scale = 8*SBAR_WH/16.;
|
||||
if( context==C_SBAR_H_AN ){
|
||||
for( lp=0; lp<(SBAR_WH-6)/3; lp++ )
|
||||
DrawShadowBox( (lp+1)*3, (SBAR_WH-scale)/2+1,
|
||||
3, scale, win, 1,
|
||||
for( lp=0; lp<(SBAR_WH-8)/2; lp++ )
|
||||
DrawShadowBox( (lp+2)*2, (SBAR_WH-scale)/2,
|
||||
2, scale, win, 1,
|
||||
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
|
||||
}
|
||||
if( context==C_SBAR_V_AN ){
|
||||
scale = 11*SBAR_WH/19.+0.5;
|
||||
for( lp=0; lp<(SBAR_WH-6)/3; lp++ )
|
||||
DrawShadowBox( (SBAR_WH-scale)/2, (lp+1)*3,
|
||||
scale, 3, win, 1,
|
||||
for( lp=0; lp<(SBAR_WH-8)/2; lp++ )
|
||||
DrawShadowBox( (SBAR_WH-scale)/2, (lp+2)*2,
|
||||
scale, 2, win, 1,
|
||||
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
|
||||
}
|
||||
}
|
||||
|
@ -664,6 +653,7 @@ void DrawSbarArrow( MlvwmWindow *t, int context, Bool on_off )
|
|||
XGCValues xgcv;
|
||||
XSetWindowAttributes attributes;
|
||||
Cursor cursor;
|
||||
GC fill, outline;
|
||||
|
||||
switch( context ){
|
||||
case C_SBAR_UP:
|
||||
|
@ -704,11 +694,22 @@ void DrawSbarArrow( MlvwmWindow *t, int context, Bool on_off )
|
|||
XChangeWindowAttributes( dpy, win, valuemask, &attributes );
|
||||
XClearWindow( dpy, win );
|
||||
|
||||
if( t->flags&SCROLL && size<0 )
|
||||
if( t->flags&SCROLL && size<0 ) {
|
||||
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, win, 1,
|
||||
Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
|
||||
|
||||
DrawArrow( win, context, Scr.Gray3GC );
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
fill = outline = Scr.BlackGC;
|
||||
else {
|
||||
fill = Scr.Gray3GC;
|
||||
outline = Scr.BlackGC;
|
||||
}
|
||||
}
|
||||
else{
|
||||
fill = outline = Scr.Gray2GC;
|
||||
if( !(Scr.flags&SYSTEM8) )
|
||||
fill = Scr.Gray4GC;
|
||||
}
|
||||
DrawArrow( win, context, fill, outline);
|
||||
}
|
||||
else{
|
||||
mask = GCForeground;
|
||||
|
@ -762,16 +763,29 @@ void DrawSbarBar( MlvwmWindow *t, int context, Bool on_off )
|
|||
|
||||
if( on_off ){
|
||||
if( t->flags&SCROLL && size<0 ){
|
||||
if( Scr.flags&SYSTEM8 ){
|
||||
Pixmap bgpix;
|
||||
bgpix = XCreatePixmap( dpy, Scr.Root, width_f,
|
||||
height_f, Scr.d_depth );
|
||||
XFillRectangle(dpy,bgpix,Scr.Gray3GC,0,0,width_f,height_f);
|
||||
if( Scr.d_depth>1 ){
|
||||
if( Scr.flags&SYSTEM8 ){
|
||||
Pixmap bgpix;
|
||||
bgpix = XCreatePixmap( dpy, Scr.Root, width_f,
|
||||
height_f, Scr.d_depth );
|
||||
XFillRectangle(dpy,bgpix,Scr.Gray3GC,0,0,width_f,height_f);
|
||||
|
||||
DrawShadowBox( x, y, width, height, bgpix, 1,
|
||||
DrawShadowBox( x, y, width, height, bgpix, 1,
|
||||
Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
|
||||
XSetWindowBackgroundPixmap( dpy, win, bgpix );
|
||||
XFreePixmap( dpy, bgpix );
|
||||
XSetWindowBackgroundPixmap( dpy, win, bgpix );
|
||||
XFreePixmap( dpy, bgpix );
|
||||
}
|
||||
else{
|
||||
XGCValues gcv_gray4, gcv_gray2;
|
||||
XGetGCValues(dpy, Scr.Gray4GC, GCForeground, &gcv_gray4);
|
||||
XGetGCValues(dpy, Scr.Gray2GC, GCForeground, &gcv_gray2);
|
||||
XSetWindowBackgroundPixmap( dpy, win,
|
||||
XCreatePixmapFromBitmapData( dpy, Scr.Root,
|
||||
mesh, mesh_w, mesh_h,
|
||||
gcv_gray2.foreground,
|
||||
gcv_gray4.foreground,
|
||||
Scr.d_depth ));
|
||||
}
|
||||
}
|
||||
else{
|
||||
XSetWindowBackgroundPixmap( dpy, win,
|
||||
|
@ -902,26 +916,26 @@ void DrawResizeBox( MlvwmWindow *t, Bool on_off )
|
|||
if( Scr.flags&SYSTEM8 ){
|
||||
for(lp=0; lp<3; lp++ ){
|
||||
XDrawLine( dpy, t->resize_b, Scr.WhiteGC,
|
||||
2+lp*3, 9+lp*3, 8+lp*3, 3+lp*3 );
|
||||
3+lp*2, 8+lp*2, 7+lp*2, 4+lp*2 );
|
||||
XDrawLine( dpy, t->resize_b, Scr.BlackGC,
|
||||
4+lp*3, 8+lp*3, 9+lp*3, 3+lp*3 );
|
||||
4+lp*2, 8+lp*2, 8+lp*2, 4+lp*2 );
|
||||
}
|
||||
}
|
||||
else{
|
||||
point = 6*SBAR_WH/19.+0.5;
|
||||
scale = 9*SBAR_WH/19.+0.5;
|
||||
point = 4*SBAR_WH/16.;
|
||||
scale = 9*SBAR_WH/16.;
|
||||
DrawShadowBox( point, point, scale, scale, t->resize_b,
|
||||
1, Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
|
||||
DrawShadowBox( point-1, point-1, scale+2, scale+2, t->resize_b,
|
||||
1, Scr.BlackGC, Scr.WhiteGC, SHADOW_ALL );
|
||||
|
||||
point = 3*SBAR_WH/19.+0.5;
|
||||
scale = 8*SBAR_WH/19.+0.5;
|
||||
point = 3*SBAR_WH/16.;
|
||||
scale = 6*SBAR_WH/16.;
|
||||
XFillRectangle( dpy, t->resize_b, Scr.Gray4GC,
|
||||
point, point, scale, scale );
|
||||
|
||||
point = 4*SBAR_WH/19.+0.5;
|
||||
scale = 7*SBAR_WH/19.+0.5;
|
||||
point = 3*SBAR_WH/16.;
|
||||
scale = 5*SBAR_WH/16.;
|
||||
DrawShadowBox( point, point, scale, scale, t->resize_b,
|
||||
1, Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
|
||||
DrawShadowBox( point-1, point-1, scale+2, scale+2, t->resize_b,
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
extern void SetShape( MlvwmWindow *, int );
|
||||
extern void SetUpFrame( MlvwmWindow *, int, int, int, int, Bool );
|
||||
extern void SetTitleBar( MlvwmWindow *, Bool );
|
||||
extern void DrawArrow( Window, int, GC );
|
||||
extern void DrawArrow( Window, int, GC, GC );
|
||||
extern void DrawSbarAnk( MlvwmWindow *, int, Bool );
|
||||
extern void DrawSbarArrow( MlvwmWindow *, int, Bool );
|
||||
extern void DrawSbarBar( MlvwmWindow *, int, Bool );
|
||||
|
|
|
@ -431,6 +431,11 @@ void SetSloppyFocus( char *line, FILE *fp )
|
|||
Scr.flags |= SLOPPYFOCUS;
|
||||
}
|
||||
|
||||
void SetSwallowFocusClick( char *line, FILE *fp )
|
||||
{
|
||||
Scr.flags |= SWALLOWFOCUSCLICK;
|
||||
}
|
||||
|
||||
void SetStickyHide( char *line, FILE *fp )
|
||||
{
|
||||
Scr.flags |= STICKHIDE;
|
||||
|
@ -713,6 +718,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 +744,7 @@ config_func main_config[]={
|
|||
{ "Menu", SetMenu},
|
||||
{ "Read", ReadNewConfigFile },
|
||||
{ "RestartPreviousState", SetRstPrevState },
|
||||
{ "RoundedScreenCorners", SetRoundedCorners },
|
||||
{ "ScrollBarWidth", SetBarWidth },
|
||||
{ "ShadeMap", SetShadeMap },
|
||||
{ "ShortCut", SetShortCut },
|
||||
|
@ -742,6 +753,7 @@ config_func main_config[]={
|
|||
{ "StickyHide", SetStickyHide },
|
||||
{ "Style", SetStyles },
|
||||
{ "Swallow", SetSwallow },
|
||||
{ "SwallowFocusClick", SetSwallowFocusClick },
|
||||
{ "System8", SetSystem8 },
|
||||
{ "OpaqueMove", SetOpaqueMove },
|
||||
{ "OpaqueResize", SetOpaqueResize },
|
||||
|
@ -757,8 +769,9 @@ config_func main_config[]={
|
|||
void ReadConfigFile( char *configfile )
|
||||
{
|
||||
FILE *fp;
|
||||
char str[1024], *file, *cmp;
|
||||
char str[1024], cmp[1024], *file, *str_start, *cmp_end;
|
||||
int lp;
|
||||
size_t len;
|
||||
#ifdef MLVWMLIBDIR
|
||||
char *sysrc;
|
||||
size_t sysrc_size;
|
||||
|
@ -790,14 +803,21 @@ void ReadConfigFile( char *configfile )
|
|||
while( fgetline( str, sizeof(str), fp )!=NULL ){
|
||||
if( Scr.flags & DEBUGOUT )
|
||||
DrawStringMenuBar( str );
|
||||
cmp = str;
|
||||
|
||||
if( *cmp == '#' ) continue;
|
||||
cmp = SkipSpace( cmp );
|
||||
if( *cmp == '\n' ) continue;
|
||||
str_start = str;
|
||||
if( *str_start == '#' ) continue;
|
||||
str_start = SkipSpace( str_start );
|
||||
if( *str_start == '\n' ) continue;
|
||||
|
||||
snprintf( cmp, sizeof(cmp), "%s", str_start );
|
||||
cmp_end = SkipNonSpace( cmp );
|
||||
*cmp_end = '\0';
|
||||
|
||||
for( lp=0; main_config[lp].label!=NULL; lp++ ){
|
||||
if( !strncmp( cmp, main_config[lp].label,
|
||||
strlen(main_config[lp].label) )){
|
||||
len = strlen(cmp);
|
||||
if( strlen(main_config[lp].label) > len )
|
||||
len = strlen(main_config[lp].label);
|
||||
if( !strncmp( cmp, main_config[lp].label, len )){
|
||||
main_config[lp].action( str, fp );
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ struct configure
|
|||
|
||||
extern void SetDeskTopNum( char *, FILE * );
|
||||
extern void SetFollowToMouse( char *, FILE * );
|
||||
extern void SetSwallowFocusClick( char *, FILE * );
|
||||
extern void ReadConfigFile( char * );
|
||||
extern void FreeStyles( void );
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ void handle_configure_request( XEvent *ev )
|
|||
unsigned long xwcm;
|
||||
MlvwmWindow *tmp_win;
|
||||
XConfigureRequestEvent *xcr = &ev->xconfigurerequest;
|
||||
int x, y, width, height, old_x, old_y;
|
||||
int x, y, width, height;
|
||||
int title_height, sbar_v, sbar_h;
|
||||
Bool notify=False;
|
||||
|
||||
|
@ -418,8 +418,6 @@ void handle_configure_request( XEvent *ev )
|
|||
|
||||
x = tmp_win->frame_x;
|
||||
y = tmp_win->frame_y;
|
||||
old_x = x;
|
||||
old_y = y;
|
||||
width = tmp_win->frame_w;
|
||||
height = tmp_win->frame_h;
|
||||
|
||||
|
@ -441,24 +439,21 @@ void handle_configure_request( XEvent *ev )
|
|||
if (xcr->value_mask & CWWidth) width = xcr->width+12;
|
||||
if (xcr->value_mask & CWHeight) height = xcr->height+12;
|
||||
}
|
||||
/*
|
||||
tmp_win->frame_x = x<0 ? 0 : x;
|
||||
tmp_win->frame_y = y<MENUB_H ? MENUB_H : y;
|
||||
*/
|
||||
tmp_win->win_w = width;
|
||||
tmp_win->win_h = height;
|
||||
|
||||
if( old_x!=x || old_y!=y ) notify = True;
|
||||
// prevent windows from being moved above menu bar
|
||||
if (y < MENUB_H)
|
||||
y = MENUB_H;
|
||||
|
||||
if( tmp_win->frame_x!=x || tmp_win->frame_y!=y ) notify = True;
|
||||
|
||||
if( !(tmp_win->flags&SCROLL) ||
|
||||
tmp_win->frame_w>tmp_win->win_w || !(tmp_win->flags&SBARH) )
|
||||
tmp_win->frame_w = tmp_win->win_w;
|
||||
width>tmp_win->win_w || !(tmp_win->flags&SBARH) )
|
||||
width = tmp_win->win_w;
|
||||
if( !(tmp_win->flags&SCROLL) ||
|
||||
tmp_win->frame_h>tmp_win->win_h || !(tmp_win->flags&SBARV) )
|
||||
tmp_win->frame_h = tmp_win->win_h;
|
||||
height>tmp_win->win_h || !(tmp_win->flags&SBARV) )
|
||||
height = tmp_win->win_h;
|
||||
|
||||
SetUpFrame(tmp_win, tmp_win->frame_x, tmp_win->frame_y,
|
||||
tmp_win->frame_w, tmp_win->frame_h, notify );
|
||||
SetUpFrame(tmp_win, x, y, width, height, notify );
|
||||
|
||||
if( tmp_win==Scr.ActiveWin ){
|
||||
Scr.ActiveWin = NULL;
|
||||
|
@ -969,7 +964,7 @@ void MinMaxWindow( MlvwmWindow *mw, XEvent *evp )
|
|||
|
||||
DisplayPush( mw->minmax_b );
|
||||
XDrawRectangle( dpy, mw->minmax_b, Scr.BlackGC,
|
||||
1, 1, BOXSIZE-6, BOXSIZE-6 );
|
||||
1, 1, BOXSIZE-7, BOXSIZE-7 );
|
||||
while( !isEnd ){
|
||||
XMaskEvent( dpy,
|
||||
ButtonReleaseMask|EnterWindowMask|LeaveWindowMask, &ev );
|
||||
|
@ -983,7 +978,7 @@ void MinMaxWindow( MlvwmWindow *mw, XEvent *evp )
|
|||
if( ev.xcrossing.window==mw->minmax_b ){
|
||||
DisplayPush( mw->minmax_b );
|
||||
XDrawRectangle( dpy, mw->minmax_b, Scr.BlackGC,
|
||||
1, 1, BOXSIZE-6, BOXSIZE-6 );
|
||||
1, 1, BOXSIZE-6, BOXSIZE-6 );
|
||||
isIn = True;
|
||||
}
|
||||
break;
|
||||
|
@ -1248,7 +1243,10 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
|
|||
anker = tmp_win->scroll_v[3];
|
||||
}
|
||||
if( pushd!=0 ){
|
||||
DrawArrow( pressedwin, direction, Scr.BlackGC );
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
|
||||
else
|
||||
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
|
||||
XSync( dpy, 0 );
|
||||
}
|
||||
|
||||
|
@ -1289,15 +1287,23 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
|
|||
break;
|
||||
case EnterNotify:
|
||||
if( ev.xcrossing.window==pressedwin ){
|
||||
if( !isSelect )
|
||||
DrawArrow( pressedwin, direction, Scr.BlackGC );
|
||||
if( !isSelect ) {
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
|
||||
else
|
||||
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
|
||||
}
|
||||
isSelect = True;
|
||||
}
|
||||
break;
|
||||
case LeaveNotify:
|
||||
if( ev.xcrossing.window==pressedwin ){
|
||||
if( isSelect )
|
||||
DrawArrow( pressedwin, direction, Scr.Gray3GC );
|
||||
if( isSelect ) {
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
|
||||
else
|
||||
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
|
||||
}
|
||||
isSelect = False;
|
||||
}
|
||||
break;
|
||||
|
@ -1329,8 +1335,12 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
|
|||
}
|
||||
while( !isEnd );
|
||||
|
||||
if( pushd!=0 )
|
||||
DrawArrow( pressedwin, direction, Scr.Gray3GC );
|
||||
if( pushd!=0 ) {
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
|
||||
else
|
||||
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
|
||||
}
|
||||
XSync( dpy, 0 );
|
||||
}
|
||||
|
||||
|
@ -1374,7 +1384,11 @@ void handle_button_press( XEvent *ev )
|
|||
ev->xany.window = ev->xbutton.subwindow;
|
||||
context = GetContext( Tmp_win, ev, &win );
|
||||
}
|
||||
XAllowEvents(dpy, AsyncPointer, CurrentTime );
|
||||
if ( context==C_TITLE || Scr.flags&SWALLOWFOCUSCLICK )
|
||||
XAllowEvents(dpy, AsyncPointer, CurrentTime );
|
||||
else {
|
||||
XAllowEvents(dpy, ReplayPointer, CurrentTime );
|
||||
}
|
||||
}
|
||||
else
|
||||
XAllowEvents(dpy, ReplayPointer, CurrentTime );
|
||||
|
|
|
@ -674,7 +674,7 @@ void RestartSystem( char *action )
|
|||
|
||||
top = SkipSpace( SkipNonSpace( action+6 ));
|
||||
if( strncmp( top, "mlvwm", 5 ) )
|
||||
Done( 1, top );
|
||||
Done( 1, strdup(top) );
|
||||
else
|
||||
Done( 1, NULL );
|
||||
}
|
||||
|
|
101
mlvwm/menus.c
101
mlvwm/menus.c
|
@ -120,27 +120,30 @@ 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) ){
|
||||
XDrawArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0,
|
||||
14, 14, 180*64, -(90*64) );
|
||||
XDrawArc( dpy, Scr.MenuBar, Scr.Gray1GC, Scr.MyDisplayWidth-15, 0,
|
||||
14, 14, 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 );
|
||||
|
@ -411,19 +414,19 @@ Bool MapMenu( MenuLabel *m, int left, int right, int y, Bool side )
|
|||
XMoveResizeWindow( dpy, m->PullWin, m->MenuX, m->MenuY,
|
||||
m->MenuWidth+2, m->MenuHeight+2 );
|
||||
{
|
||||
XRectangle rect[7];
|
||||
XRectangle rect[5];
|
||||
int point=0;
|
||||
|
||||
rect[point].x = -1; rect[point].y = -1;
|
||||
rect[point].width = m->MenuWidth+1;
|
||||
rect[point].height = m->MenuHeight+1;
|
||||
point++;
|
||||
for( lp=1; lp<4; lp++ ){
|
||||
for( lp=1; lp<3; lp++ ){
|
||||
rect[point].x = m->MenuWidth+lp-1; rect[point].y = lp-1;
|
||||
rect[point].width = 1; rect[point].height = m->MenuHeight+2-lp+1;
|
||||
point++;
|
||||
}
|
||||
for( lp=1; lp<4; lp++ ){
|
||||
for( lp=1; lp<3; lp++ ){
|
||||
rect[point].x = lp-1; rect[point].y = m->MenuHeight+lp-1;
|
||||
rect[point].width = m->MenuWidth+2-lp+1; rect[point].height = 1;
|
||||
point++;
|
||||
|
@ -1293,30 +1296,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 +1330,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( );
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <X11/Xutil.h>
|
||||
#include <X11/xpm.h>
|
||||
|
||||
#define MENUB_H 25
|
||||
#define MENUB_H 20
|
||||
|
||||
/* Definitions of Menu Item */
|
||||
#define STRGRAY 1 /* Draw String Black or Gray? */
|
||||
|
|
|
@ -76,7 +76,7 @@ char *LookUpFiles( char *path, char *filename, int mode )
|
|||
|
||||
char *SkipNonSpace( char *str )
|
||||
{
|
||||
for( ; *str!=' ' && *str!='\t' && *str; str++ );
|
||||
for( ; *str!=' ' && *str!='\t' && *str!='\n' && *str; str++ );
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
@ -186,10 +186,7 @@ void InitScrParams( void )
|
|||
Scr.style_list = NULL;
|
||||
Scr.ShortCutRoot = NULL;
|
||||
Scr.double_click_time = 300;
|
||||
if( Scr.flags&SYSTEM8 )
|
||||
Scr.bar_width = 16;
|
||||
else
|
||||
Scr.bar_width = 19;
|
||||
Scr.bar_width = 16;
|
||||
Scr.flush_time = 100000;
|
||||
Scr.flush_times = 2;
|
||||
Scr.zoom_wait = 10000;
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
#define ReapChildren() while ((wait3(NULL, WNOHANG, NULL)) > 0);
|
||||
#endif
|
||||
|
||||
#define TITLE_HEIGHT 20
|
||||
#define BOXSIZE 13
|
||||
#define TITLE_HEIGHT (Scr.flags&SYSTEM8?20:17)
|
||||
#define BOXSIZE (Scr.flags&SYSTEM8?13:11)
|
||||
#define SBAR_WH Scr.bar_width
|
||||
|
||||
extern Display *dpy;
|
||||
|
@ -178,9 +178,9 @@ extern Atom _XA_WM_DESKTOP;
|
|||
|
||||
extern void Done( int, char * );
|
||||
#ifdef USE_LOCALE
|
||||
#define DEFAULTFS "-adobe-*-*-r-*-*-14-*-*-*-p-*-*-*,\
|
||||
-*-*-*-r-*-*-14-*-*-*-*-*-*-*"
|
||||
#define DEFAULTFS "-adobe-*-*-r-*-*-12-*-*-*-p-*-*-*,\
|
||||
-*-*-*-r-*-*-12-*-*-*-*-*-*-*"
|
||||
#else
|
||||
#define DEFAULTFONT "-adobe-*-*-r-*-*-14-*-*-*-p-*-*-*"
|
||||
#define DEFAULTFONT "-adobe-*-*-r-*-*-12-*-*-*-p-*-*-*"
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -141,6 +141,8 @@ typedef struct ScreenInfo
|
|||
#define OPAQUERESIZE 0x00008000
|
||||
#define ONECLICKMENU 0x00010000
|
||||
#define DEBUGOUT 0x00020000
|
||||
#define ROUNDEDCORNERS 0x00040000
|
||||
#define SWALLOWFOCUSCLICK 0x00080000
|
||||
|
||||
#ifdef USE_LOCALE
|
||||
#define MENUBARFONT Scr.MenuBarFs
|
||||
|
|
Loading…
Reference in New Issue
Block a user