wmctrl_1.07-6.diff 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. --- wmctrl-1.07.orig/debian/control
  2. +++ wmctrl-1.07/debian/control
  3. @@ -0,0 +1,20 @@
  4. +Source: wmctrl
  5. +Section: x11
  6. +Priority: optional
  7. +Maintainer: Decklin Foster <decklin@red-bean.com>
  8. +Build-Depends: debhelper (>= 4.0.0), x11proto-core-dev, libx11-dev, libxmu-dev, libglib2.0-dev (>= 2.4.0)
  9. +Standards-Version: 3.6.2
  10. +
  11. +Package: wmctrl
  12. +Architecture: any
  13. +Depends: ${shlibs:Depends}
  14. +Description: control an EWMH/NetWM compatible X Window Manager
  15. + Wmctrl is a command line tool to interact with an
  16. + EWMH/NetWM compatible X Window Manager (examples include
  17. + Enlightenment, icewm, kwin, metacity, and sawfish).
  18. + .
  19. + Wmctrl provides command line access to almost all the features
  20. + defined in the EWMH specification. For example it can maximize
  21. + windows, make them sticky, set them to be always on top. It can
  22. + switch and resize desktops and perform many other useful
  23. + operations.
  24. --- wmctrl-1.07.orig/debian/wmctrl.docs
  25. +++ wmctrl-1.07/debian/wmctrl.docs
  26. @@ -0,0 +1 @@
  27. +README
  28. --- wmctrl-1.07.orig/debian/watch
  29. +++ wmctrl-1.07/debian/watch
  30. @@ -0,0 +1,2 @@
  31. +version=2
  32. +http://sweb.cz/tripie/utils/wmctrl/dist/ wmctrl-(.*)\.tar\.gz debian uupdate
  33. --- wmctrl-1.07.orig/debian/compat
  34. +++ wmctrl-1.07/debian/compat
  35. @@ -0,0 +1 @@
  36. +4
  37. --- wmctrl-1.07.orig/debian/changelog
  38. +++ wmctrl-1.07/debian/changelog
  39. @@ -0,0 +1,69 @@
  40. +wmctrl (1.07-6) unstable; urgency=low
  41. +
  42. + * Reverted CARD32 patch, which was broken on amd64; use fix from Chris
  43. + Donoghue instead. (Closes: #362068)
  44. + * Change x-dev -> x11proto-core-dev build-dep.
  45. +
  46. + -- Decklin Foster <decklin@red-bean.com> Tue, 18 Apr 2006 10:20:00 -0400
  47. +
  48. +wmctrl (1.07-5) unstable; urgency=low
  49. +
  50. + * Not all the new build-deps from -2 were actually added to debian/control.
  51. + (Closes: #345816)
  52. +
  53. + -- Decklin Foster <decklin@red-bean.com> Tue, 3 Jan 2006 14:26:57 -0500
  54. +
  55. +wmctrl (1.07-4) unstable; urgency=low
  56. +
  57. + * Get rid of huge mess in .diff.gz caused by vim's braindead folding.
  58. +
  59. + -- Decklin Foster <decklin@red-bean.com> Mon, 2 Jan 2006 23:27:14 -0500
  60. +
  61. +wmctrl (1.07-3) unstable; urgency=low
  62. +
  63. + * Fix typo in description (Closes: #345576)
  64. +
  65. + -- Decklin Foster <decklin@red-bean.com> Mon, 2 Jan 2006 22:53:30 -0500
  66. +
  67. +wmctrl (1.07-2) unstable; urgency=low
  68. +
  69. + * Patch main.c to use CARD32 for all EWMH properties instead of unsigned
  70. + long, which may be 64 bits on 64-bit archs. (Closes: #344080)
  71. + * Replace xlibs-dev build-dep with libx11-dev, x-dev, libxmu-dev.
  72. + * Update Standards-Version to 3.6.2.
  73. +
  74. + -- Decklin Foster <decklin@red-bean.com> Mon, 2 Jan 2006 22:34:27 -0500
  75. +
  76. +wmctrl (1.07-1) unstable; urgency=low
  77. +
  78. + * New upstream release
  79. +
  80. + -- Decklin Foster <decklin@red-bean.com> Sat, 29 Jan 2005 09:45:14 -0500
  81. +
  82. +wmctrl (1.06-1) unstable; urgency=low
  83. +
  84. + * New upstream release
  85. + - debian/wmctrl.1: merged upstream.
  86. + * debian/watch: added trailing / to directory (Thanks, Shyamal).
  87. + * debian/control: lowercase first letter of description.
  88. +
  89. + -- Decklin Foster <decklin@red-bean.com> Sat, 22 Jan 2005 14:04:09 -0500
  90. +
  91. +wmctrl (1.05-2) unstable; urgency=low
  92. +
  93. + * Adopting package created by Debian user Shyamal Prasad
  94. + <shyamal@member.fsf.org>.
  95. + * Removed debian/{pre,post}{inst,rm}.ex and config.{sub,guess}, and do not
  96. + generate config.{sub,guess} in clean.
  97. + * Removed example cruft in copyright and watch.
  98. + * Install ChangeLog as the upstream changelog, not a doc. Do not install
  99. + NEWS, since it is empty.
  100. +
  101. + -- Decklin Foster <decklin@red-bean.com> Mon, 13 Dec 2004 10:41:11 -0500
  102. +
  103. +wmctrl (1.05-1) unstable; urgency=low
  104. +
  105. + * Initial Release. Added man page wmctrl.1 (closes: #285397)
  106. +
  107. + -- Shyamal Prasad <shyamal@member.fsf.org> Thu, 12 Dec 2004 18:59:40 -0800
  108. +
  109. --- wmctrl-1.07.orig/debian/rules
  110. +++ wmctrl-1.07/debian/rules
  111. @@ -0,0 +1,91 @@
  112. +#!/usr/bin/make -f
  113. +# -*- makefile -*-
  114. +# Sample debian/rules that uses debhelper.
  115. +# This file was originally written by Joey Hess and Craig Small.
  116. +# As a special exception, when this file is copied by dh-make into a
  117. +# dh-make output file, you may use that output file without restriction.
  118. +# This special exception was added by Craig Small in version 0.37 of dh-make.
  119. +
  120. +# Uncomment this to turn on verbose mode.
  121. +#export DH_VERBOSE=1
  122. +
  123. +
  124. +# These are used for cross-compiling and for saving the configure script
  125. +# from having to guess our platform (since we know it already)
  126. +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
  127. +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
  128. +
  129. +
  130. +CFLAGS = -Wall -g
  131. +
  132. +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  133. + CFLAGS += -O0
  134. +else
  135. + CFLAGS += -O2
  136. +endif
  137. +
  138. +config.status: configure
  139. + dh_testdir
  140. + # Add here commands to configure the package.
  141. + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
  142. +
  143. +
  144. +build: build-stamp
  145. +
  146. +build-stamp: config.status
  147. + dh_testdir
  148. +
  149. + # Add here commands to compile the package.
  150. + $(MAKE)
  151. +
  152. + touch build-stamp
  153. +
  154. +clean:
  155. + dh_testdir
  156. + dh_testroot
  157. + rm -f build-stamp
  158. +
  159. + # Add here commands to clean up after the build process.
  160. + -$(MAKE) distclean
  161. +
  162. + dh_clean
  163. +
  164. +install: build
  165. + dh_testdir
  166. + dh_testroot
  167. + dh_clean -k
  168. + dh_installdirs
  169. +
  170. + # Add here commands to install the package into debian/wmctrl.
  171. + $(MAKE) install DESTDIR=$(CURDIR)/debian/wmctrl
  172. +
  173. +
  174. +# Build architecture-independent files here.
  175. +binary-indep: build install
  176. +# We have nothing to do by default.
  177. +
  178. +# Build architecture-dependent files here.
  179. +binary-arch: build install
  180. + dh_testdir
  181. + dh_testroot
  182. + dh_installchangelogs ChangeLog
  183. + dh_installdocs
  184. + dh_installexamples
  185. +# dh_install
  186. +# dh_installmenu
  187. +# dh_installlogrotate
  188. +# dh_installinit
  189. +# dh_installinfo
  190. + dh_link
  191. + dh_strip
  192. + dh_compress
  193. + dh_fixperms
  194. +# dh_makeshlibs
  195. + dh_installdeb
  196. + dh_shlibdeps
  197. + dh_gencontrol
  198. + dh_md5sums
  199. + dh_builddeb
  200. +
  201. +binary: binary-indep binary-arch
  202. +.PHONY: build clean binary-indep binary-arch binary install
  203. --- wmctrl-1.07.orig/debian/copyright
  204. +++ wmctrl-1.07/debian/copyright
  205. @@ -0,0 +1,15 @@
  206. +This package was debianized by Shyamal Prasad <shyamal@member.fsf.org> on
  207. +Thu, 12 Dec 2004 18:59:40 -0800.
  208. +
  209. +It was downloaded from http://sweb.cz/tripie/utils/wmctrl/
  210. +
  211. +Upstream Author: Tomas Styblo <tripie@cpan.org>
  212. +
  213. +Copyright (C) 2003, Tomas Styblo <tripie@cpan.org>
  214. +
  215. +You are free to distribute this software under the terms of the GNU
  216. +General Public License.
  217. +
  218. +On Debian systems, the complete text of the GNU General Public License
  219. +can be found in the file `/usr/share/common-licenses/GPL'.
  220. +
  221. --- wmctrl-1.07.orig/BAH
  222. +++ wmctrl-1.07/BAH
  223. @@ -0,0 +1,172 @@
  224. +--- wmctrl-1.07.orig/main.c
  225. ++++ wmctrl-1.07/main.c
  226. +@@ -31,6 +31,7 @@
  227. + #include <string.h>
  228. + #include <locale.h>
  229. + #include <X11/Xlib.h>
  230. ++#include <X11/Xmd.h>
  231. + #include <X11/Xatom.h>
  232. + #include <X11/cursorfont.h>
  233. + #include <X11/Xmu/WinUtil.h>
  234. +@@ -477,8 +478,8 @@
  235. + Window *sup_window = NULL;
  236. + gchar *wm_name = NULL;
  237. + gchar *wm_class = NULL;
  238. +- unsigned long *wm_pid = NULL;
  239. +- unsigned long *showing_desktop = NULL;
  240. ++ CARD32 *wm_pid = NULL;
  241. ++ CARD32 *showing_desktop = NULL;
  242. + gboolean name_is_utf8 = TRUE;
  243. + gchar *name_out;
  244. + gchar *class_out;
  245. +@@ -517,13 +518,13 @@
  246. +
  247. +
  248. + /* WM_PID */
  249. +- if (! (wm_pid = (unsigned long *)get_property(disp, *sup_window,
  250. ++ if (! (wm_pid = (CARD32 *)get_property(disp, *sup_window,
  251. + XA_CARDINAL, "_NET_WM_PID", NULL))) {
  252. + p_verbose("Cannot get pid of the window manager (_NET_WM_PID).\n");
  253. + }
  254. +
  255. + /* _NET_SHOWING_DESKTOP */
  256. +- if (! (showing_desktop = (unsigned long *)get_property(disp, DefaultRootWindow(disp),
  257. ++ if (! (showing_desktop = (CARD32 *)get_property(disp, DefaultRootWindow(disp),
  258. + XA_CARDINAL, "_NET_SHOWING_DESKTOP", NULL))) {
  259. + p_verbose("Cannot get the _NET_SHOWING_DESKTOP property.\n");
  260. + }
  261. +@@ -678,13 +679,13 @@
  262. + }/*}}}*/
  263. +
  264. + static int window_to_desktop (Display *disp, Window win, int desktop) {/*{{{*/
  265. +- unsigned long *cur_desktop = NULL;
  266. ++ CARD32 *cur_desktop = NULL;
  267. + Window root = DefaultRootWindow(disp);
  268. +
  269. + if (desktop == -1) {
  270. +- if (! (cur_desktop = (unsigned long *)get_property(disp, root,
  271. ++ if (! (cur_desktop = (CARD32 *)get_property(disp, root,
  272. + XA_CARDINAL, "_NET_CURRENT_DESKTOP", NULL))) {
  273. +- if (! (cur_desktop = (unsigned long *)get_property(disp, root,
  274. ++ if (! (cur_desktop = (CARD32 *)get_property(disp, root,
  275. + XA_CARDINAL, "_WIN_WORKSPACE", NULL))) {
  276. + fputs("Cannot get current desktop properties. "
  277. + "(_NET_CURRENT_DESKTOP or _WIN_WORKSPACE property)"
  278. +@@ -702,12 +703,12 @@
  279. +
  280. + static int activate_window (Display *disp, Window win, /* {{{ */
  281. + gboolean switch_desktop) {
  282. +- unsigned long *desktop;
  283. ++ CARD32 *desktop;
  284. +
  285. + /* desktop ID */
  286. +- if ((desktop = (unsigned long *)get_property(disp, win,
  287. ++ if ((desktop = (CARD32 *)get_property(disp, win,
  288. + XA_CARDINAL, "_NET_WM_DESKTOP", NULL)) == NULL) {
  289. +- if ((desktop = (unsigned long *)get_property(disp, win,
  290. ++ if ((desktop = (CARD32 *)get_property(disp, win,
  291. + XA_CARDINAL, "_WIN_WORKSPACE", NULL)) == NULL) {
  292. + p_verbose("Cannot find desktop ID of the window.\n");
  293. + }
  294. +@@ -1016,16 +1017,16 @@
  295. + }/*}}}*/
  296. +
  297. + static int list_desktops (Display *disp) {/*{{{*/
  298. +- unsigned long *num_desktops = NULL;
  299. +- unsigned long *cur_desktop = NULL;
  300. ++ CARD32 *num_desktops = NULL;
  301. ++ CARD32 *cur_desktop = NULL;
  302. + unsigned long desktop_list_size = 0;
  303. +- unsigned long *desktop_geometry = NULL;
  304. ++ CARD32 *desktop_geometry = NULL;
  305. + unsigned long desktop_geometry_size = 0;
  306. + gchar **desktop_geometry_str = NULL;
  307. +- unsigned long *desktop_viewport = NULL;
  308. ++ CARD32 *desktop_viewport = NULL;
  309. + unsigned long desktop_viewport_size = 0;
  310. + gchar **desktop_viewport_str = NULL;
  311. +- unsigned long *desktop_workarea = NULL;
  312. ++ CARD32 *desktop_workarea = NULL;
  313. + unsigned long desktop_workarea_size = 0;
  314. + gchar **desktop_workarea_str = NULL;
  315. + gchar *list = NULL;
  316. +@@ -1036,9 +1037,9 @@
  317. + gchar **names = NULL;
  318. + gboolean names_are_utf8 = TRUE;
  319. +
  320. +- if (! (num_desktops = (unsigned long *)get_property(disp, root,
  321. ++ if (! (num_desktops = (CARD32 *)get_property(disp, root,
  322. + XA_CARDINAL, "_NET_NUMBER_OF_DESKTOPS", NULL))) {
  323. +- if (! (num_desktops = (unsigned long *)get_property(disp, root,
  324. ++ if (! (num_desktops = (CARD32 *)get_property(disp, root,
  325. + XA_CARDINAL, "_WIN_WORKSPACE_COUNT", NULL))) {
  326. + fputs("Cannot get number of desktops properties. "
  327. + "(_NET_NUMBER_OF_DESKTOPS or _WIN_WORKSPACE_COUNT)"
  328. +@@ -1047,9 +1048,9 @@
  329. + }
  330. + }
  331. +
  332. +- if (! (cur_desktop = (unsigned long *)get_property(disp, root,
  333. ++ if (! (cur_desktop = (CARD32 *)get_property(disp, root,
  334. + XA_CARDINAL, "_NET_CURRENT_DESKTOP", NULL))) {
  335. +- if (! (cur_desktop = (unsigned long *)get_property(disp, root,
  336. ++ if (! (cur_desktop = (CARD32 *)get_property(disp, root,
  337. + XA_CARDINAL, "_WIN_WORKSPACE", NULL))) {
  338. + fputs("Cannot get current desktop properties. "
  339. + "(_NET_CURRENT_DESKTOP or _WIN_WORKSPACE property)"
  340. +@@ -1074,21 +1075,21 @@
  341. + }
  342. +
  343. + /* common size of all desktops */
  344. +- if (! (desktop_geometry = (unsigned long *)get_property(disp, DefaultRootWindow(disp),
  345. ++ if (! (desktop_geometry = (CARD32 *)get_property(disp, DefaultRootWindow(disp),
  346. + XA_CARDINAL, "_NET_DESKTOP_GEOMETRY", &desktop_geometry_size))) {
  347. + p_verbose("Cannot get common size of all desktops (_NET_DESKTOP_GEOMETRY).\n");
  348. + }
  349. +
  350. + /* desktop viewport */
  351. +- if (! (desktop_viewport = (unsigned long *)get_property(disp, DefaultRootWindow(disp),
  352. ++ if (! (desktop_viewport = (CARD32 *)get_property(disp, DefaultRootWindow(disp),
  353. + XA_CARDINAL, "_NET_DESKTOP_VIEWPORT", &desktop_viewport_size))) {
  354. + p_verbose("Cannot get common size of all desktops (_NET_DESKTOP_VIEWPORT).\n");
  355. + }
  356. +
  357. + /* desktop workarea */
  358. +- if (! (desktop_workarea = (unsigned long *)get_property(disp, DefaultRootWindow(disp),
  359. ++ if (! (desktop_workarea = (CARD32 *)get_property(disp, DefaultRootWindow(disp),
  360. + XA_CARDINAL, "_NET_WORKAREA", &desktop_workarea_size))) {
  361. +- if (! (desktop_workarea = (unsigned long *)get_property(disp, DefaultRootWindow(disp),
  362. ++ if (! (desktop_workarea = (CARD32 *)get_property(disp, DefaultRootWindow(disp),
  363. + XA_CARDINAL, "_WIN_WORKAREA", &desktop_workarea_size))) {
  364. + p_verbose("Cannot get _NET_WORKAREA property.\n");
  365. + }
  366. +@@ -1301,16 +1302,16 @@
  367. + gchar *title_out = get_output_str(title_utf8, TRUE);
  368. + gchar *client_machine;
  369. + gchar *class_out = get_window_class(disp, client_list[i]); /* UTF8 */
  370. +- unsigned long *pid;
  371. +- unsigned long *desktop;
  372. ++ CARD32 *pid;
  373. ++ CARD32 *desktop;
  374. + int x, y, junkx, junky;
  375. + unsigned int wwidth, wheight, bw, depth;
  376. + Window junkroot;
  377. +
  378. + /* desktop ID */
  379. +- if ((desktop = (unsigned long *)get_property(disp, client_list[i],
  380. ++ if ((desktop = (CARD32 *)get_property(disp, client_list[i],
  381. + XA_CARDINAL, "_NET_WM_DESKTOP", NULL)) == NULL) {
  382. +- desktop = (unsigned long *)get_property(disp, client_list[i],
  383. ++ desktop = (CARD32 *)get_property(disp, client_list[i],
  384. + XA_CARDINAL, "_WIN_WORKSPACE", NULL);
  385. + }
  386. +
  387. +@@ -1319,7 +1320,7 @@
  388. + XA_STRING, "WM_CLIENT_MACHINE", NULL);
  389. +
  390. + /* pid */
  391. +- pid = (unsigned long *)get_property(disp, client_list[i],
  392. ++ pid = (CARD32 *)get_property(disp, client_list[i],
  393. + XA_CARDINAL, "_NET_WM_PID", NULL);
  394. +
  395. + /* geometry */
  396. --- wmctrl-1.07.orig/main.c
  397. +++ wmctrl-1.07/main.c
  398. @@ -1425,6 +1425,16 @@
  399. *
  400. * long_length = Specifies the length in 32-bit multiples of the
  401. * data to be retrieved.
  402. + *
  403. + * NOTE: see
  404. + * http://mail.gnome.org/archives/wm-spec-list/2003-March/msg00067.html
  405. + * In particular:
  406. + *
  407. + * When the X window system was ported to 64-bit architectures, a
  408. + * rather peculiar design decision was made. 32-bit quantities such
  409. + * as Window IDs, atoms, etc, were kept as longs in the client side
  410. + * APIs, even when long was changed to 64 bits.
  411. + *
  412. */
  413. if (XGetWindowProperty(disp, win, xa_prop_name, 0, MAX_PROPERTY_VALUE_LEN / 4, False,
  414. xa_prop_type, &xa_ret_type, &ret_format,
  415. @@ -1441,6 +1451,8 @@
  416. /* null terminate the result to make string handling easier */
  417. tmp_size = (ret_format / 8) * ret_nitems;
  418. + /* Correct 64 Architecture implementation of 32 bit data */
  419. + if(ret_format==32) tmp_size *= sizeof(long)/4;
  420. ret = g_malloc(tmp_size + 1);
  421. memcpy(ret, ret_prop, tmp_size);
  422. ret[tmp_size] = '\0';