Bugfix: Reconfigure bar window when changing resolutions (Thanks Mirko)

This commit is contained in:
Michael Stapelberg 2009-05-03 22:59:50 +02:00
parent c3c05db579
commit 4a6a748561
2 changed files with 22 additions and 0 deletions

View File

@ -163,6 +163,11 @@ static void query_screens(xcb_connection_t *conn, struct screens_head *screenlis
} }
free(reply); free(reply);
if (num_screens == 0) {
LOG("No screens found. This is weird.\n");
exit(1);
}
} }
static void initialize_screen(xcb_connection_t *conn, i3Screen *screen, Workspace *workspace) { static void initialize_screen(xcb_connection_t *conn, i3Screen *screen, Workspace *workspace) {
@ -232,6 +237,8 @@ void initialize_xinerama(xcb_connection_t *conn) {
* *
*/ */
void xinerama_requery_screens(xcb_connection_t *conn) { void xinerama_requery_screens(xcb_connection_t *conn) {
i3Font *font = load_font(conn, config.font);
/* POSSIBLE PROBLEM: Is the order of the Xinerama screens always constant? That is, can /* POSSIBLE PROBLEM: Is the order of the Xinerama screens always constant? That is, can
it change when I move the --right-of video projector to --left-of? */ it change when I move the --right-of video projector to --left-of? */
@ -267,6 +274,16 @@ void xinerama_requery_screens(xcb_connection_t *conn) {
screen->bar = workspaces[c].screen->bar; screen->bar = workspaces[c].screen->bar;
screen->bargc = workspaces[c].screen->bargc; screen->bargc = workspaces[c].screen->bargc;
Rect bar_rect = {screen->rect.x,
screen->rect.height - (font->height + 6),
screen->rect.x + screen->rect.width,
font->height + 6};
xcb_configure_window(conn, screen->bar, XCB_CONFIG_WINDOW_X |
XCB_CONFIG_WINDOW_Y |
XCB_CONFIG_WINDOW_WIDTH |
XCB_CONFIG_WINDOW_HEIGHT, &(bar_rect.x));
/* Copy the list head for the dock clients */ /* Copy the list head for the dock clients */
screen->dock_clients = workspaces[c].screen->dock_clients; screen->dock_clients = workspaces[c].screen->dock_clients;

View File

@ -88,6 +88,11 @@ li {
</p> </p>
<ul> <ul>
<li>
<a href="/downloads/i3-3.a-bf2.tar.bz2">i3-3.a-bf2.tar.bz2</a>
(<a href="/downloads/i3-3.a-bf2.tar.bz2.asc">GPG signature</a>), Version 3.α-bf2, 65 KiB, 2009-05-03,
hotfix for a problem with -bf1
</li>
<li> <li>
<a href="/downloads/i3-3.a-bf1.tar.bz2">i3-3.a-bf1.tar.bz2</a> <a href="/downloads/i3-3.a-bf1.tar.bz2">i3-3.a-bf1.tar.bz2</a>
(<a href="/downloads/i3-3.a-bf1.tar.bz2.asc">GPG signature</a>), Version 3.α-bf1, 65 KiB, 2009-05-03, (<a href="/downloads/i3-3.a-bf1.tar.bz2.asc">GPG signature</a>), Version 3.α-bf1, 65 KiB, 2009-05-03,