You are not logged in.
Nice work! 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 I will look into this in a moment
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.
Oh and I don't think this will work without modifying the tile function.
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
If you have a floating window and try to move it, even if the pointer is in another screen, it works!
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
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. 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
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. 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 ?
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 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
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
Offline
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?
Offline
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..
Also one more question: Is it a bug or a design decision to not move the client to another screen when dragged there?
floating clients should be able to move to any monitor.
.:[ git me! ] :.
Offline
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.
kinda works monitors with different sizes might have the floating window end up in between the monitors.
Awesome, thanks for your help!
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
Thanks
Last edited by dnuux (2012-07-22 15:47:08)
Offline
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
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
I updated the readme and pushed that, so we'll do the invert
If people dont like having their fullscreen and floating clients reset when moved to another desktop speak up
.:[ git me! ] :.
Offline
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!
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
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
Let me start: http://www.lab21.net/tekstovi/monsterwm … ozora.html (it is in Serbian)
Offline
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
yes, monsterwm is the best tiling wm.
Offline
@dnuux thanks for the memory fixes
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
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
pushed and hopefully all will be good
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
pushed and hopefully all will be good
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. 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
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
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
Offline
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)
Offline