Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ofarges-dwm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FARGES Olivier
ofarges-dwm
Commits
c53980cd
Commit
c53980cd
authored
18 years ago
by
arg@10ksloc.org
Browse files
Options
Downloads
Patches
Plain Diff
applied Sanders resize patch, fixed lower bug
parent
95e56ffc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
client.c
+8
-2
8 additions, 2 deletions
client.c
dwm.h
+4
-1
4 additions, 1 deletion
dwm.h
event.c
+27
-12
27 additions, 12 deletions
event.c
main.c
+1
-1
1 addition, 1 deletion
main.c
tag.c
+3
-3
3 additions, 3 deletions
tag.c
with
43 additions
and
19 deletions
client.c
+
8
−
2
View file @
c53980cd
...
@@ -267,7 +267,7 @@ maximize(Arg *arg)
...
@@ -267,7 +267,7 @@ maximize(Arg *arg)
*
sel
->
w
=
sw
-
2
*
sel
->
border
;
*
sel
->
w
=
sw
-
2
*
sel
->
border
;
*
sel
->
h
=
sh
-
2
*
sel
->
border
-
bh
;
*
sel
->
h
=
sh
-
2
*
sel
->
border
-
bh
;
higher
(
sel
);
higher
(
sel
);
resize
(
sel
,
False
);
resize
(
sel
,
False
,
TopLeft
);
}
}
void
void
...
@@ -283,9 +283,11 @@ pop(Client *c)
...
@@ -283,9 +283,11 @@ pop(Client *c)
}
}
void
void
resize
(
Client
*
c
,
Bool
inc
)
resize
(
Client
*
c
,
Bool
inc
,
Corner
sticky
)
{
{
XConfigureEvent
e
;
XConfigureEvent
e
;
int
right
=
*
c
->
x
+
*
c
->
w
;
int
bottom
=
*
c
->
y
+
*
c
->
h
;
if
(
inc
)
{
if
(
inc
)
{
if
(
c
->
incw
)
if
(
c
->
incw
)
...
@@ -305,6 +307,10 @@ resize(Client *c, Bool inc)
...
@@ -305,6 +307,10 @@ resize(Client *c, Bool inc)
*
c
->
w
=
c
->
maxw
;
*
c
->
w
=
c
->
maxw
;
if
(
c
->
maxh
&&
*
c
->
h
>
c
->
maxh
)
if
(
c
->
maxh
&&
*
c
->
h
>
c
->
maxh
)
*
c
->
h
=
c
->
maxh
;
*
c
->
h
=
c
->
maxh
;
if
(
sticky
==
TopRight
||
sticky
==
BottomRight
)
*
c
->
x
=
right
-
*
c
->
w
;
if
(
sticky
==
BottomLeft
||
sticky
==
BottomRight
)
*
c
->
y
=
bottom
-
*
c
->
h
;
resizetitle
(
c
);
resizetitle
(
c
);
XSetWindowBorderWidth
(
dpy
,
c
->
win
,
1
);
XSetWindowBorderWidth
(
dpy
,
c
->
win
,
1
);
XMoveResizeWindow
(
dpy
,
c
->
win
,
*
c
->
x
,
*
c
->
y
,
*
c
->
w
,
*
c
->
h
);
XMoveResizeWindow
(
dpy
,
c
->
win
,
*
c
->
x
,
*
c
->
y
,
*
c
->
w
,
*
c
->
h
);
...
...
This diff is collapsed.
Click to expand it.
dwm.h
+
4
−
1
View file @
c53980cd
...
@@ -25,6 +25,7 @@ enum { Tscratch, Tdev, Twww, Twork, TLast };
...
@@ -25,6 +25,7 @@ enum { Tscratch, Tdev, Twww, Twork, TLast };
/********** CUSTOMIZE **********/
/********** CUSTOMIZE **********/
typedef
union
Arg
Arg
;
typedef
union
Arg
Arg
;
typedef
enum
Corner
Corner
;
typedef
struct
DC
DC
;
typedef
struct
DC
DC
;
typedef
struct
Client
Client
;
typedef
struct
Client
Client
;
typedef
struct
Fnt
Fnt
;
typedef
struct
Fnt
Fnt
;
...
@@ -43,6 +44,8 @@ enum { WMProtocols, WMDelete, WMLast };
...
@@ -43,6 +44,8 @@ enum { WMProtocols, WMDelete, WMLast };
/* cursor */
/* cursor */
enum
{
CurNormal
,
CurResize
,
CurMove
,
CurLast
};
enum
{
CurNormal
,
CurResize
,
CurMove
,
CurLast
};
enum
Corner
{
TopLeft
,
TopRight
,
BottomLeft
,
BottomRight
};
struct
Fnt
{
struct
Fnt
{
int
ascent
;
int
ascent
;
int
descent
;
int
descent
;
...
@@ -121,7 +124,7 @@ extern void lower(Client *c);
...
@@ -121,7 +124,7 @@ extern void lower(Client *c);
extern
void
manage
(
Window
w
,
XWindowAttributes
*
wa
);
extern
void
manage
(
Window
w
,
XWindowAttributes
*
wa
);
extern
void
maximize
(
Arg
*
arg
);
extern
void
maximize
(
Arg
*
arg
);
extern
void
pop
(
Client
*
c
);
extern
void
pop
(
Client
*
c
);
extern
void
resize
(
Client
*
c
,
Bool
inc
);
extern
void
resize
(
Client
*
c
,
Bool
inc
,
Corner
sticky
);
extern
void
setgeom
(
Client
*
c
);
extern
void
setgeom
(
Client
*
c
);
extern
void
setsize
(
Client
*
c
);
extern
void
setsize
(
Client
*
c
);
extern
void
settitle
(
Client
*
c
);
extern
void
settitle
(
Client
*
c
);
...
...
This diff is collapsed.
Click to expand it.
event.c
+
27
−
12
View file @
c53980cd
...
@@ -79,7 +79,7 @@ movemouse(Client *c)
...
@@ -79,7 +79,7 @@ movemouse(Client *c)
XSync
(
dpy
,
False
);
XSync
(
dpy
,
False
);
*
c
->
x
=
ocx
+
(
ev
.
xmotion
.
x
-
x1
);
*
c
->
x
=
ocx
+
(
ev
.
xmotion
.
x
-
x1
);
*
c
->
y
=
ocy
+
(
ev
.
xmotion
.
y
-
y1
);
*
c
->
y
=
ocy
+
(
ev
.
xmotion
.
y
-
y1
);
resize
(
c
,
False
);
resize
(
c
,
False
,
TopLeft
);
break
;
break
;
case
ButtonRelease
:
case
ButtonRelease
:
XUngrabPointer
(
dpy
,
CurrentTime
);
XUngrabPointer
(
dpy
,
CurrentTime
);
...
@@ -93,6 +93,7 @@ resizemouse(Client *c)
...
@@ -93,6 +93,7 @@ resizemouse(Client *c)
{
{
XEvent
ev
;
XEvent
ev
;
int
ocx
,
ocy
;
int
ocx
,
ocy
;
Corner
sticky
;
ocx
=
*
c
->
x
;
ocx
=
*
c
->
x
;
ocy
=
*
c
->
y
;
ocy
=
*
c
->
y
;
...
@@ -113,7 +114,18 @@ resizemouse(Client *c)
...
@@ -113,7 +114,18 @@ resizemouse(Client *c)
*
c
->
h
=
abs
(
ocy
-
ev
.
xmotion
.
y
);
*
c
->
h
=
abs
(
ocy
-
ev
.
xmotion
.
y
);
*
c
->
x
=
(
ocx
<=
ev
.
xmotion
.
x
)
?
ocx
:
ocx
-
*
c
->
w
;
*
c
->
x
=
(
ocx
<=
ev
.
xmotion
.
x
)
?
ocx
:
ocx
-
*
c
->
w
;
*
c
->
y
=
(
ocy
<=
ev
.
xmotion
.
y
)
?
ocy
:
ocy
-
*
c
->
h
;
*
c
->
y
=
(
ocy
<=
ev
.
xmotion
.
y
)
?
ocy
:
ocy
-
*
c
->
h
;
resize
(
c
,
True
);
if
(
ocx
<=
ev
.
xmotion
.
x
)
{
if
(
ocy
<=
ev
.
xmotion
.
y
)
sticky
=
TopLeft
;
else
sticky
=
BottomLeft
;
}
else
{
if
(
ocy
<=
ev
.
xmotion
.
y
)
sticky
=
TopRight
;
else
sticky
=
BottomRight
;
}
resize
(
c
,
True
,
sticky
);
break
;
break
;
case
ButtonRelease
:
case
ButtonRelease
:
XUngrabPointer
(
dpy
,
CurrentTime
);
XUngrabPointer
(
dpy
,
CurrentTime
);
...
@@ -153,24 +165,27 @@ buttonpress(XEvent *e)
...
@@ -153,24 +165,27 @@ buttonpress(XEvent *e)
}
}
}
}
else
if
((
c
=
getclient
(
ev
->
window
)))
{
else
if
((
c
=
getclient
(
ev
->
window
)))
{
if
(
arrange
==
dotile
&&
!
c
->
isfloat
)
{
if
((
ev
->
state
&
ControlMask
)
&&
(
ev
->
button
==
Button1
))
zoom
(
NULL
);
return
;
}
/* floating windows */
higher
(
c
);
switch
(
ev
->
button
)
{
switch
(
ev
->
button
)
{
default:
default:
break
;
break
;
case
Button1
:
case
Button1
:
movemouse
(
c
);
if
(
arrange
==
dotile
&&
!
c
->
isfloat
)
{
if
((
ev
->
state
&
ControlMask
)
&&
(
ev
->
button
==
Button1
))
zoom
(
NULL
);
}
else
{
higher
(
c
);
movemouse
(
c
);
}
break
;
break
;
case
Button2
:
case
Button2
:
lower
(
c
);
lower
(
c
);
break
;
break
;
case
Button3
:
case
Button3
:
resizemouse
(
c
);
if
(
arrange
==
dofloat
||
c
->
isfloat
)
{
higher
(
c
);
resizemouse
(
c
);
}
break
;
break
;
}
}
}
}
...
@@ -197,7 +212,7 @@ configurerequest(XEvent *e)
...
@@ -197,7 +212,7 @@ configurerequest(XEvent *e)
if
(
ev
->
value_mask
&
CWBorderWidth
)
if
(
ev
->
value_mask
&
CWBorderWidth
)
c
->
border
=
1
;
c
->
border
=
1
;
gravitate
(
c
,
False
);
gravitate
(
c
,
False
);
resize
(
c
,
True
);
resize
(
c
,
True
,
TopLeft
);
}
}
wc
.
x
=
ev
->
x
;
wc
.
x
=
ev
->
x
;
...
...
This diff is collapsed.
Click to expand it.
main.c
+
1
−
1
View file @
c53980cd
...
@@ -24,7 +24,7 @@ static void
...
@@ -24,7 +24,7 @@ static void
cleanup
()
cleanup
()
{
{
while
(
sel
)
{
while
(
sel
)
{
resize
(
sel
,
True
);
resize
(
sel
,
True
,
TopLeft
);
unmanage
(
sel
);
unmanage
(
sel
);
}
}
XSetInputFocus
(
dpy
,
PointerRoot
,
RevertToPointerRoot
,
CurrentTime
);
XSetInputFocus
(
dpy
,
PointerRoot
,
RevertToPointerRoot
,
CurrentTime
);
...
...
This diff is collapsed.
Click to expand it.
tag.c
+
3
−
3
View file @
c53980cd
...
@@ -45,7 +45,7 @@ dofloat(Arg *arg)
...
@@ -45,7 +45,7 @@ dofloat(Arg *arg)
for
(
c
=
clients
;
c
;
c
=
c
->
next
)
{
for
(
c
=
clients
;
c
;
c
=
c
->
next
)
{
setgeom
(
c
);
setgeom
(
c
);
if
(
c
->
tags
[
tsel
])
{
if
(
c
->
tags
[
tsel
])
{
resize
(
c
,
True
);
resize
(
c
,
True
,
TopLeft
);
}
}
else
else
ban
(
c
);
ban
(
c
);
...
@@ -81,7 +81,7 @@ dotile(Arg *arg)
...
@@ -81,7 +81,7 @@ dotile(Arg *arg)
if
(
c
->
tags
[
tsel
])
{
if
(
c
->
tags
[
tsel
])
{
if
(
c
->
isfloat
)
{
if
(
c
->
isfloat
)
{
higher
(
c
);
higher
(
c
);
resize
(
c
,
True
);
resize
(
c
,
True
,
TopLeft
);
continue
;
continue
;
}
}
if
(
n
==
1
)
{
if
(
n
==
1
)
{
...
@@ -102,7 +102,7 @@ dotile(Arg *arg)
...
@@ -102,7 +102,7 @@ dotile(Arg *arg)
*
c
->
w
=
w
-
2
*
c
->
border
;
*
c
->
w
=
w
-
2
*
c
->
border
;
*
c
->
h
=
h
-
2
*
c
->
border
;
*
c
->
h
=
h
-
2
*
c
->
border
;
}
}
resize
(
c
,
False
);
resize
(
c
,
False
,
TopLeft
);
i
++
;
i
++
;
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment