Bugfix: Set focus when table was shrinked and CUR_CELL might have been shrinked
This commit is contained in:
parent
e4b637b67b
commit
d8a6f41e39
|
@ -10,6 +10,8 @@
|
||||||
*/
|
*/
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
|
|
||||||
#ifndef _TABLE_H
|
#ifndef _TABLE_H
|
||||||
|
@ -27,6 +29,6 @@ void init_table();
|
||||||
void expand_table_rows(Workspace *workspace);
|
void expand_table_rows(Workspace *workspace);
|
||||||
void expand_table_cols(Workspace *workspace);
|
void expand_table_cols(Workspace *workspace);
|
||||||
bool cell_exists(int col, int row);
|
bool cell_exists(int col, int row);
|
||||||
void cleanup_table(Workspace *workspace);
|
void cleanup_table(xcb_connection_t *conn, Workspace *workspace);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -176,7 +176,7 @@ static void move_current_window(xcb_connection_t *connection, direction_t direct
|
||||||
new->currently_focused = current_client;
|
new->currently_focused = current_client;
|
||||||
|
|
||||||
/* delete all empty columns/rows */
|
/* delete all empty columns/rows */
|
||||||
cleanup_table(container->workspace);
|
cleanup_table(connection, container->workspace);
|
||||||
render_layout(connection);
|
render_layout(connection);
|
||||||
|
|
||||||
set_focus(connection, current_client);
|
set_focus(connection, current_client);
|
||||||
|
|
|
@ -359,7 +359,7 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_
|
||||||
xcb_flush(c);
|
xcb_flush(c);
|
||||||
table_remove(byParent, client->frame);
|
table_remove(byParent, client->frame);
|
||||||
|
|
||||||
cleanup_table(client->container->workspace);
|
cleanup_table(c, client->container->workspace);
|
||||||
|
|
||||||
free(client);
|
free(client);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "table.h"
|
#include "table.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
int current_workspace = 0;
|
int current_workspace = 0;
|
||||||
Workspace workspaces[10];
|
Workspace workspaces[10];
|
||||||
|
@ -128,7 +129,7 @@ static void move_rows_from(Workspace *workspace, int rows) {
|
||||||
* Shrinks the table by "compacting" it, that is, removing completely empty rows/columns
|
* Shrinks the table by "compacting" it, that is, removing completely empty rows/columns
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void cleanup_table(Workspace *workspace) {
|
void cleanup_table(xcb_connection_t *conn, Workspace *workspace) {
|
||||||
/* Check for empty columns */
|
/* Check for empty columns */
|
||||||
for (int cols = 0; cols < workspace->cols;) {
|
for (int cols = 0; cols < workspace->cols;) {
|
||||||
bool completely_empty = true;
|
bool completely_empty = true;
|
||||||
|
@ -167,4 +168,7 @@ void cleanup_table(Workspace *workspace) {
|
||||||
|
|
||||||
if (current_row >= c_ws->rows)
|
if (current_row >= c_ws->rows)
|
||||||
current_row = c_ws->rows-1;
|
current_row = c_ws->rows-1;
|
||||||
|
|
||||||
|
if (CUR_CELL->currently_focused != NULL)
|
||||||
|
set_focus(conn, CUR_CELL->currently_focused);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue