I'm using YAD 0.35.0 (GTK+ 2.24.23).
With the following script the windows sometimes appear in the center of my screen and sometimes in the top left corner. I couldn't find any mistake in my script so is this a bug in YAD?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | #!/bin/sh title="YAD Wizard" copying="/usr/share/common-licenses/GPL-2" icon="$PWD/icon.png" banner="$PWD/banner.png" width=500 height=360 width_s=300 height_s=100 #arch="x86_64" if [ "x$arch" = "x" ]; then test "$(uname -m)" = "x86_64" && arch="x86_64" || arch="x86" fi yad="$PWD/yad.$arch" btn_next="Next" btn_prev="Back" btn_cancel="Cancel" # Quit dialog wiz_quit () { btn_stay="No, stay" btn_quit="Yes, quit" $yad --center --on-top --fixed --no-escape \ --question \ --title="Please confirm" \ --window-icon="$icon" \ --width=$width_s \ --height=$height_s \ --buttons-layout=spread \ --button="$btn_stay" \ --button="$btn_quit" \ --text-align=center \ --text="Do you really want to quit?" ; ret="$?" if [ $ret -eq 252 ] || [ $ret -eq 0 ]; then $1 else exit 0 fi } # Welcome goto_pg_welcome () { $yad --center --on-top --fixed --no-escape \ --title="$title" \ --window-icon="$icon" \ --image="$banner" \ --width=$width \ --height=$height \ --button="$btn_cancel" \ --button="$btn_next" \ --text="Welcome!" ret="$?" if [ $ret -eq 252 ] || [ $ret -eq 0 ]; then wiz_quit $0 else goto_pg_license fi } # License goto_pg_license () { accept="$($yad --center --on-top --fixed --no-escape \ --title="$title" \ --window-icon="$icon" \ --image="$banner" \ --width=$width \ --height=$height \ --text-align=center \ --text="\nRead the license conditions!\n" \ --form \ --item-separator=, \ --separator=" " \ --field="Show me the full license text:BTN" \ """$yad --center --on-top --fixed --no-escape \ --text-info \ --wrap \ --show-uri \ --filename="$copying" \ --title="License" \ --window-icon="$icon" \ --width=$width \ --height=$height \ --button="OK" """ \ --field="I have read and accept the license conditions:CHK" \ --button="$btn_cancel" \ --button="$btn_prev" \ --button="$btn_next")" ret="$?" if [ $ret -eq 252 ] || [ $ret -eq 0 ]; then wiz_quit $0 elif [ $ret -eq 1 ]; then goto_pg_welcome elif [ $ret -eq 2 ]; then if [ "$(echo $accept | awk '{print $1}')" = "TRUE" ]; then goto_pg_installpath else goto_license_accept_reminder fi fi } goto_license_accept_reminder () { $yad --center --on-top --fixed --no-escape \ --title="$title" \ --window-icon="$icon" \ --width=$width_s \ --height=$height_s \ --button="OK" \ --text-align=center \ --text="You must accept the license conditions\nin order to continue." goto_pg_license } goto_pg_welcome |
Looking on the Google groups releaved this seems to be a common problem depending on the used window manager.
Someone posted a solution involving the --geometry option: https://groups.google.com/d/msg/yad-common/XP7hAOxTGbQ/mPdLzZ9iBwAJ
It would be nicer though if this wasn't necessary.