mirror of
https://github.com/davatorium/rofi.git
synced 2025-03-03 16:05:20 -05:00
Merge remote-tracking branch 'origin/master' into glib-loop
This commit is contained in:
commit
2cd8888d2c
6 changed files with 28 additions and 12 deletions
|
@ -6,6 +6,7 @@
|
||||||
- Fix basic tests on OpenBSD (#272)
|
- Fix basic tests on OpenBSD (#272)
|
||||||
- Fix wrong use of memcpy (thx to Jasperia).
|
- Fix wrong use of memcpy (thx to Jasperia).
|
||||||
- Work around for sigwaitinfo on OpenBSD.
|
- Work around for sigwaitinfo on OpenBSD.
|
||||||
|
- Ignore invalid (non-utf8) in dmenu mode.
|
||||||
|
|
||||||
0.15.12:
|
0.15.12:
|
||||||
New features:
|
New features:
|
||||||
|
|
|
@ -42,15 +42,15 @@ typedef struct
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
TB_AUTOHEIGHT = 1 << 0,
|
TB_AUTOHEIGHT = 1 << 0,
|
||||||
TB_AUTOWIDTH = 1 << 1,
|
TB_AUTOWIDTH = 1 << 1,
|
||||||
TB_LEFT = 1 << 16,
|
TB_LEFT = 1 << 16,
|
||||||
TB_RIGHT = 1 << 17,
|
TB_RIGHT = 1 << 17,
|
||||||
TB_CENTER = 1 << 18,
|
TB_CENTER = 1 << 18,
|
||||||
TB_EDITABLE = 1 << 19,
|
TB_EDITABLE = 1 << 19,
|
||||||
TB_MARKUP = 1 << 20,
|
TB_MARKUP = 1 << 20,
|
||||||
TB_WRAP = 1 << 21,
|
TB_WRAP = 1 << 21,
|
||||||
TB_PASSWORD = 1 << 22,
|
TB_PASSWORD = 1 << 22,
|
||||||
} TextboxFlags;
|
} TextboxFlags;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
@ -55,6 +55,7 @@ int window_get_cardinal_prop ( Display *display, Window w, Atom atom, unsigned l
|
||||||
X ( _NET_WM_WINDOW_TYPE_NORMAL ), \
|
X ( _NET_WM_WINDOW_TYPE_NORMAL ), \
|
||||||
X ( _NET_WM_STATE_FULLSCREEN ), \
|
X ( _NET_WM_STATE_FULLSCREEN ), \
|
||||||
X ( _NET_WM_DESKTOP ), \
|
X ( _NET_WM_DESKTOP ), \
|
||||||
|
X ( _NET_DESKTOP_VIEWPORT ), \
|
||||||
X ( CLIPBOARD ), \
|
X ( CLIPBOARD ), \
|
||||||
X ( UTF8_STRING ), \
|
X ( UTF8_STRING ), \
|
||||||
X ( _NET_WM_WINDOW_OPACITY )
|
X ( _NET_WM_WINDOW_OPACITY )
|
||||||
|
|
|
@ -89,8 +89,8 @@ static char **get_dmenu ( FILE *fd, unsigned int *length )
|
||||||
data[l - 1] = '\0';
|
data[l - 1] = '\0';
|
||||||
l--;
|
l--;
|
||||||
}
|
}
|
||||||
if ( ! g_utf8_validate ( data, l, NULL) ) {
|
if ( !g_utf8_validate ( data, l, NULL ) ) {
|
||||||
fprintf(stderr, "String: '%s' is not valid utf-8\n", data);
|
fprintf ( stderr, "String: '%s' is not valid utf-8\n", data );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ static void __textbox_update_pango_text ( textbox *tb )
|
||||||
pango_layout_set_attributes ( tb->layout, NULL );
|
pango_layout_set_attributes ( tb->layout, NULL );
|
||||||
pango_layout_set_text ( tb->layout, string, l );
|
pango_layout_set_text ( tb->layout, string, l );
|
||||||
}
|
}
|
||||||
else if ( tb->flags & TB_MARKUP || tb->tbft & MARKUP ) {
|
else if ( tb->flags & TB_MARKUP || tb->tbft & MARKUP ) {
|
||||||
pango_layout_set_markup ( tb->layout, tb->text, -1 );
|
pango_layout_set_markup ( tb->layout, tb->text, -1 );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -265,6 +265,20 @@ void monitor_active ( Display *display, workarea *mon )
|
||||||
}
|
}
|
||||||
fprintf ( stderr, "Failed to find selected monitor.\n" );
|
fprintf ( stderr, "Failed to find selected monitor.\n" );
|
||||||
}
|
}
|
||||||
|
// Get the current desktop.
|
||||||
|
unsigned long current_desktop = 0;
|
||||||
|
if ( window_get_cardinal_prop ( display, root, netatoms[_NET_CURRENT_DESKTOP], ¤t_desktop, 1 ) ) {
|
||||||
|
unsigned long desktops = 0;
|
||||||
|
if ( window_get_cardinal_prop ( display, root, netatoms[_NET_NUMBER_OF_DESKTOPS], &desktops, 1 ) ) {
|
||||||
|
unsigned long deskg[desktops * 2];
|
||||||
|
if ( window_get_cardinal_prop ( display, root, netatoms[_NET_DESKTOP_VIEWPORT], &deskg[0], desktops * 2 ) ) {
|
||||||
|
if ( current_desktop < desktops ) {
|
||||||
|
monitor_dimensions ( display, screen, deskg[current_desktop * 2], deskg[current_desktop * 2 + 1], mon );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( window_get_prop ( display, root, netatoms[_NET_ACTIVE_WINDOW], &type, &count, &id, sizeof ( Window ) )
|
if ( window_get_prop ( display, root, netatoms[_NET_ACTIVE_WINDOW], &type, &count, &id, sizeof ( Window ) )
|
||||||
&& type == XA_WINDOW && count > 0 ) {
|
&& type == XA_WINDOW && count > 0 ) {
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue