Hey,
i really like medit, it has everything i need from an editor except one thing: a consistent system for its window properties.
That is important to me because i use AwesomeWM, which in turn uses the Xorg window properties to be able to control and individualize the behavior every single window (e.g. floating, maximized, which workspace it spawns on, if its centered or if the focus should automatically switch to that window).
BUT that is only possible if the window can be uniquely identified without fail.
Sadly, medit is the only application i can't quite get under control with the AwesomeWM rules system and i that is because of it's partly missing window properties (roles, instances and maybe consistent names).
To clarify, a comparison of Firefox and medit:
Firefox has at least 2 unique properties for every window.
The main browser window:
WM_WINDOW_ROLE = "browser"
WM_CLASS(STRING) = "Navigator", "Firefox"
the download window:
WM_WINDOW_ROLE(STRING) = "Organizer"
WM_CLASS(STRING) = "Places", "Firefox"
Meanwhile, the properties for every medit window are:
WM_CLASS(STRING) = "medit", "medit"
Which, obviously, makes it hard to differentiate between medit windows with the AwesomeWM rules system (and maybe others, too, i wouldn't know).
Currently, i am using the window name property which is very inconsistent, for instance, the main medit window usually has a very long name: "medit - /path/to/foo.bar" while the find or replace window are simply called "Find" and "Replace" and the save/discard window has no name at all.
If its not too much trouble I would love it if you could use a more systematic naming system for medits Xorg window properties like the one used by Firefox. Even 1 unique property per window would suffice. My suggestion:
WM_CLASS(STRING) = "main", "medit"
WM_CLASS(STRING) = "find", "medit"
WM_CLASS(STRING) = "replace", "medit"
and so on.
Thanks for your hard work on this editor!
Please excuse the typos, I didn't realize there's no edit function ;)
Sounds reasonable, though it may be hard to implement for standard dialogs (Save/Load). Also, I have no idea how to test it, and I use windows most of the time.
Anyway, just WM_CLASS thing, right?
Yeah, basically.
From reading a couple of sources it might be as easy as adding something like the following for every init of the windows medit produces.
http://bpaste.net/show/151933/
And defining xdpy and xwin i guess. I would love to help but up to now I've just coded the occasional bash script.
From looking at the medit source code I wouldn't know where to begin. There seems to be no reference in the medit code to Xlib at all.
But I'll gladly volunteer to test any code you may conjur up ;)
Cheers
Last edit: mikar 2013-11-22