You are not logged in.

#776 2012-07-22 14:07:52

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

dnuux wrote:

Nice work! smile I played with the xinerama-core branch a bit and noticed two bugs. I have two monitors, right of which is the primary. Whenever I launch a program specified as floating in config.h, it shows up in the left monitor but monsterwm still thinks it's in the right one (as it should be). Also, making a client fullscreen just puts it to the top left corner of the leftmost monitor regardless of the monitor position. These fixes seem to work fine for me:

hi, and thanks wink I will look into this in a moment

dnuux wrote:

Also, how would I go about having the bar visible only in the default monitor?

I think that this has to be implemented in the bar itself.
If the bar is multi-monitor aware, it knows where monitors start and end,
and can spawn on one of them or on all or on each one separately etc.
If I get some time I might look into bar and try to do that.

dnuux wrote:

Oh and I don't think this will work without modifying the tile function. wink

yep, I have already fixed this

I have also fixed a funny behavior with mousemotion.
If you have a floating window and try to resize it even if the pointer is not above the window, it works tongue
If you have a floating window and try to move it, even if the pointer is in another screen, it works! tongue tongue
It now works as expected.

I will fix the above too and push.

Last edited by c00kiemon5ter (2012-07-22 14:08:21)


.:[ git me! ] :.

Offline

#777 2012-07-22 14:23:37

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

done, dnuux's fix works great. sorry for the oversight on my part.


.:[ git me! ] :.

Offline

#778 2012-07-22 14:24:18

dnuux
Member
Registered: 2012-07-22
Posts: 17

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

I think that this has to be implemented in the bar itself.
If the bar is multi-monitor aware, it knows where monitors start and end,
and can spawn on one of them or on all or on each one separately etc.
If I get some time I might look into bar and try to do that.

I meant so that I don't get the annoying gap at the top at all, my bar shows up only in my primary monitor. smile I can toggle the bar every time but it gets a bit annoying.

Also I noticed that I can't seem to move floating windows to another monitor. My brilliant solution was to add nd->curr->isfloat &= False to client_to_monitor, so that it gets tiled in the second monitor.

Offline

#779 2012-07-22 14:34:55

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

dnuux wrote:

I meant so that I don't get the annoying gap at the top at all, my bar shows up only in my primary monitor. smile I can toggle the bar every time but it gets a bit annoying.

hmm, I am using bar by TheLemonBar, and it covers the top of both screens.
what bar are you using, and how are you spawining it ?

dnuux wrote:

Also I noticed that I can't seem to move floating windows to another monitor. My brilliant solution was to add nd->curr->isfloat &= False to client_to_monitor, so that it gets tiled in the second monitor.

yes, this is expected, floating windows wont move to the new monitor as "they dont know where to be placed".
this also means that you can move floating windows from one monitor to the other,
and focusing a monitor will skip the floating window, as it is owned by the other monitor's desktop.
or you can make floating window that cover more than one monitor, etc

you can either make them tiled as you did, or move them to: (on top of my head - you get the idea I guess)

newmonitor->x + (windowattribute.x - oldmonitor->x)
newmonitor->y + (windowattribute.y - oldmonitor->y)

edit
kinda works tongue monitors with different sizes might have the floating window end up in between the monitors.

diff --git a/monsterwm.c b/monsterwm.c
index 675a2c4..2866236 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -382,7 +382,15 @@ void client_to_monitor(const Arg *arg) {
     XMapWindow(dis, nd->curr->win);
 
     if (FOLLOW_MONITOR) change_monitor(arg);
-    if (!(nd->curr->isfloat || nd->curr->istrans) || (cd->head && !cd->head->next)) { tile(cd, cm); tile(nd, nm); }
+    if (nd->curr->isfloat || nd->curr->istrans) {
+        XWindowAttributes wa = {0};
+        if (XGetWindowAttributes(dis, nd->curr->win, &wa))
+            XMoveWindow(dis, nd->curr->win, nm->x + (wa.x - cm->x), nm->y + (wa.y - cm->y));
+    }
+    else if (cd->head && !cd->head->next) {
+        tile(cd, cm);
+        tile(nd, nm);
+    }
     if (!FOLLOW_MONITOR) desktopinfo();
 }
 

Last edited by c00kiemon5ter (2012-07-22 14:49:47)


.:[ git me! ] :.

Offline

#780 2012-07-22 14:35:26

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: monsterwm! ~ yet another tiny wm

dnuux wrote:

Also I noticed that I can't seem to move floating windows to another monitor. My brilliant solution was to add nd->curr->isfloat &= False to client_to_monitor, so that it gets tiled in the second monitor.

You might want to do the same for fullscreen clients as well smile

Offline

#781 2012-07-22 14:50:55

dnuux
Member
Registered: 2012-07-22
Posts: 17

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

hmm, I am using bar by TheLemonBar, and it covers the top of both screens.
what bar are you using, and how are you spawining it ?

No no, I want to have a bar only in my primary screen and utilize the whole screenspace in the other monitor. Basically SHOW_PANEL for each monitor. Hackish solution is

for (int m = 0; m < nmonitors; m++) {
    monitors[m] = (Monitor){ .next = (m+1 < nmonitors) ? &monitors[m+1]:NULL,
                                .x = info[m].x_org, .y = info[m].y_org,
                                .w = info[m].width, .h = info[m].height };
    for (unsigned int d = 0; d < DESKTOPS; d++)
        monitors[m].desktops[d] = (Desktop){ .mode = DEFAULT_MODE, .sbar = m == 0};
}

Also one more question: Is it a bug or a design decision to not move the client to another screen when dragged there? tongue

Offline

#782 2012-07-22 15:03:31

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

dnuux wrote:

No no, I want to have a bar only in my primary screen and utilize the whole screenspace in the other monitor. Basically SHOW_PANEL for each monitor. Hackish solution is

I understand that, and what you meant. What I dont see is why the bar wont expand to both monitors, unless it has a width parameter.

maybe initlayouts can be improved to initialize more than the layouts..

dnuux wrote:

Also one more question: Is it a bug or a design decision to not move the client to another screen when dragged there? tongue

floating clients should be able to move to any monitor.


.:[ git me! ] :.

Offline

#783 2012-07-22 15:38:44

dnuux
Member
Registered: 2012-07-22
Posts: 17

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

I understand that, and what you meant. What I dont see is why the bar wont expand to both monitors, unless it has a width parameter.

maybe initlayouts can be improved to initialize more than the layouts..

I'm using dzen2 so it won't expand because I specify the x position and width as parameters.

c00kiemon5ter wrote:

kinda works tongue monitors with different sizes might have the floating window end up in between the monitors.

Awesome, thanks for your help!

Cloudef wrote:
dnuux wrote:

Also I noticed that I can't seem to move floating windows to another monitor. My brilliant solution was to add nd->curr->isfloat &= False to client_to_monitor, so that it gets tiled in the second monitor.

You might want to do the same for fullscreen clients as well smile

Thanks smile

Last edited by dnuux (2012-07-22 15:47:08)

Offline

#784 2012-07-22 16:05:16

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

I pushed a new branch - xinerama-init
It allows one to set a specific monitor's and desktop's initial values - bar visibility, layout mode and adjustments to master size.
if you want to leave the default values, then use DEFAULT_MODE for the
layout mode, 0 for the master size (masz) and SHOW_PANEL for sbar.
see the new config.def.h - init[] array.


for some more goodies, in my personal config, I've "named" my deskopts and monitors,
so the configuration is now much more readable, see my config.h

[...]

/* "name" desktops */
enum { CURRENT=-1, WEB, DEV, FOO, MISC };
/* "name" monitors */
enum { BIG, SMALL };

[...]


static const struct ml init[] = { \
    /* monitor  desktop   mode    masz  sbar   */
    {   SMALL,    WEB,  { BSTACK, 300,  False } },
    {   BIG,      WEB,  { TILE,    0,   True  } },
    {   BIG,      DEV,  { GRID,    0,   True  } },
};

[...]

static const AppRule rules[] = { \
    /*  class     monitor  desktop  follow  float */
    { "MPlayer",   SMALL,  CURRENT, True,   True  },
    { "Gimp",       BIG,     FOO,   True,   True  },
    { "Deluge",    SMALL,    FOO,   False,  False },
    { "IRC-",       BIG,     WEB,   False,  False },
};

[...]

static Key keys[] = {
       [....]
       DESKTOPCHANGE(    XK_F1,                             WEB)
       DESKTOPCHANGE(    XK_F2,                             DEV)
       DESKTOPCHANGE(    XK_F3,                             FOO)
       MONITORCHANGE(    XK_F1,                             BIG)
       MONITORCHANGE(    XK_F2,                             SMALL)
};

Last edited by c00kiemon5ter (2012-07-22 16:26:28)


.:[ git me! ] :.

Offline

#785 2012-07-22 16:44:07

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

If you prefer to reset the fullscreen and floating state of the clients, I can make that the default.
Tell me what you think. I guess @dnuux and @Cloudef are already in favor.

diff --git a/monsterwm.c b/monsterwm.c
index fbaab39..8d9f5be 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -379,10 +379,12 @@ void client_to_monitor(const Arg *arg) {
     cd->curr->next = NULL;
     XUnmapWindow(dis, cd->curr->win);
     focus(cd->prev, cd, cm);
+
     XMapWindow(dis, nd->curr->win);
+    nd->curr->isfloat = nd->curr->isfull = False;
 
-    if (FOLLOW_MONITOR) change_monitor(arg);
-    if (!(nd->curr->isfloat || nd->curr->istrans) || (cd->head && !cd->head->next)) { tile(cd, cm); tile(nd, nm); }
+    if (FOLLOW_MONITOR) change_monitor(arg); else tile(nd, nm);
+    if (cd->head && !cd->head->next) tile(cd, cm);
     if (!FOLLOW_MONITOR) desktopinfo();
 }
 

Last edited by c00kiemon5ter (2012-07-22 17:07:59)


.:[ git me! ] :.

Offline

#786 2012-07-22 17:37:18

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: monsterwm! ~ yet another tiny wm

Tell me what you think. I guess @dnuux and @Cloudef are already in favor.

Yes.

Offline

#787 2012-07-22 17:44:41

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

I updated the readme and pushed that, so we'll do the invert tongue
If people dont like having their fullscreen and floating clients reset when moved to another desktop speak up


.:[ git me! ] :.

Offline

#788 2012-07-22 17:47:51

dnuux
Member
Registered: 2012-07-22
Posts: 17

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

I pushed a new branch - xinerama-init
It allows one to set a specific monitor's and desktop's initial values - bar visibility, layout mode and adjustments to master size.
if you want to leave the default values, then use DEFAULT_MODE for the
layout mode, 0 for the master size (masz) and SHOW_PANEL for sbar.
see the new config.def.h - init[] array.

Works perfect, thanks! smile

c00kiemon5ter wrote:

Tell me what you think. I guess @dnuux and @Cloudef are already in favor.

Yep. Your patch doesn't seem to tile the current desktop anymore though. Also I noticed that when moving a floating window to the other screen, it gets the INFOCUS border even if it's the only client in that monitor. No border if I move a client that's already tiled.

Offline

#789 2012-07-22 17:51:22

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

ah, it's an easy fix, but I got to go atm. I will fix it later tonight. thanks for the report.


.:[ git me! ] :.

Offline

#790 2012-07-22 20:26:50

kuraku
Member
From: planet Earth
Registered: 2012-01-03
Posts: 202

Re: monsterwm! ~ yet another tiny wm

Oh more fixes. /me likes it

Btw i wanna suggest one monsterwm hackday to try to squash moar bugs. Can anyone give some examples how to do it? Mention some apps, events and dialogs so we can test it. I will get new computer desk by the end of the week so i will be able to test more (atm i`m using it on floor :{ ).

Besides this, i must mention that many users like monsterwm (some of us like Cloudef and me think that monsterwm is the best in there) so i would like to suggest to write blog posts about it so we can share info in our native languages for desired audience. That way we can assemble nice list with a lot of resources smile

Let me start: http://www.lab21.net/tekstovi/monsterwm … ozora.html (it is in Serbian)

Offline

#791 2012-07-22 20:39:36

dnuux
Member
Registered: 2012-07-22
Posts: 17

Re: monsterwm! ~ yet another tiny wm

Fixed a bug where you couldn't click to focus the client that's currently focused in the other monitor

diff --git a/monsterwm.c b/monsterwm.c
index 3c4a1c7..52f4a78 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -268,9 +268,9 @@ void buttonpress(XEvent *e) {
     Bool w = wintoclient(e->xbutton.window, &c, &d, &m);
     if (m != &monitors[currmonidx]) for (cm = 0; cm < nmonitors && m != &monitors[cm]; cm++);
 
-    if (w && CLICK_TO_FOCUS && c != d->curr && e->xbutton.button == Button1) {
-        if (m != &monitors[currmonidx]) change_monitor(&(Arg){.i = cm});
-        focus(c, d, m);
+    if (w && CLICK_TO_FOCUS && e->xbutton.button == Button1) {
+        if (m != &monitors[currmonidx]) { change_monitor(&(Arg){.i = cm}); focus(c, d, m); }
+        else if (c != d->curr) focus(c, d, m);
     }
 
     for (unsigned int i = 0; i < LENGTH(buttons); i++)

Also I think I found two possible memory leaks and fixed them as well

diff --git a/monsterwm.c b/monsterwm.c
index 11b7c72..3c4a1c7 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -732,6 +732,7 @@ void killclient(void) {
     Atom *prot; int n = -1;
     if (XGetWMProtocols(dis, d->curr->win, &prot, &n))
         while(--n >= 0 && prot[n] != wmatoms[WM_DELETE_WINDOW]);
+    XFree(prot);
     if (n < 0) { XKillClient(dis, d->curr->win); removeclient(d->curr, d, m); }
     else deletewindow(d->curr->win);
 }
@@ -1086,6 +1087,7 @@ void setup(void) {
         for (unsigned int d = 0; d < DESKTOPS; d++)
             monitors[m].desktops[d] = (Desktop){ .mode = DEFAULT_MODE };
     }
+    XFree(info);
 
     /* init values for each monitor and desktop */
     for (unsigned int i = 0, m = init[0].m, d = init[0].d; i < LENGTH(init); i++, m = init[i].m, d = init[i].d) {

Last edited by dnuux (2012-07-22 20:49:29)

Offline

#792 2012-07-22 20:43:28

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: monsterwm! ~ yet another tiny wm

yes, monsterwm is the best tiling wm.

Offline

#793 2012-07-22 23:10:46

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

@dnuux thanks for the memory fixes wink
I dont use CLICK_TO_FOCUS myself, as it gives the great benefit that I can browse the web
or do stuff without losing the focus from my terminals tongue
the fix for that can be simpler, all you need to check is whether the client is not the current one
or if it is, if it is the current one on the current monitor, so

 
-    if (w && CLICK_TO_FOCUS && c != d->curr && e->xbutton.button == Button1) {
+    if (w && CLICK_TO_FOCUS && e->xbutton.button == Button1 && (c != d->curr || cm != currmonidx)) {

will push in a bit

-------

btw, I have added a debug rule on the makefile some time now, if one gets a crash or anything he can

$ make debug; set ulimit -c unlimited # and run that executable

on crash, core will be dumped and inspection can take place with

$ gdb -q /path/to/monsterwm/built/with/debug /path/to/core/file 
> bt full # full backtrace will probably show where the crash happened

Last edited by c00kiemon5ter (2012-07-23 00:49:43)


.:[ git me! ] :.

Offline

#794 2012-07-23 00:36:56

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

pushed and hopefully all will be good smile
I restructured client_to_desktop and client_to_monitor functions.
it will probably be simper to follow now and work as expected too.


.:[ git me! ] :.

Offline

#795 2012-07-23 12:20:31

dnuux
Member
Registered: 2012-07-22
Posts: 17

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

pushed and hopefully all will be good smile
I restructured client_to_desktop and client_to_monitor functions.
it will probably be simper to follow now and work as expected too.

Thanks, everything works now. smile Working beautifully on my FreeBSD box with clang too, aside from a couple of minor compilation warnings:

monsterwm.c:581:9: warning: add explicit braces to avoid dangling else [-Wdangling-else]
        else XUngrabButton(dis, Button1, modifiers[m], c->win);
        ^
monsterwm.c:668:30: warning: missing field 'y' initializer [-Wmissing-field-initializers]
    XWindowAttributes wa = {0};
                             ^
monsterwm.c:669:23: warning: missing field 'res_class' initializer [-Wmissing-field-initializers]
    XClassHint ch = {0};
                      ^

Offline

#796 2012-07-23 12:28:11

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

Yeah, seen those. The first one is really unneeded. The other two are probably GCCisms I should "fix".

There is one more bug. Some windows dont get fullscreen themselves,
but spawn a new window and make that fullscreen (eg set a youtube vid to fullscreen).
If you're focusing the other monitor of that that contains the browser,
the fullscreen window will spawn on the wrong monitor.
I'll see into that in a while.

--------

Also I'll be gone tomorrow night, and be back on August 4th (or sooner if I run out of cookies).
Just saying that, cause I wont have an internet connection probably (camping) and I wont be
able to respond or write code.


.:[ git me! ] :.

Offline

#797 2012-07-23 15:18:32

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

pushed a refix for the killclient XFree(prot) memory leak, and
fixed all of clangs warnings, along with the correcting the switches for debug on the makefile.
now that fullscreen issue I described above is still there. will try to fix it today.


.:[ git me! ] :.

Offline

#798 2012-07-23 17:32:27

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: monsterwm! ~ yet another tiny wm

Fixed a few typos:
http://ge.tt/15VJnNB/v/02


gh · da · ds

Offline

#799 2012-07-23 17:52:36

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

thanks, applied wink


.:[ git me! ] :.

Offline

#800 2012-07-23 18:51:31

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: monsterwm! ~ yet another tiny wm

Hi there,
Downloaded the initlayouts branch sources today. I modified configs by copying config.def.h to config.h.
But there is something I don't understand. I'm french and my keyboard layout is a bit strange (azerty).
I try to modify the keys for DESKTOPCHANGE as I do on dwm ( https://github.com/Ypnose/Madfiles/blob … frkey.diff ) but it doesn't work.
Even tried with xev, but it changes nothing.
Could you help me?

Last edited by Ypnose (2012-07-23 18:56:41)


Github -- My terminal font Envypn

Offline

Board footer

Powered by FluxBB