You are not logged in.
Eh guys... You're awesome \o/
Alot happens when you're away.
Last edited by cesura (2010-07-08 08:08:18)
Offline
pyknite wrote:Eh guys... You're awesome \o/
Alot happens when you're away.
Yep I saw that... It's great
Offline
itsbrad212 wrote:pyknite wrote:Eh guys... You're awesome \o/
Alot happens when you're away.
Yep I saw that... It's great
Well, actually, we didn't really do anything except write a function, write a patch, and then agree not to use that function
It's 3:38 AM and I'm tired out of my mind, so I'm going to finally sleep. Night
Last edited by cesura (2010-07-08 08:36:37)
Offline
pyknite wrote:itsbrad212 wrote:Alot happens when you're away.
Yep I saw that... It's great
Well, actually, we didn't really do anything except write a function, write a patch, and then agree not to use that function
The force kill doesn't work, but the kill client work no? (I didn't try it)
Offline
itsbrad212 wrote:pyknite wrote:Yep I saw that... It's great
Well, actually, we didn't really do anything except write a function, write a patch, and then agree not to use that function
The force kill doesn't work, but the kill client work no? (I didn't try it)
The force kill didn't really have much of a use, but the kill_client() works great. It now allows a single child window to be closed without disturbing the parent.
Offline
pyknite wrote:itsbrad212 wrote:Well, actually, we didn't really do anything except write a function, write a patch, and then agree not to use that function
The force kill doesn't work, but the kill client work no? (I didn't try it)
The force kill didn't really have much of a use, but the kill_client() works great. It now allows a single child window to be closed without disturbing the parent.
Great thing!! I will commit your patch
Offline
I don't know if some people are interested, but it can be a great idea to switch to xcb no? Plus, there is not a lot of code for the moment, so the port will be more easier...
Last edited by pyknite (2010-07-08 16:46:53)
Offline
I don't know if some people are interested, but it can be a great idea to switch to xcb no? Plus, there is not a lot of code for the moment, so the port will be more easier...
I like the idea. It would save me the trouble of having to learn crappy Xlib My vote is yes.
Last edited by cesura (2010-07-08 16:51:40)
Offline
pyknite wrote:I don't know if some people are interested, but it can be a great idea to switch to xcb no? Plus, there is not a lot of code for the moment, so the port will be more easier...
I like the idea. It would save me the trouble of having to learn crappy Xlib My vote is yes.
Yep but you'all have to learn the "crappy" (by crappy, I mean docless ) xcb
Offline
itsbrad212 wrote:pyknite wrote:I don't know if some people are interested, but it can be a great idea to switch to xcb no? Plus, there is not a lot of code for the moment, so the port will be more easier...
I like the idea. It would save me the trouble of having to learn crappy Xlib My vote is yes.
Yep but you'all have to learn the "crappy" (by crappy, I mean docless ) xcb
?
http://xcb.freedesktop.org/XcbApi/
http://xcb.freedesktop.org/tutorial/
http://xcb.freedesktop.org/XcbNotes/
EDIT: I thought there was short documentation because it was lightweight...
Last edited by cesura (2010-07-08 17:00:57)
Offline
pyknite wrote:itsbrad212 wrote:I like the idea. It would save me the trouble of having to learn crappy Xlib My vote is yes.
Yep but you'all have to learn the "crappy" (by crappy, I mean docless ) xcb
?
http://xcb.freedesktop.org/XcbApi/
http://xcb.freedesktop.org/tutorial/
http://xcb.freedesktop.org/XcbNotes/EDIT: I thought there was short documentation because it was lightweight...
Ok, they add some stuffs since my last look
Offline
itsbrad212 wrote:pyknite wrote:Yep but you'all have to learn the "crappy" (by crappy, I mean docless ) xcb
?
http://xcb.freedesktop.org/XcbApi/
http://xcb.freedesktop.org/tutorial/
http://xcb.freedesktop.org/XcbNotes/EDIT: I thought there was short documentation because it was lightweight...
Ok, they add some stuffs since my last look
Haha it's fine However, I read through some of the docs, and it seems like it is almost too lightweight. Like Xlib with anorexia
Offline
pyknite wrote:itsbrad212 wrote:?
http://xcb.freedesktop.org/XcbApi/
http://xcb.freedesktop.org/tutorial/
http://xcb.freedesktop.org/XcbNotes/EDIT: I thought there was short documentation because it was lightweight...
Ok, they add some stuffs since my last look
Haha it's fine However, I read through some of the docs, and it seems like it is almost too lightweight. Like Xlib with anorexia
What do you mean by "too lightweight"? Seems to be pretty much complete... For example look at awesome, it's done with xcb
Offline
itsbrad212 wrote:pyknite wrote:Ok, they add some stuffs since my last look
Haha it's fine However, I read through some of the docs, and it seems like it is almost too lightweight. Like Xlib with anorexia
What do you mean by "too lightweight"? Seems to be pretty much complete... For example look at awesome, it's done with xcb
The Public API, for example, has only 16 functions (not including the other APIs). Xlib has all of these: http://tronche.com/gui/x/xlib/function-index.html
EDIT: Unless I'm missing a big portion of XCB functions
Last edited by cesura (2010-07-08 17:18:01)
Offline
pyknite wrote:itsbrad212 wrote:Haha it's fine However, I read through some of the docs, and it seems like it is almost too lightweight. Like Xlib with anorexia
What do you mean by "too lightweight"? Seems to be pretty much complete... For example look at awesome, it's done with xcb
The Public API, for example, has only 16 functions (not including the other APIs). Xlib has all of these: http://tronche.com/gui/x/xlib/function-index.html
EDIT: Unless I'm missing a big portion of XCB functions
http://xcb.freedesktop.org/manual/group … __API.html and http://xcb.freedesktop.org/manual/modules.html seems to be suffiscient
Offline
itsbrad212 wrote:pyknite wrote:What do you mean by "too lightweight"? Seems to be pretty much complete... For example look at awesome, it's done with xcb
The Public API, for example, has only 16 functions (not including the other APIs). Xlib has all of these: http://tronche.com/gui/x/xlib/function-index.html
EDIT: Unless I'm missing a big portion of XCB functions
http://xcb.freedesktop.org/manual/group … __API.html and http://xcb.freedesktop.org/manual/modules.html seems to be suffiscient
Oh wow! I stand corrected I am also excited about XCB being asynchronous!
Last edited by cesura (2010-07-08 17:32:59)
Offline
Hey, i am currently writing for a patch to move a window up and down on the stack area with shift+alt+j and shift+alt+k.
Here is what i have so far:
--- ../../../../build/aur/catwm-git/src/catwm/config.h 2010-07-08 19:09:31.656601298 +0200
+++ config.h 2010-07-08 21:06:09.239234722 +0200
@@ -59,6 +59,8 @@ static struct key keys[] = {
{ MOD, XK_k, prev_win, {NULL}},
{ MOD, XK_Return, swap_master, {NULL}},
{ MOD, XK_space, switch_mode, {NULL}},
+ { MOD|ShiftMask, XK_k, move_up, {NULL}},
+ { MOD|ShiftMask, XK_j, move_down, {NULL}},
{ MOD, XK_c, spawn, {.com = lockcmd}},
{ 0, XF86XK_AudioNext, spawn, {.com = next}},
{ 0, XF86XK_AudioPrev, spawn, {.com = prev}},
and
--- ../../../../build/aur/catwm-git/src/catwm/catwm.c 2010-07-08 19:09:02.702439492 +0200
+++ catwm.c 2010-07-08 21:08:36.468378372 +0200
@@ -80,6 +80,8 @@ static void increase();
static void keypress(XEvent *e);
static void kill_client();
static void maprequest(XEvent *e);
+static void move_down();
+static void move_up();
static void next_desktop();
static void next_win();
static void prev_desktop();
@@ -92,6 +94,7 @@ static void setup();
static void sigchld(int unused);
static void spawn(const Arg arg);
static void start();
+static void swap();
static void swap_master();
static void switch_mode();
static void tile();
@@ -319,6 +322,24 @@ void maprequest(XEvent *e) {
update_current();
}
+void move_down() {
+ if(current == NULL || current->next == NULL) {
+ return;
+ }
+ swap(current, current->next);
+ tile();
+ update_current();
+}
+
+void move_up() {
+ if(current == NULL || current->prev == head) {
+ return;
+ }
+ swap(current->prev, current);
+ tile();
+ update_current();
+}
+
void next_desktop() {
int tmp = current_desktop;
if(tmp== 9)
@@ -506,6 +527,29 @@ void start() {
}
}
+void swap(client *c1, client *c2) {
+ client *temp;
+
+ temp = c1->next;
+ c1->next = c2->next;
+ c2 -> next = temp;
+ if(c1->next != NULL) {
+ c1->next->prev = c1;
+ }
+ if(c2->next != NULL) {
+ c2->next->prev = c2;
+ }
+ temp = c1->prev;
+ c1->prev = c2->prev;
+ c2 -> prev = temp;
+ if(c1 -> prev != NULL) {
+ c1->prev->next = c1;
+ }
+ if(c2->prev != NULL) {
+ c2->prev->next = c2;
+ }
+}
+
void swap_master() {
Window tmp;
moving a window up works just fine, but it doesn't seem to recognize the move down. For example, if current is a terminal it just prints "J" when i push shift+alt+j but it should move the window down. Does anyone of you see were the problem is?
EDIT:
ignore the "it doesn't work stuff" actually it works. The problem was, that gcc didn't compile catwm again, because i only changed the config.h in the last try and gcc thought, that nothing changed and so there's nothing to compile. So in short: it works
EDIT EDIT:
DON'T USE THIS VERSION. there's a better one a few posts below
Last edited by knopwob (2010-07-09 16:37:38)
Offline
Works great! Thanks for the patch and I'll update the wiki.
EDIT: Wiki updated
Last edited by cesura (2010-07-08 23:40:44)
Offline
Bug report: Attempting to move a window down when there is nothing below it causes the wm to crash.
Steps to reproduce:
1) Go to empty desktop
2) Open a single program (a terminal emulator for example)
3) Hit Mod+Shift+j and watch X die
I'll see if there is a fix for this.
Last edited by cesura (2010-07-09 02:05:38)
Offline
Yay! My first bugfix! I'll post a patch ASAP. The problem was with the head->win. Trying to move it up/down caused an error.
EDIT:
catwm.c.patch:
*** catwm.c 2010-07-08 21:04:17.801621166 -0500
--- catwm2.c 2010-07-08 21:02:36.484950596 -0500
***************
*** 323,329 ****
}
void move_down() {
! if(current == NULL || current->next == NULL) {
return;
}
swap(current, current->next);
--- 323,329 ----
}
void move_down() {
! if(current == NULL || current->next == NULL || current->win == head->win || current->prev == NULL) {
return;
}
swap(current, current->next);
***************
*** 332,338 ****
}
void move_up() {
! if(current == NULL || current->prev == head) {
return;
}
swap(current->prev, current);
--- 332,338 ----
}
void move_up() {
! if(current == NULL || current->prev == head || current->win == head->win) {
return;
}
swap(current->prev, current);
EDIT EDIT: Fixed patch
Oh and about the whole XCB switch thing, I was thinking about it, and it seemed like too much work to be worth-while (pardon my laziness). It may make catwm a bit faster, but as it is, I don't any need for a speed improvement. Also, XCB would be just another dependency of catwm.
Last edited by cesura (2010-07-09 02:15:15)
Offline
oh man, by seeing your patch i just realized, that my way of doing this was way to complicated. Theres no reason to swap the actual nodes in the linked list, i just could swap the content of the nodes.
Here's a new version of the patch(with itsbrad212's fixes included):
--- ../../../../build/aur/catwm-git/src/catwm/catwm.c 2010-07-08 19:09:02.702439492 +0200
+++ catwm.c 2010-07-09 10:14:30.454973968 +0200
@@ -80,6 +80,8 @@ static void increase();
static void keypress(XEvent *e);
static void kill_client();
static void maprequest(XEvent *e);
+static void move_down();
+static void move_up();
static void next_desktop();
static void next_win();
static void prev_desktop();
@@ -318,6 +320,33 @@ void maprequest(XEvent *e) {
tile();
update_current();
}
+
+void move_down() {
+ Window tmp;
+ if(current == NULL || current->next == NULL || current->win == head->win || current->prev == NULL) {
+ return;
+ }
+ tmp = current->win;
+ current->win = current->next->win;
+ current->next->win = tmp;
+ //keep the moved window activated
+ next_win();
+ tile();
+ update_current();
+}
+
+void move_up() {
+ Window tmp;
+ if(current == NULL || current->prev == head || current->win == head->win) {
+ return;
+ }
+ tmp = current->win;
+ current->win = current->prev->win;
+ current->prev->win = tmp;
+ prev_win();
+ tile();
+ update_current();
+}
void next_desktop() {
int tmp = current_desktop;
EDIT:
here's the patch for config.h again to have both in one post:
--- ../../../../build/aur/catwm-git/src/catwm/config.h 2010-07-08 19:09:31.656601298 +0200
+++ config.h 2010-07-08 21:06:09.239234722 +0200
@@ -59,6 +59,8 @@ static struct key keys[] = {
{ MOD, XK_k, prev_win, {NULL}},
{ MOD, XK_Return, swap_master, {NULL}},
{ MOD, XK_space, switch_mode, {NULL}},
+ { MOD|ShiftMask, XK_k, move_up, {NULL}},
+ { MOD|ShiftMask, XK_j, move_down, {NULL}},
{ MOD, XK_c, spawn, {.com = lockcmd}},
{ 0, XF86XK_AudioNext, spawn, {.com = next}},
{ 0, XF86XK_AudioPrev, spawn, {.com = prev}},
Last edited by knopwob (2010-07-09 16:40:29)
Offline
Great project.
Just a suggestion-- you may want to go back and edit the first post to give a more complete and informational introduction to catwm, to draw more attention and interest.
Offline
oh man, by seeing your patch i just realized, that my way of doing this was way to complicated. Theres no reason to swap the actual nodes in the linked list, i just could swap the content of the nodes.
Here's a new version of the patch(with itsbrad212's fixes included):
--- ../../../../build/aur/catwm-git/src/catwm/catwm.c 2010-07-08 19:09:02.702439492 +0200 +++ catwm.c 2010-07-09 10:14:30.454973968 +0200 @@ -80,6 +80,8 @@ static void increase(); static void keypress(XEvent *e); static void kill_client(); static void maprequest(XEvent *e); +static void move_down(); +static void move_up(); static void next_desktop(); static void next_win(); static void prev_desktop(); @@ -318,6 +320,33 @@ void maprequest(XEvent *e) { tile(); update_current(); } + +void move_down() { + Window tmp; + if(current == NULL || current->next == NULL || current->win == head->win || current->prev == NULL) { + return; + } + tmp = current->win; + current->win = current->next->win; + current->next->win = tmp; + //keep the moved window activated + next_win(); + tile(); + update_current(); +} + +void move_up() { + Window tmp; + if(current == NULL || current->prev == head || current->win == head->win) { + return; + } + tmp = current->win; + current->win = current->prev->win; + current->prev->win = tmp; + prev_win(); + tile(); + update_current(); +} void next_desktop() { int tmp = current_desktop;
Don't forget to remove swap()
Offline
Offline
it's not ment as a patch for the patch, but as a replacement for it. So there's no swap() that needs to be removed ;-)
But i'll edit the posts so this becomes more clear
Oh, disregard that then
Offline