Skip to content

Commit 3bec3fa

Browse files
committed
Wayland: remove some dead code
Found with Codacy https://app.codacy.com/gh/davatorium/rofi/pull-requests/2099
1 parent 183b0b5 commit 3bec3fa

File tree

4 files changed

+0
-76
lines changed

4 files changed

+0
-76
lines changed

include/xcb.h

-12
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,6 @@ extern const char *netatom_names[];
9898
/** atoms */
9999
extern xcb_atom_t netatoms[NUM_NETATOMS];
100100

101-
/**
102-
* @param w rofis window
103-
*
104-
* Stores old input focus for reverting and set focus to rofi.
105-
*/
106-
void rofi_xcb_set_input_focus(xcb_window_t w);
107-
108-
/**
109-
* IF set, revert the focus back to the original applications.
110-
*/
111-
void rofi_xcb_revert_input_focus(void);
112-
113101
/**
114102
* Depth of visual
115103
*/

source/wayland/display.c

-2
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,6 @@ static void wayland_frame_callback(void *data, struct wl_callback *callback,
341341
static void wayland_keyboard_keymap(void *data, struct wl_keyboard *keyboard,
342342
enum wl_keyboard_keymap_format format,
343343
int32_t fd, uint32_t size) {
344-
wayland_seat *self = data;
345-
346344
if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
347345
close(fd);
348346
return;

source/wayland/view.c

-29
Original file line numberDiff line numberDiff line change
@@ -215,35 +215,6 @@ static void wayland_rofi_view_queue_redraw(void) {
215215
}
216216
}
217217

218-
/**
219-
* Thread state for workers started for the view.
220-
*/
221-
typedef struct _thread_state_view {
222-
/** Generic thread state. */
223-
thread_state st;
224-
225-
/** Condition. */
226-
GCond *cond;
227-
/** Lock for condition. */
228-
GMutex *mutex;
229-
/** Count that is protected by lock. */
230-
unsigned int *acount;
231-
232-
/** Current state. */
233-
RofiViewState *state;
234-
/** Start row for this worker. */
235-
unsigned int start;
236-
/** Stop row for this worker. */
237-
unsigned int stop;
238-
/** Rows processed. */
239-
unsigned int count;
240-
241-
/** Pattern input to filter. */
242-
const char *pattern;
243-
/** Length of pattern. */
244-
glong plen;
245-
} thread_state_view;
246-
247218
static void wayland___create_window(MenuFlags menu_flags) {
248219
input_history_initialize();
249220

source/xcb/display.c

-33
Original file line numberDiff line numberDiff line change
@@ -1491,39 +1491,6 @@ static gboolean main_loop_x11_event_handler(xcb_generic_event_t *ev,
14911491
return G_SOURCE_CONTINUE;
14921492
}
14931493

1494-
void rofi_xcb_set_input_focus(xcb_window_t w) {
1495-
if (config.steal_focus != TRUE) {
1496-
xcb->focus_revert = 0;
1497-
return;
1498-
}
1499-
xcb_generic_error_t *error;
1500-
xcb_get_input_focus_reply_t *freply;
1501-
xcb_get_input_focus_cookie_t fcookie = xcb_get_input_focus(xcb->connection);
1502-
freply = xcb_get_input_focus_reply(xcb->connection, fcookie, &error);
1503-
if (error != NULL) {
1504-
g_warning("Could not get input focus (error %d), will revert focus to best "
1505-
"effort",
1506-
error->error_code);
1507-
free(error);
1508-
xcb->focus_revert = 0;
1509-
} else {
1510-
xcb->focus_revert = freply->focus;
1511-
}
1512-
xcb_set_input_focus(xcb->connection, XCB_INPUT_FOCUS_POINTER_ROOT, w,
1513-
XCB_CURRENT_TIME);
1514-
xcb_flush(xcb->connection);
1515-
}
1516-
1517-
void rofi_xcb_revert_input_focus(void) {
1518-
if (xcb->focus_revert == 0) {
1519-
return;
1520-
}
1521-
1522-
xcb_set_input_focus(xcb->connection, XCB_INPUT_FOCUS_POINTER_ROOT,
1523-
xcb->focus_revert, XCB_CURRENT_TIME);
1524-
xcb_flush(xcb->connection);
1525-
}
1526-
15271494
static int take_pointer(xcb_window_t w, int iters) {
15281495
int i = 0;
15291496
while (TRUE) {

0 commit comments

Comments
 (0)