Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graf2d/x11/src/GX11Gui.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@ void TGX11::ChangeProperty(Window_t id, Atom_t property, Atom_t type,
if (!id) return;

XChangeProperty((Display*)fDisplay, (Window) id, (Atom) property, (Atom) type,
8, PropModeReplace, data, len);
32, PropModeReplace, data, len);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly this is happens in TGTextView and TGTextEntry - there characters arrays are supplied.

@bellenot bellenot Jun 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now what? I can only detect it we run in WSL at run time...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't care about gdk and TGWin32! This is pure X11 code on Linux only

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then just keep implementation empty for them.

}

////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 4 additions & 0 deletions gui/ged/src/TGedPatternSelect.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ TGedPopup::TGedPopup(const TGWindow *p, const TGWindow *m, UInt_t w, UInt_t h,
wattr.fSaveUnder = kTRUE;
gVirtualX->ChangeWindowAttributes(fId, &wattr);

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_TOOLTIP", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

AddInput(kStructureNotifyMask);
}

Expand Down
4 changes: 4 additions & 0 deletions gui/gui/src/TGColorSelect.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ TGColorPopup::TGColorPopup(const TGWindow *p, const TGWindow *m, Pixel_t color)
//wattr.fSaveUnder = kTRUE;
gVirtualX->ChangeWindowAttributes(fId, &wattr);

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_TOOLTIP", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

AddInput(kStructureNotifyMask);

fActive = -1;
Expand Down
4 changes: 4 additions & 0 deletions gui/gui/src/TGComboBox.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ TGComboBoxPopup::TGComboBoxPopup(const TGWindow *p, UInt_t w, UInt_t h,
wattr.fBorderWidth = 1;
gVirtualX->ChangeWindowAttributes(fId, &wattr);

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_COMBO", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

AddInput(kStructureNotifyMask);
fEditDisabled = kEditDisable | kEditDisableGrab | kEditDisableBtnEnable;
SetWindowName();
Expand Down
4 changes: 4 additions & 0 deletions gui/gui/src/TGMenu.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,10 @@ TGPopupMenu::TGPopupMenu(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options)

gVirtualX->ChangeWindowAttributes(fId, &wattr);

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_POPUP_MENU", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

AddInput(kPointerMotionMask | kEnterWindowMask | kLeaveWindowMask);
}

Expand Down
16 changes: 16 additions & 0 deletions gui/gui/src/TGToolTip.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ TGToolTip::TGToolTip(const TGWindow *p, const TGFrame *f, const char *text,
gVirtualX->ChangeWindowAttributes(fId, &attr);
SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_TOOLTIP", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

fLabel = new TGLabel(this, text);
fLabel->SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());
fLabel->SetTextColor(fClient->GetResourcePool()->GetTipFgndColor());
Expand Down Expand Up @@ -124,6 +128,10 @@ TGToolTip::TGToolTip(const TGWindow *p, const TBox *box, const char *text,
gVirtualX->ChangeWindowAttributes(fId, &attr);
SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_TOOLTIP", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

fLabel = new TGLabel(this, text);
fLabel->SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());
fLabel->SetTextColor(fClient->GetResourcePool()->GetTipFgndColor());
Expand Down Expand Up @@ -157,6 +165,10 @@ TGToolTip::TGToolTip(const TBox *box, const char *text,Long_t delayms)
gVirtualX->ChangeWindowAttributes(fId, &attr);
SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_TOOLTIP", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

fLabel = new TGLabel(this, text);
fLabel->SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());
fLabel->SetTextColor(fClient->GetResourcePool()->GetTipFgndColor());
Expand Down Expand Up @@ -188,6 +200,10 @@ TGToolTip::TGToolTip(Int_t x, Int_t y, const char *text, Long_t delayms)
gVirtualX->ChangeWindowAttributes(fId, &attr);
SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());

Atom_t property_type = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE", kFALSE);
Atom_t property_value = gVirtualX->InternAtom("_NET_WM_WINDOW_TYPE_TOOLTIP", kFALSE);
gVirtualX->ChangeProperty(fId, property_type, 4, (UChar_t*)&property_value, 1);

fLabel = new TGLabel(this, text);
fLabel->SetBackgroundColor(fClient->GetResourcePool()->GetTipBgndColor());
fLabel->SetTextColor(fClient->GetResourcePool()->GetTipFgndColor());
Expand Down
Loading