Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate various enhancements from the Net #2

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix -E get-title to work with utf8/_NET_WM_NAME correctly
  • Loading branch information
dan corson authored and kfogel committed Sep 9, 2018
commit aec57b57f0d2694e1e0a317d874a6dc6883db430
16 changes: 8 additions & 8 deletions main.c
Original file line number Diff line number Diff line change
@@ -874,9 +874,14 @@ static int window_move_resize (Display *disp, Window win, char *arg) {/*{{{*/
}
}/*}}}*/

static int action_window (Display *disp, Window win, char mode) {/*{{{*/
XTextProperty text_prop_return;
static int window_say_title (Display *disp, Window win) {
gchar *title_utf8 = get_window_title(disp, win);
printf("%s\n", title_utf8);
g_free(title_utf8);
return EXIT_SUCCESS;
}

static int action_window (Display *disp, Window win, char mode) {/*{{{*/
p_verbose("Using window: 0x%.8lx\n", win);
switch (mode) {
case 'a':
@@ -916,12 +921,7 @@ static int action_window (Display *disp, Window win, char mode) {/*{{{*/
// iconify
return XLowerWindow(disp, win);
case 'E':
// say title
// FIXME: why isn't XSetWMName used for the other title stuff in
// wmctrl?
XGetWMName(disp, win, &text_prop_return);
printf("%s\n", text_prop_return.value);
return EXIT_SUCCESS;
return window_say_title(disp, win);

default:
fprintf(stderr, "Unknown action: '%c'\n", mode);