Bug 697634 - glfwSetWindowTitle and identifying X11 window
Summary: glfwSetWindowTitle and identifying X11 window
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: apps (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: muPDF bugs
QA Contact: Bug traffic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-01 16:12 UTC by tuncerayaz
Modified: 2017-03-19 16:10 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
[PATCH] gl: use fix title for X11 class and instance (1.31 KB, patch)
2017-03-01 21:22 UTC, tuncerayaz
Details | Diff
[PATCH] gl: use fix title for X11 class and instance (1.28 KB, patch)
2017-03-04 15:02 UTC, tuncerayaz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tuncerayaz 2017-03-01 16:12:23 UTC
Since glfwSetWindowTitle in X11 context seems to set class, title, and instance to the same string, and given that the title will be the filename followed by the page number, it's impossible to match any of the three X11 window properties for applying a rule. Also, GLFW doesn't seem to provide platform specific APIs that would allow one to set the X11 window class to a different string than the dynamic title.

One possible solution would be to always prefix it with the default/initial title "MuPDF/GL". This could work with matchers able to check for a substring or prefix, but will fail with those that do a whole string match. If we were to implement this, what should the length > 50 case in update_title() do?

Another solution would be to implement a flag to not update the title at all, which if it's deemed fine to include, is easier to implement.
Comment 1 tuncerayaz 2017-03-01 21:20:10 UTC
Actually, there's a bug in gl-main.c where filename is used as the title when creating the window and not "MuPDF/GL". I'll upload a patch to fix that.
Comment 2 tuncerayaz 2017-03-01 21:22:27 UTC
Created attachment 13446 [details]
[PATCH] gl: use fix title for X11 class and instance
Comment 3 tuncerayaz 2017-03-04 15:02:03 UTC
Created attachment 13456 [details]
[PATCH] gl: use fix title for X11 class and instance