diff options
| -rw-r--r-- | CHANGELOG.md | 7 | ||||
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | images/sxwm_logo.png | bin | 119090 -> 307682 bytes | |||
| -rw-r--r-- | src/sxwm.c | 33 |
4 files changed, 35 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d7461..7374c74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ All notable changes to this project will be documented in this file. -#### v1.6 (git) +#### v1.7 (git) +- **FIX**: Resizing bug on second monitor + +#### v1.6 (current) - **NEW**: True multi-monitor support - **NEW**: Vertical stack resizing - **NEW**: Mouse warping @@ -33,7 +36,7 @@ All notable changes to this project will be documented in this file. - **FIXED**: Undefined behaviour in `parse_col` - **FIXED**: Added monitor switching functions to call_table (#95) -#### v1.5 (current) +#### v1.5 - **NEW**: Using XCursor instead of cursor font && new logo. - **CHANGE**: No longer using INIT_WORKSPACE macro, proper workspace handling. New sxwmrc - **FIXED**: Proper bind resetting on refresh config. && Multi-arg binds now work due to new and improved spawn function @@ -181,7 +181,7 @@ workspace : mod + shift + 5 : swap 5 | `MOD` + `=` / `-` | Increase / decrease gaps | | `MOD` + `Space` | Toggle floating | | `MOD` + `Shift` + `Space` | Toggle all floating | -| `MOD` + `Shift` + `f` | Toggle fullscreen mode | +| `MOD` + `Shift` + `f` | Toggle fullscreen for focused window | | `MOD` + `Shift` + `q` | Close focused window | | `MOD` + `Shift` + `e` | Quit sxwm | | `MOD` + `r` | Reload configuration | @@ -306,6 +306,12 @@ yay -S sxwm yay -S sxwm-git ``` +### Void Linux + +```sh +sudo xbps-install -S sxwm +``` + ### Build from Source ```sh diff --git a/images/sxwm_logo.png b/images/sxwm_logo.png Binary files differindex 76375c2..dd2380b 100644 --- a/images/sxwm_logo.png +++ b/images/sxwm_logo.png @@ -1301,6 +1301,17 @@ void hdl_motion(XEvent *xev) } last_motion_time = e->time; + /* figure out which monitor the pointer is in right now */ + int mon = 0; + for (int i = 0; i < monsn; i++) { + if (e->x_root >= mons[i].x && e->x_root < mons[i].x + mons[i].w && e->y_root >= mons[i].y && + e->y_root < mons[i].y + mons[i].h) { + mon = i; + break; + } + } + Monitor *m = &mons[mon]; + if (drag_mode == DRAG_SWAP) { Window root_ret, child; int rx, ry, wx, wy; @@ -1335,7 +1346,6 @@ void hdl_motion(XEvent *xev) swap_target = new_target; return; } - else if (drag_mode == DRAG_MOVE) { int dx = e->x_root - drag_start_x; int dy = e->y_root - drag_start_y; @@ -1345,8 +1355,15 @@ void hdl_motion(XEvent *xev) int outer_w = drag_client->w + 2 * user_config.border_width; int outer_h = drag_client->h + 2 * user_config.border_width; - nx = snap_coordinate(nx, outer_w, scr_width, user_config.snap_distance); - ny = snap_coordinate(ny, outer_h, scr_height, user_config.snap_distance); + /* snap relative to this mons bounds: */ + int rel_x = nx - m->x; + int rel_y = ny - m->y; + + rel_x = snap_coordinate(rel_x, outer_w, m->w, user_config.snap_distance); + rel_y = snap_coordinate(rel_y, outer_h, m->h, user_config.snap_distance); + + nx = m->x + rel_x; + ny = m->y + rel_y; if (!drag_client->floating && (UDIST(nx, drag_client->x) > user_config.snap_distance || UDIST(ny, drag_client->y) > user_config.snap_distance)) { @@ -1357,15 +1374,15 @@ void hdl_motion(XEvent *xev) drag_client->x = nx; drag_client->y = ny; } - else if (drag_mode == DRAG_RESIZE) { int dx = e->x_root - drag_start_x; int dy = e->y_root - drag_start_y; int nw = drag_orig_w + dx; int nh = drag_orig_h + dy; - int max_w = scr_width - drag_client->x; - int max_h = scr_height - drag_client->y; + /* clamp relative to this mon */ + int max_w = (m->w - (drag_client->x - m->x)); + int max_h = (m->h - (drag_client->y - m->y)); drag_client->w = CLAMP(nw, MIN_WINDOW_SIZE, max_w); drag_client->h = CLAMP(nh, MIN_WINDOW_SIZE, max_h); @@ -2231,10 +2248,6 @@ void spawn(const char **argv) } for (int i = 0; i < cmd_count; i++) { - wait(NULL); - } - - for (int i = 0; i < cmd_count; i++) { free(commands[i]); } free(commands); |
