revisions_289.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. === modified file 'CMakeLists.txt'
  2. --- CMakeLists.txt 2018-10-03 19:59:48 +0000
  3. +++ CMakeLists.txt 2018-11-06 13:40:34 +0000
  4. @@ -157,15 +157,9 @@
  5. src/window.cpp
  6. ${XML_SOURCES}
  7. )
  8. -## gettext
  9. -# https://cmake.org/cmake/help/v2.8.12/cmake.html#module:FindGettext
  10. -find_package(Gettext)
  11. -if(GETTEXT_FOUND)
  12. - file (GLOB PO_FILES ${CMAKE_SOURCE_DIR}/po/*.po)
  13. - message( "msgfmt: ${GETTEXT_MSGFMT_EXECUTABLE}")
  14. - message( "msgmerge: ${GETTEXT_MSGMERGE_EXECUTABLE}")
  15. - GETTEXT_CREATE_TRANSLATIONS(po/${PROJECT_NAME}.pot ALL ${PO_FILES})
  16. -endif()
  17. +
  18. +install(DIRECTORY ${CMAKE_SOURCE_DIR}/usr/share/locale DESTINATION share)
  19. +
  20. ## Turn the source code into a library
  21. add_library(JSM STATIC ${JSM_SRCS})
  22. add_subdirectory(data)
  23. === modified file 'fltk/jwm-shutdown.cxx'
  24. --- fltk/jwm-shutdown.cxx 2018-10-03 19:59:48 +0000
  25. +++ fltk/jwm-shutdown.cxx 2018-11-06 13:40:34 +0000
  26. @@ -21,7 +21,7 @@
  27. * You may redistribute this, but you must keep this comment in place
  28. * Jesus is my Lord, and if you don't like it feel free to ignore it.
  29. */
  30. -// generated by Fast Light User Interface Designer (fluid) version 1.0303
  31. +// generated by Fast Light User Interface Designer (fluid) version 1.0304
  32. #include <libintl.h>
  33. #include "jwm-shutdown.h"
  34. @@ -71,7 +71,8 @@
  35. LOGOUT="torios-exit || jwm -exit";
  36. SHUTDOWN="torios-shutdown || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop || systemctl poweroff";;
  37. RESTART="torios-reboot || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart|| systemctl reboot";
  38. - { Fl_Double_Window* o = shutdown_window = new Fl_Double_Window(242, 230, gettext("Shutdown"));
  39. + Fl::add_timeout(0.1,timer_CB,(void*)this);
  40. + { shutdown_window = new Fl_Double_Window(242, 230, gettext("Shutdown"));
  41. shutdown_window->color(FL_DARK2);
  42. shutdown_window->user_data((void*)(this));
  43. { Fl_Button* o = shut = new Fl_Button(10, 10, 105, 75, gettext("Shutdown"));
  44. @@ -112,7 +113,6 @@
  45. can->callback((Fl_Callback*)cb_can);
  46. } // Fl_Button* can
  47. window_bg();
  48. - if(!make_window_above(o)){std::cerr<<"Couldn't make window work"<<std::endl;}
  49. shutdown_window->clear_border();
  50. shutdown_window->xclass("system-shutdown");
  51. shutdown_window->end();
  52. @@ -144,30 +144,58 @@
  53. under_mouse(shutdown_window);
  54. }
  55. -bool shutdown::make_window_above(Fl_Window *o) {
  56. +bool shutdown::make_window_above() {
  57. Atom wmStateAbove = XInternAtom( fl_display, "_NET_WM_STATE_ABOVE", 1 );
  58. - if( wmStateAbove == None )
  59. + if( wmStateAbove != None )
  60. + {
  61. + std::cout<<"_NET_WM_STATE_ABOVE has atom of"<<wmStateAbove<<std::endl;
  62. + }
  63. + else
  64. + {
  65. + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE_ABOVE !"<<std::endl;
  66. return false;
  67. + }
  68. +
  69. Atom wmNetWmState = XInternAtom( fl_display, "_NET_WM_STATE", 1 );
  70. - if( wmNetWmState == None )
  71. + if( wmNetWmState != None )
  72. + {
  73. + std::cout<<"_NET_WM_STATE has atom of:"<<wmNetWmState<<std::endl;
  74. + }
  75. + else
  76. + {
  77. + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE !"<<std::endl;
  78. return false;
  79. -
  80. - XClientMessageEvent xclient;
  81. - memset( &xclient, 0, sizeof (xclient) );
  82. - xclient.type = ClientMessage;
  83. - xclient.window = fl_xid(o);
  84. - xclient.message_type = wmNetWmState;
  85. - xclient.format = 32;
  86. - xclient.data.l[0] = 1;//_NET_WM_STATE_ADD;
  87. - xclient.data.l[1] = wmStateAbove;
  88. - xclient.data.l[2] = 0;
  89. - xclient.data.l[3] = 0;
  90. - xclient.data.l[4] = 0;
  91. - Window root = DefaultRootWindow( fl_display );
  92. - XSendEvent( fl_display,
  93. - root,
  94. - False,
  95. - SubstructureRedirectMask | SubstructureNotifyMask,
  96. - (XEvent *)&xclient );
  97. + }
  98. + // set window always on top hint
  99. + if( wmStateAbove != None )
  100. + {
  101. + XClientMessageEvent xclient;
  102. + memset( &xclient, 0, sizeof (xclient) );
  103. + xclient.type = ClientMessage;
  104. + xclient.window = fl_xid(shutdown_window);
  105. + xclient.message_type = wmNetWmState; //gdk_x11_get_xatom_by_name_for_display( display, "_NET_WM_STATE" );
  106. + xclient.format = 32;
  107. + xclient.data.l[0] = 1; //_NET_WM_STATE_ADD;
  108. + xclient.data.l[1] = wmStateAbove; //gdk_x11_atom_to_xatom_for_display (display, state1);
  109. + xclient.data.l[2] = 0; //gdk_x11_atom_to_xatom_for_display (display, state2);
  110. + xclient.data.l[3] = 0;
  111. + xclient.data.l[4] = 0;
  112. + //gdk_wmspec_change_state( FALSE, window,
  113. + // gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
  114. + // GDK_NONE );
  115. + XSendEvent(
  116. + fl_display,
  117. + DefaultRootWindow( fl_display ),
  118. + False,
  119. + SubstructureRedirectMask | SubstructureNotifyMask,
  120. + (XEvent *)&xclient
  121. + );
  122. + }
  123. return true;
  124. }
  125. +
  126. +void shutdown::timer_CB(void* myclass) {
  127. + shutdown *o = (shutdown*)myclass;
  128. + o->make_window_above();
  129. + Fl::repeat_timeout(5,timer_CB,myclass);
  130. +}
  131. === modified file 'fltk/jwm-shutdown.fld'
  132. --- fltk/jwm-shutdown.fld 2018-10-03 19:59:48 +0000
  133. +++ fltk/jwm-shutdown.fld 2018-11-06 13:40:34 +0000
  134. @@ -1,9 +1,9 @@
  135. # data file for the Fltk User Interface Designer (fluid)
  136. -version 1.0303
  137. -i18n_type 1
  138. -i18n_include <libintl.h>
  139. -i18n_function gettext
  140. -header_name {.h}
  141. +version 1.0304
  142. +i18n_type 1
  143. +i18n_include <libintl.h>
  144. +i18n_function gettext
  145. +header_name {.h}
  146. code_name {.cxx}
  147. comment {/* Joe's Window Manager Configuration
  148. *
  149. @@ -28,31 +28,31 @@
  150. * You may redistribute this, but you must keep this comment in place
  151. * Jesus is my Lord, and if you don't like it feel free to ignore it.
  152. */} {in_source in_header
  153. -}
  154. +}
  155. decl {\#include <libintl.h>} {public global
  156. -}
  157. +}
  158. decl {\#include <string>} {public global
  159. -}
  160. +}
  161. decl {\#include <stdlib.h>} {public global
  162. -}
  163. +}
  164. decl {\#include <iostream>} {public global
  165. -}
  166. +}
  167. decl {\#include <FL/x.H>} {public global
  168. -}
  169. +}
  170. decl {\#include <X11/Xlib.h>} {public global
  171. -}
  172. +}
  173. decl {\#include "../include/fltkfunctions.hpp"} {public global
  174. -}
  175. +}
  176. decl {\#include "../include/jwmrc.hpp"} {public global
  177. -}
  178. +}
  179. class shutdown {open : {public FLTK_FUNCTIONS}
  180. } {
  181. @@ -64,12 +64,12 @@
  182. SUSPEND="torios-suspend||dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend || systemctl suspend";
  183. LOGOUT="torios-exit || jwm -exit";
  184. SHUTDOWN="torios-shutdown || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop || systemctl poweroff";;
  185. -RESTART="torios-reboot || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart|| systemctl reboot";} {}
  186. +RESTART="torios-reboot || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart|| systemctl reboot";
  187. +Fl::add_timeout(0.1,timer_CB,(void*)this);} {}
  188. Fl_Window shutdown_window {
  189. - label Shutdown open
  190. + label Shutdown open selected
  191. xywh {351 113 242 230} type Double color 45
  192. - code0 {window_bg();}
  193. - code1 {if(!make_window_above(o)){std::cerr<<"Couldn't make window work"<<std::endl;}} noborder xclass {system-shutdown} visible
  194. + code0 {window_bg();} noborder xclass {system-shutdown} visible
  195. } {
  196. Fl_Button shut {
  197. label Shutdown
  198. @@ -130,33 +130,60 @@
  199. //can->labelcolor(color2);
  200. under_mouse(shutdown_window);} {}
  201. }
  202. - Function {make_window_above(Fl_Window *o)} {open return_type bool
  203. + Function {make_window_above()} {open return_type bool
  204. } {
  205. code {Atom wmStateAbove = XInternAtom( fl_display, "_NET_WM_STATE_ABOVE", 1 );
  206. -if( wmStateAbove == None )
  207. +if( wmStateAbove != None )
  208. +{
  209. + std::cout<<"_NET_WM_STATE_ABOVE has atom of"<<wmStateAbove<<std::endl;
  210. +}
  211. +else
  212. +{
  213. + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE_ABOVE !"<<std::endl;
  214. return false;
  215. +}
  216. +
  217. Atom wmNetWmState = XInternAtom( fl_display, "_NET_WM_STATE", 1 );
  218. -if( wmNetWmState == None )
  219. +if( wmNetWmState != None )
  220. +{
  221. + std::cout<<"_NET_WM_STATE has atom of:"<<wmNetWmState<<std::endl;
  222. +}
  223. +else
  224. +{
  225. + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE !"<<std::endl;
  226. return false;
  227. -
  228. -XClientMessageEvent xclient;
  229. -memset( &xclient, 0, sizeof (xclient) );
  230. -xclient.type = ClientMessage;
  231. -xclient.window = fl_xid(o);
  232. -xclient.message_type = wmNetWmState;
  233. -xclient.format = 32;
  234. -xclient.data.l[0] = 1;//_NET_WM_STATE_ADD;
  235. -xclient.data.l[1] = wmStateAbove;
  236. -xclient.data.l[2] = 0;
  237. -xclient.data.l[3] = 0;
  238. -xclient.data.l[4] = 0;
  239. -Window root = DefaultRootWindow( fl_display );
  240. -XSendEvent( fl_display,
  241. - root,
  242. - False,
  243. - SubstructureRedirectMask | SubstructureNotifyMask,
  244. - (XEvent *)&xclient );
  245. -return true;} {selected
  246. - }
  247. - }
  248. -}
  249. +}
  250. +// set window always on top hint
  251. +if( wmStateAbove != None )
  252. +{
  253. + XClientMessageEvent xclient;
  254. + memset( &xclient, 0, sizeof (xclient) );
  255. + xclient.type = ClientMessage;
  256. + xclient.window = fl_xid(shutdown_window);
  257. + xclient.message_type = wmNetWmState; //gdk_x11_get_xatom_by_name_for_display( display, "_NET_WM_STATE" );
  258. + xclient.format = 32;
  259. + xclient.data.l[0] = 1; //_NET_WM_STATE_ADD;
  260. + xclient.data.l[1] = wmStateAbove; //gdk_x11_atom_to_xatom_for_display (display, state1);
  261. + xclient.data.l[2] = 0; //gdk_x11_atom_to_xatom_for_display (display, state2);
  262. + xclient.data.l[3] = 0;
  263. + xclient.data.l[4] = 0;
  264. + //gdk_wmspec_change_state( FALSE, window,
  265. + // gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
  266. + // GDK_NONE );
  267. + XSendEvent(
  268. + fl_display,
  269. + DefaultRootWindow( fl_display ),
  270. + False,
  271. + SubstructureRedirectMask | SubstructureNotifyMask,
  272. + (XEvent *)&xclient
  273. + );
  274. +}
  275. +return true;} {}
  276. + }
  277. + Function {timer_CB(void* myclass)} {open return_type {static void}
  278. + } {
  279. + code {shutdown *o = (shutdown*)myclass;
  280. +o->make_window_above();
  281. +Fl::repeat_timeout(5,timer_CB,myclass);} {}
  282. + }
  283. +}
  284. === modified file 'fltk/jwm-shutdown.h'
  285. --- fltk/jwm-shutdown.h 2018-10-03 19:59:48 +0000
  286. +++ fltk/jwm-shutdown.h 2018-11-06 13:40:34 +0000
  287. @@ -21,7 +21,7 @@
  288. * You may redistribute this, but you must keep this comment in place
  289. * Jesus is my Lord, and if you don't like it feel free to ignore it.
  290. */
  291. -// generated by Fast Light User Interface Designer (fluid) version 1.0303
  292. +// generated by Fast Light User Interface Designer (fluid) version 1.0304
  293. #ifndef jwm_shutdown_h
  294. #define jwm_shutdown_h
  295. @@ -68,6 +68,7 @@
  296. static void cb_can(Fl_Button*, void*);
  297. public:
  298. void window_bg();
  299. - bool make_window_above(Fl_Window *o);
  300. + bool make_window_above();
  301. + static void timer_CB(void* myclass);
  302. };
  303. #endif