[win] Fix wsl2 menu display issues#22453
Conversation
|
You changing implementation of GTK has other way to specify that: And Cocoa does not use it at all - but method So maybe just provide |
Sure, I can make the changes for Windows only. Does it create any side effects on Linux and/or MacOS? |
I do not know. But seems to be approach you apply should be use only with X11 and GTK. |
OK, well, that will make it more complicated, but I'll check how I can do it |
Test Results 22 files 22 suites 3d 9h 11m 49s ⏱️ For more details on these failures, see this check. Results for commit 8d61fa7. |
|
@linev BTW, that has nothing to do with GTK, it's pure X11 code, not Windows at all! And I'm not sure if can detect when the code is running in WSL... |
Yes, but you are using I am fine if you are sure that such changes has no side effects. |
|
|
||
| XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type, | ||
| 8, PropModeReplace, data, len); | ||
| 32, PropModeReplace, data, len); |
There was a problem hiding this comment.
I mean this change. You declare data as array of 32-bit values - but before it was array of 8-bit values.
Any call to gVirtualX->ChangeProperty() with len > 1 will definitely get a problems because of this change
There was a problem hiding this comment.
Exactly this is happens in TGTextView and TGTextEntry - there characters arrays are supplied.
There was a problem hiding this comment.
Nope. 32 is the format and according to the doc (https://tronche.com/gui/x/xlib/window-information/XChangeProperty.html) :
format : Specifies whether the data should be viewed as a list of 8-bit, 16-bit, or 32-bit quantities. Possible values are 8, 16, and 32.
Nothing to do with the length. Or did I miss something?
There was a problem hiding this comment.
length is not changed - it provided from outside.
But it defines how many elements are in the data array.
And argument 8 says that data should be interpreted as 8-bit integer.
There was a problem hiding this comment.
So now what? I can only detect it we run in WSL at run time...
There was a problem hiding this comment.
As I proposed - one introduce TVirtualX::SetWindowHintTooltip(wid) method and implements it in TGX11 and TGWin32.
In the TGX11 implementation one can directly use XChangeProperty function with any required arguments.
And in TGWin32 one can use gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_TOOLTIP)
There was a problem hiding this comment.
I don't care about gdk and TGWin32! This is pure X11 code on Linux only
There was a problem hiding this comment.
Then just keep implementation empty for them.
Fixes #17483