123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- === modified file 'CMakeLists.txt'
- --- CMakeLists.txt 2018-10-03 19:59:48 +0000
- +++ CMakeLists.txt 2018-11-06 13:40:34 +0000
- @@ -157,15 +157,9 @@
- src/window.cpp
- ${XML_SOURCES}
- )
- -## gettext
- -# https://cmake.org/cmake/help/v2.8.12/cmake.html#module:FindGettext
- -find_package(Gettext)
- -if(GETTEXT_FOUND)
- - file (GLOB PO_FILES ${CMAKE_SOURCE_DIR}/po/*.po)
- - message( "msgfmt: ${GETTEXT_MSGFMT_EXECUTABLE}")
- - message( "msgmerge: ${GETTEXT_MSGMERGE_EXECUTABLE}")
- - GETTEXT_CREATE_TRANSLATIONS(po/${PROJECT_NAME}.pot ALL ${PO_FILES})
- -endif()
- +
- +install(DIRECTORY ${CMAKE_SOURCE_DIR}/usr/share/locale DESTINATION share)
- +
- ## Turn the source code into a library
- add_library(JSM STATIC ${JSM_SRCS})
- add_subdirectory(data)
- === modified file 'fltk/jwm-shutdown.cxx'
- --- fltk/jwm-shutdown.cxx 2018-10-03 19:59:48 +0000
- +++ fltk/jwm-shutdown.cxx 2018-11-06 13:40:34 +0000
- @@ -21,7 +21,7 @@
- * You may redistribute this, but you must keep this comment in place
- * Jesus is my Lord, and if you don't like it feel free to ignore it.
- */
- -// generated by Fast Light User Interface Designer (fluid) version 1.0303
- +// generated by Fast Light User Interface Designer (fluid) version 1.0304
-
- #include <libintl.h>
- #include "jwm-shutdown.h"
- @@ -71,7 +71,8 @@
- LOGOUT="torios-exit || jwm -exit";
- SHUTDOWN="torios-shutdown || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop || systemctl poweroff";;
- RESTART="torios-reboot || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart|| systemctl reboot";
- - { Fl_Double_Window* o = shutdown_window = new Fl_Double_Window(242, 230, gettext("Shutdown"));
- + Fl::add_timeout(0.1,timer_CB,(void*)this);
- + { shutdown_window = new Fl_Double_Window(242, 230, gettext("Shutdown"));
- shutdown_window->color(FL_DARK2);
- shutdown_window->user_data((void*)(this));
- { Fl_Button* o = shut = new Fl_Button(10, 10, 105, 75, gettext("Shutdown"));
- @@ -112,7 +113,6 @@
- can->callback((Fl_Callback*)cb_can);
- } // Fl_Button* can
- window_bg();
- - if(!make_window_above(o)){std::cerr<<"Couldn't make window work"<<std::endl;}
- shutdown_window->clear_border();
- shutdown_window->xclass("system-shutdown");
- shutdown_window->end();
- @@ -144,30 +144,58 @@
- under_mouse(shutdown_window);
- }
-
- -bool shutdown::make_window_above(Fl_Window *o) {
- +bool shutdown::make_window_above() {
- Atom wmStateAbove = XInternAtom( fl_display, "_NET_WM_STATE_ABOVE", 1 );
- - if( wmStateAbove == None )
- + if( wmStateAbove != None )
- + {
- + std::cout<<"_NET_WM_STATE_ABOVE has atom of"<<wmStateAbove<<std::endl;
- + }
- + else
- + {
- + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE_ABOVE !"<<std::endl;
- return false;
- + }
- +
- Atom wmNetWmState = XInternAtom( fl_display, "_NET_WM_STATE", 1 );
- - if( wmNetWmState == None )
- + if( wmNetWmState != None )
- + {
- + std::cout<<"_NET_WM_STATE has atom of:"<<wmNetWmState<<std::endl;
- + }
- + else
- + {
- + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE !"<<std::endl;
- return false;
- -
- - XClientMessageEvent xclient;
- - memset( &xclient, 0, sizeof (xclient) );
- - xclient.type = ClientMessage;
- - xclient.window = fl_xid(o);
- - xclient.message_type = wmNetWmState;
- - xclient.format = 32;
- - xclient.data.l[0] = 1;//_NET_WM_STATE_ADD;
- - xclient.data.l[1] = wmStateAbove;
- - xclient.data.l[2] = 0;
- - xclient.data.l[3] = 0;
- - xclient.data.l[4] = 0;
- - Window root = DefaultRootWindow( fl_display );
- - XSendEvent( fl_display,
- - root,
- - False,
- - SubstructureRedirectMask | SubstructureNotifyMask,
- - (XEvent *)&xclient );
- + }
- + // set window always on top hint
- + if( wmStateAbove != None )
- + {
- + XClientMessageEvent xclient;
- + memset( &xclient, 0, sizeof (xclient) );
- + xclient.type = ClientMessage;
- + xclient.window = fl_xid(shutdown_window);
- + xclient.message_type = wmNetWmState; //gdk_x11_get_xatom_by_name_for_display( display, "_NET_WM_STATE" );
- + xclient.format = 32;
- + xclient.data.l[0] = 1; //_NET_WM_STATE_ADD;
- + xclient.data.l[1] = wmStateAbove; //gdk_x11_atom_to_xatom_for_display (display, state1);
- + xclient.data.l[2] = 0; //gdk_x11_atom_to_xatom_for_display (display, state2);
- + xclient.data.l[3] = 0;
- + xclient.data.l[4] = 0;
- + //gdk_wmspec_change_state( FALSE, window,
- + // gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
- + // GDK_NONE );
- + XSendEvent(
- + fl_display,
- + DefaultRootWindow( fl_display ),
- + False,
- + SubstructureRedirectMask | SubstructureNotifyMask,
- + (XEvent *)&xclient
- + );
- + }
- return true;
- }
- +
- +void shutdown::timer_CB(void* myclass) {
- + shutdown *o = (shutdown*)myclass;
- + o->make_window_above();
- + Fl::repeat_timeout(5,timer_CB,myclass);
- +}
- === modified file 'fltk/jwm-shutdown.fld'
- --- fltk/jwm-shutdown.fld 2018-10-03 19:59:48 +0000
- +++ fltk/jwm-shutdown.fld 2018-11-06 13:40:34 +0000
- @@ -1,9 +1,9 @@
- # data file for the Fltk User Interface Designer (fluid)
- -version 1.0303
- -i18n_type 1
- -i18n_include <libintl.h>
- -i18n_function gettext
- -header_name {.h}
- +version 1.0304
- +i18n_type 1
- +i18n_include <libintl.h>
- +i18n_function gettext
- +header_name {.h}
- code_name {.cxx}
- comment {/* Joe's Window Manager Configuration
- *
- @@ -28,31 +28,31 @@
- * You may redistribute this, but you must keep this comment in place
- * Jesus is my Lord, and if you don't like it feel free to ignore it.
- */} {in_source in_header
- -}
- +}
-
- decl {\#include <libintl.h>} {public global
- -}
- +}
-
- decl {\#include <string>} {public global
- -}
- +}
-
- decl {\#include <stdlib.h>} {public global
- -}
- +}
-
- decl {\#include <iostream>} {public global
- -}
- +}
-
- decl {\#include <FL/x.H>} {public global
- -}
- +}
-
- decl {\#include <X11/Xlib.h>} {public global
- -}
- +}
-
- decl {\#include "../include/fltkfunctions.hpp"} {public global
- -}
- +}
-
- decl {\#include "../include/jwmrc.hpp"} {public global
- -}
- +}
-
- class shutdown {open : {public FLTK_FUNCTIONS}
- } {
- @@ -64,12 +64,12 @@
- SUSPEND="torios-suspend||dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend || systemctl suspend";
- LOGOUT="torios-exit || jwm -exit";
- SHUTDOWN="torios-shutdown || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop || systemctl poweroff";;
- -RESTART="torios-reboot || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart|| systemctl reboot";} {}
- +RESTART="torios-reboot || dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart|| systemctl reboot";
- +Fl::add_timeout(0.1,timer_CB,(void*)this);} {}
- Fl_Window shutdown_window {
- - label Shutdown open
- + label Shutdown open selected
- xywh {351 113 242 230} type Double color 45
- - code0 {window_bg();}
- - code1 {if(!make_window_above(o)){std::cerr<<"Couldn't make window work"<<std::endl;}} noborder xclass {system-shutdown} visible
- + code0 {window_bg();} noborder xclass {system-shutdown} visible
- } {
- Fl_Button shut {
- label Shutdown
- @@ -130,33 +130,60 @@
- //can->labelcolor(color2);
- under_mouse(shutdown_window);} {}
- }
- - Function {make_window_above(Fl_Window *o)} {open return_type bool
- + Function {make_window_above()} {open return_type bool
- } {
- code {Atom wmStateAbove = XInternAtom( fl_display, "_NET_WM_STATE_ABOVE", 1 );
- -if( wmStateAbove == None )
- +if( wmStateAbove != None )
- +{
- + std::cout<<"_NET_WM_STATE_ABOVE has atom of"<<wmStateAbove<<std::endl;
- +}
- +else
- +{
- + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE_ABOVE !"<<std::endl;
- return false;
- +}
- +
- Atom wmNetWmState = XInternAtom( fl_display, "_NET_WM_STATE", 1 );
- -if( wmNetWmState == None )
- +if( wmNetWmState != None )
- +{
- + std::cout<<"_NET_WM_STATE has atom of:"<<wmNetWmState<<std::endl;
- +}
- +else
- +{
- + std::cout<<"ERROR: cannot find atom for _NET_WM_STATE !"<<std::endl;
- return false;
- -
- -XClientMessageEvent xclient;
- -memset( &xclient, 0, sizeof (xclient) );
- -xclient.type = ClientMessage;
- -xclient.window = fl_xid(o);
- -xclient.message_type = wmNetWmState;
- -xclient.format = 32;
- -xclient.data.l[0] = 1;//_NET_WM_STATE_ADD;
- -xclient.data.l[1] = wmStateAbove;
- -xclient.data.l[2] = 0;
- -xclient.data.l[3] = 0;
- -xclient.data.l[4] = 0;
- -Window root = DefaultRootWindow( fl_display );
- -XSendEvent( fl_display,
- - root,
- - False,
- - SubstructureRedirectMask | SubstructureNotifyMask,
- - (XEvent *)&xclient );
- -return true;} {selected
- - }
- - }
- -}
- +}
- +// set window always on top hint
- +if( wmStateAbove != None )
- +{
- + XClientMessageEvent xclient;
- + memset( &xclient, 0, sizeof (xclient) );
- + xclient.type = ClientMessage;
- + xclient.window = fl_xid(shutdown_window);
- + xclient.message_type = wmNetWmState; //gdk_x11_get_xatom_by_name_for_display( display, "_NET_WM_STATE" );
- + xclient.format = 32;
- + xclient.data.l[0] = 1; //_NET_WM_STATE_ADD;
- + xclient.data.l[1] = wmStateAbove; //gdk_x11_atom_to_xatom_for_display (display, state1);
- + xclient.data.l[2] = 0; //gdk_x11_atom_to_xatom_for_display (display, state2);
- + xclient.data.l[3] = 0;
- + xclient.data.l[4] = 0;
- + //gdk_wmspec_change_state( FALSE, window,
- + // gdk_atom_intern_static_string ("_NET_WM_STATE_BELOW"),
- + // GDK_NONE );
- + XSendEvent(
- + fl_display,
- + DefaultRootWindow( fl_display ),
- + False,
- + SubstructureRedirectMask | SubstructureNotifyMask,
- + (XEvent *)&xclient
- + );
- +}
- +return true;} {}
- + }
- + Function {timer_CB(void* myclass)} {open return_type {static void}
- + } {
- + code {shutdown *o = (shutdown*)myclass;
- +o->make_window_above();
- +Fl::repeat_timeout(5,timer_CB,myclass);} {}
- + }
- +}
- === modified file 'fltk/jwm-shutdown.h'
- --- fltk/jwm-shutdown.h 2018-10-03 19:59:48 +0000
- +++ fltk/jwm-shutdown.h 2018-11-06 13:40:34 +0000
- @@ -21,7 +21,7 @@
- * You may redistribute this, but you must keep this comment in place
- * Jesus is my Lord, and if you don't like it feel free to ignore it.
- */
- -// generated by Fast Light User Interface Designer (fluid) version 1.0303
- +// generated by Fast Light User Interface Designer (fluid) version 1.0304
-
- #ifndef jwm_shutdown_h
- #define jwm_shutdown_h
- @@ -68,6 +68,7 @@
- static void cb_can(Fl_Button*, void*);
- public:
- void window_bg();
- - bool make_window_above(Fl_Window *o);
- + bool make_window_above();
- + static void timer_CB(void* myclass);
- };
- #endif
|