mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
[1566] Extra debug for monitor resolving for m=-1.
This commit is contained in:
parent
5543e6497f
commit
f5eafcc04c
2 changed files with 16 additions and 4 deletions
|
@ -1707,12 +1707,12 @@ static WidgetTriggerActionResult textbox_button_trigger_action(
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case MOUSE_CLICK_DOWN: {
|
case MOUSE_CLICK_DOWN: {
|
||||||
const char *type = rofi_theme_get_string(wid, "action", NULL);
|
const char *type = rofi_theme_get_string(wid, "action", NULL);
|
||||||
if (type ) {
|
if (type) {
|
||||||
if ( state->list_view) {
|
if (state->list_view) {
|
||||||
(state->selected_line) =
|
(state->selected_line) =
|
||||||
state->line_map[listview_get_selected(state->list_view)];
|
state->line_map[listview_get_selected(state->list_view)];
|
||||||
} else {
|
} else {
|
||||||
(state->selected_line) = UINT32_MAX;
|
(state->selected_line) = UINT32_MAX;
|
||||||
}
|
}
|
||||||
guint id = key_binding_get_action_from_name(type);
|
guint id = key_binding_get_action_from_name(type);
|
||||||
if (id != UINT32_MAX) {
|
if (id != UINT32_MAX) {
|
||||||
|
|
12
source/xcb.c
12
source/xcb.c
|
@ -880,6 +880,7 @@ static int monitor_active_from_id_focused(int mon_id, workarea *mon) {
|
||||||
static int monitor_active_from_id(int mon_id, workarea *mon) {
|
static int monitor_active_from_id(int mon_id, workarea *mon) {
|
||||||
xcb_window_t root = xcb->screen->root;
|
xcb_window_t root = xcb->screen->root;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
g_debug("Monitor id: %d", mon_id);
|
||||||
// At mouse position.
|
// At mouse position.
|
||||||
if (mon_id == -3) {
|
if (mon_id == -3) {
|
||||||
if (pointer_get(root, &x, &y)) {
|
if (pointer_get(root, &x, &y)) {
|
||||||
|
@ -891,19 +892,27 @@ static int monitor_active_from_id(int mon_id, workarea *mon) {
|
||||||
}
|
}
|
||||||
// Focused monitor
|
// Focused monitor
|
||||||
else if (mon_id == -1) {
|
else if (mon_id == -1) {
|
||||||
|
g_debug("rofi on current monitor");
|
||||||
// Get the current desktop.
|
// Get the current desktop.
|
||||||
unsigned int current_desktop = 0;
|
unsigned int current_desktop = 0;
|
||||||
xcb_get_property_cookie_t gcdc;
|
xcb_get_property_cookie_t gcdc;
|
||||||
gcdc = xcb_ewmh_get_current_desktop(&xcb->ewmh, xcb->screen_nbr);
|
gcdc = xcb_ewmh_get_current_desktop(&xcb->ewmh, xcb->screen_nbr);
|
||||||
if (xcb_ewmh_get_current_desktop_reply(&xcb->ewmh, gcdc, ¤t_desktop,
|
if (xcb_ewmh_get_current_desktop_reply(&xcb->ewmh, gcdc, ¤t_desktop,
|
||||||
NULL)) {
|
NULL)) {
|
||||||
|
g_debug("Found current desktop: %u", current_desktop);
|
||||||
xcb_get_property_cookie_t c =
|
xcb_get_property_cookie_t c =
|
||||||
xcb_ewmh_get_desktop_viewport(&xcb->ewmh, xcb->screen_nbr);
|
xcb_ewmh_get_desktop_viewport(&xcb->ewmh, xcb->screen_nbr);
|
||||||
xcb_ewmh_get_desktop_viewport_reply_t vp;
|
xcb_ewmh_get_desktop_viewport_reply_t vp;
|
||||||
if (xcb_ewmh_get_desktop_viewport_reply(&xcb->ewmh, c, &vp, NULL)) {
|
if (xcb_ewmh_get_desktop_viewport_reply(&xcb->ewmh, c, &vp, NULL)) {
|
||||||
|
g_debug("Found %d number of desktops", vp.desktop_viewport_len);
|
||||||
if (current_desktop < vp.desktop_viewport_len) {
|
if (current_desktop < vp.desktop_viewport_len) {
|
||||||
|
g_debug("Found viewport for desktop: %d %d",
|
||||||
|
vp.desktop_viewport[current_desktop].x,
|
||||||
|
vp.desktop_viewport[current_desktop].y);
|
||||||
monitor_dimensions(vp.desktop_viewport[current_desktop].x,
|
monitor_dimensions(vp.desktop_viewport[current_desktop].x,
|
||||||
vp.desktop_viewport[current_desktop].y, mon);
|
vp.desktop_viewport[current_desktop].y, mon);
|
||||||
|
g_debug("Found monitor @: %d %d %dx%d", mon->x, mon->y, mon->w,
|
||||||
|
mon->h);
|
||||||
xcb_ewmh_get_desktop_viewport_reply_wipe(&vp);
|
xcb_ewmh_get_desktop_viewport_reply_wipe(&vp);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -946,6 +955,7 @@ workarea mon_cache = {
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
int monitor_active(workarea *mon) {
|
int monitor_active(workarea *mon) {
|
||||||
|
g_debug("Monitor active");
|
||||||
if (mon_set) {
|
if (mon_set) {
|
||||||
if (mon) {
|
if (mon) {
|
||||||
*mon = mon_cache;
|
*mon = mon_cache;
|
||||||
|
@ -953,6 +963,7 @@ int monitor_active(workarea *mon) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.monitor != NULL) {
|
if (config.monitor != NULL) {
|
||||||
|
g_debug("Monitor lookup by name : %s", config.monitor);
|
||||||
for (workarea *iter = xcb->monitors; iter; iter = iter->next) {
|
for (workarea *iter = xcb->monitors; iter; iter = iter->next) {
|
||||||
if (g_strcmp0(config.monitor, iter->name) == 0) {
|
if (g_strcmp0(config.monitor, iter->name) == 0) {
|
||||||
*mon = *iter;
|
*mon = *iter;
|
||||||
|
@ -962,6 +973,7 @@ int monitor_active(workarea *mon) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
g_debug("Monitor lookup by name failed: %s", config.monitor);
|
||||||
// Grab primary.
|
// Grab primary.
|
||||||
if (g_strcmp0(config.monitor, "primary") == 0) {
|
if (g_strcmp0(config.monitor, "primary") == 0) {
|
||||||
for (workarea *iter = xcb->monitors; iter; iter = iter->next) {
|
for (workarea *iter = xcb->monitors; iter; iter = iter->next) {
|
||||||
|
|
Loading…
Reference in a new issue