-
Notifications
You must be signed in to change notification settings - Fork 625
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
Implement pango markup for -window-format #1288
Conversation
Since g_markup_escape_text doesn't like null it seems
To bring it more in line with surrounding code
Alright, I believe I've fixed those issues now. Is it also an issue with https://github.com/davatorium/rofi/pull/1288/files#diff-27b5f68bbbead2a38c679b28a0c8ba5e25ec8e81abd02fcd4f77012833f07f77R353 and https://github.com/davatorium/rofi/pull/1288/files#diff-27b5f68bbbead2a38c679b28a0c8ba5e25ec8e81abd02fcd4f77012833f07f77R355 or are those fine? |
} | ||
c->title = g_markup_escape_text ( tmp_title, -1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. is it possible to tmp_title to still be NULL here? Should it maybe be tmp_title ? tmp_title : ""
?
FYI, been busy, will get back to reviewing this soon. |
Oh yea, that's totally okay, i understand :3 |
source/dialogs/window.c
Outdated
|
||
cky = xcb_icccm_get_wm_class ( xcb->connection, c->window ); | ||
xcb_icccm_get_wm_class_reply_t wcr; | ||
if ( xcb_icccm_get_wm_class_reply ( xcb->connection, cky, &wcr, NULL ) ) { | ||
c->class = rofi_latin_to_utf8_strdup ( wcr.class_name, -1 ); | ||
c->class = g_markup_escape_text( c->class, -1 ); | ||
c->name = rofi_latin_to_utf8_strdup ( wcr.instance_name, -1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leaks memory. (c->class). confirmed with valgrind.
source/dialogs/window.c
Outdated
c->name = rofi_latin_to_utf8_strdup ( wcr.instance_name, -1 ); | ||
c->name = g_markup_escape_text( c->name, -1 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
Oh wow I had no idea valgrind was a thing, that could've come in handy earlier 😅. |
Codecov Report
@@ Coverage Diff @@
## next #1288 +/- ##
==========================================
+ Coverage 32.94% 33.00% +0.05%
==========================================
Files 42 42
Lines 11946 12038 +92
==========================================
+ Hits 3936 3973 +37
- Misses 8010 8065 +55
Continue to review full report at Codecov.
|
thanks. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR implements pango markup for -window-format as requested in issue #1287 (see that issue for how to use).
As discussed in IRC, i believe I've done stuff mostly correct, but there might very well be some memory leaks and other issues, since I've never really worked with C and most of what I've done is guesswork...