Autore Topic: Conoscere il "display server protocol"  (Letto 561 volte)

Offline kicco

  • Senatore Gambero
  • ******
  • Post: 1.702
  • So dove andare, seguitemi, ci perderemo insieme!
    • Mostra profilo
Conoscere il "display server protocol"
« il: 26 Luglio 2022, 09:56:32 »
 :ciao:
Ho scritto un programmino "scemo" per verificare se lo stacking funziona correttamente, settandolo a 2 (below) dovrebbe andare sul desktop come ultima finestra.
Usando Wayland come dislay server protocol, anzichè Xorg, questo non accade correttamente e finisce invece sotto il desktop impedendo di accedere ai controlli (pulsanti ecc..).
Ogni volta che faccio la prova, per verificare se il bug sia stato sistemato, ho sempre il dubbio se la sessione l'ho aperta con Wayland o con Xorg.
Esiste in gambas una proprietà che mi indica il display server protocol usato?
 :ciao:
Chi ha paura muore ogni giorno, chi non ha paura muore una volta sola. (Paolo Borsellino)

Offline Gianluigi

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 4.157
  • Tonno verde
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #1 il: 26 Luglio 2022, 15:43:56 »
:ciao:
Ho scritto un programmino "scemo" per verificare se lo stacking funziona correttamente, settandolo a 2 (below) dovrebbe andare sul desktop come ultima finestra.
Usando Wayland come dislay server protocol, anzichè Xorg, questo non accade correttamente e finisce invece sotto il desktop impedendo di accedere ai controlli (pulsanti ecc..).
Ogni volta che faccio la prova, per verificare se il bug sia stato sistemato, ho sempre il dubbio se la sessione l'ho aperta con Wayland o con Xorg.
Esiste in gambas una proprietà che mi indica il display server protocol usato?
 :ciao:

Che io sappia, no.
Potresti all'apertura del programma interrogare la shell :
Codice: [Seleziona]
  Dim s As String
 
  Shell "echo $XDG_SESSION_TYPE" To s
  Print s

 :ciao:
nuoto in attesa del bacio di una principessa che mi trasformi in un gambero azzurro

Offline kicco

  • Senatore Gambero
  • ******
  • Post: 1.702
  • So dove andare, seguitemi, ci perderemo insieme!
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #2 il: 26 Luglio 2022, 16:38:37 »
 :ok: :ok: :ok:
Grazie!
 :ciao:
Chi ha paura muore ogni giorno, chi non ha paura muore una volta sola. (Paolo Borsellino)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.269
  • Ne mors quidem nos iunget
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #3 il: 26 Luglio 2022, 20:19:22 »
...forse questo ?
(attivare gb.desktop)

Codice: [Seleziona]
Print Desktop.Platform
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline Gianluigi

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 4.157
  • Tonno verde
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #4 il: 26 Luglio 2022, 22:37:33 »
...forse questo ?
(attivare gb.desktop)

Codice: [Seleziona]
Print Desktop.Platform

Accidenti  :hard: ho guardato tutti i System e i Desktop eppure non l'ho visto  :donkey:

Grazie vuott  :ok:
nuoto in attesa del bacio di una principessa che mi trasformi in un gambero azzurro

Offline kicco

  • Senatore Gambero
  • ******
  • Post: 1.702
  • So dove andare, seguitemi, ci perderemo insieme!
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #5 il: 27 Luglio 2022, 08:07:33 »
Grazie vuott  :ok:
Chi ha paura muore ogni giorno, chi non ha paura muore una volta sola. (Paolo Borsellino)

Offline kicco

  • Senatore Gambero
  • ******
  • Post: 1.702
  • So dove andare, seguitemi, ci perderemo insieme!
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #6 il: 27 Luglio 2022, 08:36:50 »
C'è solo un problema, desktop.platform mi restituisce sempre X11 anche se uso wayland, mentre $XDG_SESSION_TYPE fa distinzione.
Chi ha paura muore ogni giorno, chi non ha paura muore una volta sola. (Paolo Borsellino)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.269
  • Ne mors quidem nos iunget
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #7 il: 27 Luglio 2022, 09:11:37 »
Allora suppongo che non sia adatto per quello che cercavi oppure c'è un bug. 🐛
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline Gianluigi

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 4.157
  • Tonno verde
    • Mostra profilo
nuoto in attesa del bacio di una principessa che mi trasformi in un gambero azzurro

Offline Gianluigi

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 4.157
  • Tonno verde
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #9 il: 07 Agosto 2022, 18:16:24 »
Niente da fare Benoit non sente ragione, abbandono per stanchezza  :P

Codice: [Seleziona]
Gianluigi GRADASCHI - 27/07/2022 10:37:13
With gb.gui.qt possible wrong answer from desktop.platform in wayland
With this code:
Public Sub Form_Open()
  Dim s As String
 
  Shell "echo $XDG_SESSION_TYPE" To s
  Print "echo $XDG_SESSION_TYPE = "; s
  Print "DESKTOP PLATFORM = "; Desktop.Platform
End
Console answer with gb.gtk3 :

(DesktopType:2310): Gtk-WARNING **: 10:06:10.164: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node headerbar, owner GtkHeaderBar)
(DesktopType:2310): Gtk-WARNING **: 10:06:10.165: gtk_widget_size_allocate(): attempt to allocate widget with width -72 and height 17
(DesktopType:2310): Gtk-WARNING **: 10:06:10.165: Negative content width -23 (allocation 1, extents 12x12) while allocating gadget (node label, owner GtkLabel)
echo $XDG_SESSION_TYPE = wayland
DESKTOP PLATFORM = wayla
Console answer with gb.gui.qt :
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
echo $XDG_SESSION_TYPE = wayland
DESKTOP PLATFORM = x11


1 Benoît MINISINI - 06/08/2022 19:09:52
Console answer with gb.gtk3 :
(DesktopType:2310): Gtk-WARNING **: 10:06:10.164: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node headerbar, owner GtkHeaderBar)
(DesktopType:2310): Gtk-WARNING **: 10:06:10.165: gtk_widget_size_allocate(): attempt to allocate widget with width -72 and height 17
(DesktopType:2310): Gtk-WARNING **: 10:06:10.165: Negative content width -23 (allocation 1, extents 12x12) while allocating gadget (node label, owner GtkLabel)
echo $XDG_SESSION_TYPE = wayland
DESKTOP PLATFORM = wayla
'wayla' ???
Console answer with gb.gui.qt :
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
echo $XDG_SESSION_TYPE = wayland
DESKTOP PLATFORM = x11
I don't see the problem in that answer.

2 Gianluigi GRADASCHI - 06/08/2022 23:19:45
"wayla" is my error in copying from console :-(
I don't understand your answer: I'm using wayland, I query Gambas to find out which graphics server my system uses, he answers X11 and it's regular?

3 Benoît MINISINI - 07/08/2022 00:09:51
Yes. The Qt library tells you that it won't run using Wayland on a Gnome desktop by default (maybe because Gnome does not support it correctly), and that you have to force it by setting the QT_QPA_PLATFORM environment variable. Otherwise it will run using X11, hence what Gambas tells you: the truth. :-)

4 Gianluigi GRADASCHI - 07/08/2022 09:24:33
But if it is true that you are using X11, for what reason is the windows stacking property not working?
Is there any other way to know from Gambas if I can use the property?

5 Benoît MINISINI - 07/08/2022 15:51:06
It's Wayland that has no support for window stacking. By using X11 on a Wayland desktop, your program runs through "XWayland", but the desktop keeps being managed by Wayland, and so I guess the requests for window stacking made through X11 are ignored.

6 Gianluigi GRADASCHI - 07/08/2022 16:49:15
This is exactly why I flagged the "X11" response as a possible error. :-/

7 Benoît MINISINI - 07/08/2022 16:58:21
The Qt library runs through X11, so the desktop platform is X11. It does not mean that the running desktop is X11. To know that, you must interpret the 'Desktop.Type' or 'Desktop.Types' properties.
nuoto in attesa del bacio di una principessa che mi trasformi in un gambero azzurro

Offline kicco

  • Senatore Gambero
  • ******
  • Post: 1.702
  • So dove andare, seguitemi, ci perderemo insieme!
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #10 il: 08 Agosto 2022, 09:53:07 »
 :ciao:
Gianluigi, scusa sono un po' incasinato e non ho letto con la necessaria attenzione tutta la "spiega".
Può essere che sia lo stesso problema di stacking che ho, e che ho descritto nel BUG #2326?
Di recente Minisini mi ha chiesto se le cose fossero cambiate cioè se il server Wayland e Gnome (sembrano Gianni e Pinotto) avessero trovato una pacificazione intorno al problema.  Minisini dice anche che la questione  è in continua evoluzione e che potrebbe trovare "naturalmente" una soluzione man mano che lo sviluppo di Wayland e gli adattamenti di Gnome  proseguono.
 Intanto ... :hard:
 :ciao:
Chi ha paura muore ogni giorno, chi non ha paura muore una volta sola. (Paolo Borsellino)

Offline Gianluigi

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 4.157
  • Tonno verde
    • Mostra profilo
Re:Conoscere il "display server protocol"
« Risposta #11 il: 08 Agosto 2022, 13:26:36 »
:ciao:
Gianluigi, scusa sono un po' incasinato...

Bravi, bravi lavorate... per pagarci la pensione  :P

Comunque Minisini gentilmente mi ha scritto questo riferito a Desktop.Type:

Actually it's not their job. AFAIK, you have to look if there is a "WAYLAND_DISPLAY" environment variable. It tells you that there is some wayland server you can connect to. For X11, it's the "DISPLAY" environmental variable.

But as Wayland is (almost) backward-compatible with X11, it gives you both (WAYLAND_DISPLAY and DISPLAY), so that the GUI toolkit can choose.

In other words, a desktop using Wayland does not imply that a GUI application will use Wayland.


 :ciao: :ciao:
« Ultima modifica: 08 Agosto 2022, 13:27:28 da Gianluigi »
nuoto in attesa del bacio di una principessa che mi trasformi in un gambero azzurro