Cherry-picking upstream release 0.12.0.

* Switched to experimental
* Bumped Standards to 4.1.1 - no changes needed
* Bumped liblxqt dependency to >= 0.12.0
* Breaks and Replaces lxqt-common << 0.12.0
* Added dependency to lxqt-themes | lxqt-theme instead
ubuntu/cosmic debian/0.12.0-1
Alf Gaida 7 years ago
parent 6963916e29
commit 86a331dfe6

@ -4,7 +4,7 @@ Upstream Authors:
Copyright: Copyright:
Copyright (c) 2010-2012 Razor team Copyright (c) 2010-2012 Razor team
Copyright (c) 2012-2016 LXQt team Copyright (c) 2012-2017 LXQt team
License: LGPL-2.1+ License: LGPL-2.1+
The full text of the licenses can be found in the 'COPYING' file. The full text of the licenses can be found in the 'COPYING' file.

@ -1,7 +1,121 @@
lxqt-session-0.11.1 / 2017-01-01 lxqt-session-0.12.0 / 2017-10-21
================================ ================================
* Set patch version
* lxqt-session: Unify arguments parsing
* Don't export github templates
* Add/Update Lithuanian language
* c'n'p bug
* add basic cli to lxqt-session
* lxqt-session: Provide reboot/powerOff methods
* Drops Qt5Core_VERSION_STRING
* lxqt-config-session: set Qt::AA_UseHighDpiPixmaps to true
* lxqt-leave: set Qt::AA_UseHighDpiPixmaps to true
* improved --version
* Added QCommandLineParser and basic cli interface to lxqt-conf-session
* Added default CMAKE_BUILD_TYPE and LXQT_SESSION_PATCH_VERSION
* String encoding (#103)
* Fixes a FTBFS in superbuild mode (#102)
* lxqt-leave: Fix "disabled items" key navigation
* Address "unused parameter" compiler warnings
* lxqt-leave: Redesign dialog for good key navigation
* Removed superfluous include(LXQtTranslateDesktop)
* fixed config/CMakeLists.txt
* Merged relevant parts of CMakeLists.txt.lxqt-common into CMakeLists.txt
* Rename CMakeLists.txt -> CMakeLists.txt.lxqt-common
* Add Basque translation of lxqt-leave and update Basque translation of lxqt-config-session
* leavedialog: Use "expected" tab order
* LeaveDialog: Accept enter key for action/cancel firing
* LeaveDialog: Use "override" keyword
* leavedialog: Don't trigger "cancel" on Enter
* LeaveDialog: Use correct method
* startlxqt: Consider $XDG_RUNTIME_DIR/bus for DBus
* Updated *_da.desktop files and removed *_da_DK.desktop files
* Bump year
* Update desktop entries and Replace fr_FR by fr
* Use the LXQtConfigVars module
* Fixed typo
* Remove cpack (#61)
* startlxqt: Consider LXQT_DEFAULT_OPENBOX_CONFIG
* startlxqt: Honor the pre-defined SAL_USE_VLCPLUGIN
* Replace lxqt-rc.xml with latest openbox version
* startlxqt: Consider pre-exising LXDE OB config also
* build: Revert @6d6d2bef54
* build: Add xmessage as "dependency"
* Openbox: Fix informational message about adoption of rc.xml
* lxqt-rc.xml: Change default config install path
* startlxqt: Copy existing openbox config preferably
* Improves changed Openbox default path startup message (#51)
* Disable gtk+ 3 overlay scrollbars by default.
* Don't add XDG_DATA_HOME to XDG_DATA_DIRS (#47)
* Message about Openbox default path changed.
* Warning message about openbox settings path changed.
* startlxqt: Force XDG_CONFIG_DIRS to contain @LXQT_ETC_XDG_DIR@
* Copy openbox defaults at session start.
* Rename openbox/rc.xml to openbox/lxqt-openbox-rc.xml
* Openbox aero snap using mouse wheel over title bar.
* Settings Openbox updated.
* Default key shortcuts added to lxqt-globalkeysd.
* CMakeLists: Use LXQT_GRAPHICS_DIR for graphics
* Add startlxqt man page
* Fixes #807 Add XDG_CACHE_HOME definition
* startlxqt: optimization of XDG_DATA_DIRS
* corrected indentation
* startlxqt: Set proper prefix for XDG_DATA_DIRS
* Update Greek translation (el) Remove country variant from language code
* Rename LxQt to LXQt everywhere
* CMake: Adds Runtime and Devel install COMPONENTs
* Coding style changes
* Removes no added value comments
* Adds double quotes to everything that may break
* Use GNUINnstallDirs
* Updates the build system to use the Targets infrastructure
* Enable the "leave confirmation dialog" by default
* TryExec to detect proper installed lxqt-session
* Uniforms indentation
* Sets env variable XDG_CONFIG_DIRS
* Drops hardcoded /etc/xdg paths
* Set LibreOffice's plugin env var to kde4
* config: auto-detect succesfully kwin on recent kwin versions
* Updated german translation, replaced Qt4 by Qt in all xsession/translations
* Adds an scalable start-here-lxqt icon
* use LXQt-specific menu file
* Renames some .desktop files
* Portuguese update for .desktop files
* - Unify naming for a unique lxqt. No more suffixes
* Make frost the default theme
* Defines XDG_DATA_HOME and XDG_DATA_DIRS environment variables
* Updates translations infrastructure
* Update the required minimum cmake version
* Clean up CMakeLists.txt and drop Qt 4 support
* Set environment variable GTK_CSD=0 to turn off the default client side decoration for gtk+ 3 programs. (This will not always work if a gtk+3 program explicitly sets a title bar and turns on CSD.)
* Add some more default values for Qt settings.
* Update default config file.
* Add Qt5 support.
* Support Qt5 platform plugin and add some more comments.
* Remove XDG_CURRENT_DESKTOP=Razor from environment variables.
* Set XDG_CURRENT_DESKTOP to LXQt
* remove dead template lines switch OnlyShowIn from Razor -> LXQt stringchanges LxQt -> LXQt
* Use LXQt as desktop name
* Add CPack rules for creating tarball
* Add session.conf and windowmanagers.conf.
* Change XDG_CURRENT_DESKTOP to Razor for now. (May rename to LxQt or something else in the future.)
* Export environment varialbe QT_PLATFORM_PLUGIN=lxqt to let all Qt programs load lxqt-qtplugin and apply lxqt settings.
* Support lxqt-session and add necessary xdg autostart desktop entry files.
* Run lxde-qt with XDG_CURRENT_DESKTOP=RAZOR
* Fix renaming bugs, replacing lxqt-qt with lxde-qt
* Finish the crazy razor=>lxqt renaming tasks.
* Rename dirs and replace razor with lxqt. Install lxqt.conf to /etc/xdg/lxqt and provide theme config.
* Properly set default wallpaper for pcmanfm-qt. Comment out openbox config handling in startlxde-qt since it's not needed.
* Remove custom openbox config file in desktop.conf temporarily until lxsession is fixed.
* Fix file paths, replacing razor with lxqt. * Remove Alt+F2 and Ctrl+Esc from openbox config file to avoid conflicts with lxqt-panel & lxqt-globalkeys.
* Add default configuration files for lxde-qt session.
0.11.1 / 2017-01-01
===================
* Release 0.11.1: Update changelog
* Adds an nullptr check when restarting a module (#90) * Adds an nullptr check when restarting a module (#90)
* Fixes a session logout crash (#88) * Fixes a session logout crash (#88)
* Updated da.desktop files and removed da_DK.desktop files * Updated da.desktop files and removed da_DK.desktop files

@ -17,10 +17,10 @@ option(WITH_LIBUDEV "Build with libudev support" ON)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
find_package(Qt5DBus REQUIRED) find_package(Qt5DBus REQUIRED)
find_package(Qt5LinguistTools REQUIRED QUIET) find_package(Qt5LinguistTools REQUIRED)
find_package(Qt5Widgets REQUIRED) find_package(Qt5Widgets REQUIRED)
find_package(Qt5X11Extras REQUIRED) find_package(Qt5X11Extras REQUIRED)
message(STATUS "Building with Qt${Qt5Core_VERSION_STRING}") message(STATUS "Building with Qt${Qt5Core_VERSION}")
find_package(KF5WindowSystem REQUIRED) find_package(KF5WindowSystem REQUIRED)
@ -29,6 +29,16 @@ find_package(lxqt REQUIRED)
# Please don't move, must be after lxqt # Please don't move, must be after lxqt
find_package(XdgUserDirs REQUIRED) find_package(XdgUserDirs REQUIRED)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# Patch Version
set(LXQT_SESSION_PATCH_VERSION 0)
set(LXQT_SESSION_VERSION ${LXQT_MAJOR_VERSION}.${LXQT_MINOR_VERSION}.${LXQT_SESSION_PATCH_VERSION})
add_definitions("-DLXQT_SESSION_VERSION=\"${LXQT_SESSION_VERSION}\"")
include(LXQtCompilerSettings NO_POLICY_SCOPE) include(LXQtCompilerSettings NO_POLICY_SCOPE)
# Translations ********************************** # Translations **********************************
@ -37,3 +47,32 @@ include(LXQtTranslate)
add_subdirectory(lxqt-session) add_subdirectory(lxqt-session)
add_subdirectory(lxqt-config-session) add_subdirectory(lxqt-config-session)
add_subdirectory(lxqt-leave) add_subdirectory(lxqt-leave)
# merged from lxqt-common
include(LXQtConfigVars)
# startlxqt script
set(PREDEF_XDG_DATA_DIRS "$XDG_DATA_HOME")
if(NOT("${LXQT_DATA_DIR}" MATCHES "^/usr(/local)?/share$"))
set(PREDEF_XDG_DATA_DIRS "${PREDEF_XDG_DATA_DIRS}:${LXQT_DATA_DIR}")
endif()
set(PREDEF_XDG_DATA_DIRS "${PREDEF_XDG_DATA_DIRS}:/usr/local/share:/usr/share")
configure_file(startlxqt.in startlxqt @ONLY)
install(PROGRAMS
"${CMAKE_CURRENT_BINARY_DIR}/startlxqt"
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT Runtime
)
install(FILES
startlxqt.1
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
COMPONENT Runtime
)
# default config files
add_subdirectory(config)
add_subdirectory(autostart)
# xsession *.desktop file for display managers
add_subdirectory(xsession)

@ -0,0 +1,27 @@
include(LXQtTranslateDesktop)
include(LXQtConfigVars)
# startlxqt script
set(PREDEF_XDG_DATA_DIRS "$XDG_DATA_HOME")
if(NOT("${LXQT_DATA_DIR}" MATCHES "^/usr(/local)?/share$"))
set(PREDEF_XDG_DATA_DIRS "${PREDEF_XDG_DATA_DIRS}:${LXQT_DATA_DIR}")
endif()
set(PREDEF_XDG_DATA_DIRS "${PREDEF_XDG_DATA_DIRS}:/usr/local/share:/usr/share")
configure_file(startlxqt.in startlxqt @ONLY)
install(PROGRAMS
"${CMAKE_CURRENT_BINARY_DIR}/startlxqt"
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT Runtime
)
install(FILES
startlxqt.1
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
COMPONENT Runtime
)
# default config files
add_subdirectory(config)
add_subdirectory(autostart)
# xsession *.desktop file for display managers
add_subdirectory(xsession)

@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
file(GLOB DESKTOP_FILES_IN *.desktop.in)
# Translations **********************************
lxqt_translate_desktop(DESKTOP_FILES
SOURCES
${DESKTOP_FILES_IN}
)
add_custom_target(lxqt_sesstion_autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES})
#************************************************
install(FILES
${DESKTOP_FILES}
DESTINATION "${LXQT_ETC_XDG_DIR}/autostart"
COMPONENT Runtime
)

@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=XScreenSaver
TryExec=xscreensaver
Exec=xscreensaver -no-splash
OnlyShowIn=LXQt;
#TRANSLATIONS_DIR=translations

@ -0,0 +1,2 @@
# Translations
Name[ar]=حافظ الشَّاشة

@ -0,0 +1,2 @@
# Translations
Name[cs]=Šetřič obrazovky

@ -0,0 +1,2 @@
# Translations
Name[cs_CZ]=Šetřič obrazovky

@ -0,0 +1,2 @@
# Translations
Name[da]=Pauseskærm

@ -0,0 +1,2 @@
# Translations
Name[de]=Bildschirmschoner

@ -0,0 +1,2 @@
# Translations
Name[el]=ΠροφύλαξηOθόνηςΧ

@ -0,0 +1,2 @@
# Translations
Name[eo]=XEkranKurteno

@ -0,0 +1,2 @@
# Translations
Name[es]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[es_VE]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[eu]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[fi]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[fr_FR]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[id_ID]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[it_IT]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[ja]=Xスクリーンセーバ

@ -0,0 +1,2 @@
# Translations
Name[lt]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[nl]=X-schermbeveiliging

@ -0,0 +1,2 @@
# Translations
Name[pl_PL]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[pt]=Proteção de ecrã

@ -0,0 +1,2 @@
# Translations
Name[pt_BR]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[ro_RO]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[ru]=XэкранCпаситель

@ -0,0 +1,2 @@
# Translations
Name[ru_RU]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[sl]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[sr]=Икс-ЧуварЕкрана

@ -0,0 +1 @@
Name[sr@ijekavian]=Икс-ЧуварЕкрана

@ -0,0 +1,2 @@
# Translations
Name[sr@latin]=Iks-ČuvarEkrana

@ -0,0 +1,2 @@
# Translations
Name[th_TH]=โปรแกรมรักษาหน้าจอของX

@ -0,0 +1,2 @@
# Translations
Name[tr]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[uk]=XScreenSaver

@ -0,0 +1,2 @@
# Translations
Name[zh_TW]=螢幕保護程式

@ -0,0 +1,12 @@
# install default config files to /etc/xdg
install(FILES
lxqt.conf
session.conf
windowmanagers.conf
DESTINATION "${LXQT_ETC_XDG_DIR}/lxqt"
COMPONENT Runtime
)
install(DIRECTORY openbox
DESTINATION "${LXQT_ETC_XDG_DIR}"
COMPONENT Runtime
)

@ -0,0 +1,11 @@
[General]
theme=frost
icon_theme=oxygen
single_click_activate=false
tool_button_style=ToolButtonTextBesideIcon
[Qt]
font="Sans,11,-1,5,50,0,0,0,0,0"
doubleClickInterval=400
style=Fusion
wheelScrollLines=3

@ -0,0 +1,744 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/lxqt-rc.xml instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc"
xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
<!-- always try to focus new windows when they appear. other rules do
apply -->
<followMouse>no</followMouse>
<!-- move focus to a window when you move the mouse into it -->
<focusLast>yes</focusLast>
<!-- focus the last used window when changing desktops, instead of the one
under the mouse pointer. when followMouse is enabled -->
<underMouse>no</underMouse>
<!-- move focus under the mouse, even when the mouse is not moving -->
<focusDelay>200</focusDelay>
<!-- when followMouse is enabled, the mouse must be inside the window for
this many milliseconds (1000 = 1 sec) before moving focus to it -->
<raiseOnFocus>no</raiseOnFocus>
<!-- when followMouse is enabled, and a window is given focus by moving the
mouse into it, also raise the window -->
</focus>
<placement>
<policy>Smart</policy>
<!-- 'Smart' or 'UnderMouse' -->
<center>yes</center>
<!-- whether to place windows in the center of the free area found or
the top left corner -->
<monitor>Primary</monitor>
<!-- with Smart placement on a multi-monitor system, try to place new windows
on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
the active window is, 'Primary' - only on the primary monitor -->
<primaryMonitor>1</primaryMonitor>
<!-- The monitor where Openbox should place popup dialogs such as the
focus cycling popup, or the desktop switch popup. It can be an index
from 1, specifying a particular monitor. Or it can be one of the
following: 'Mouse' - where the mouse is, or
'Active' - where the active window is -->
</placement>
<theme>
<name>Onyx</name>
<titleLayout>NLIMC</titleLayout>
<!--
available characters are NDSLIMC, each can occur at most once.
N: window icon
L: window label (AKA title).
I: iconify
M: maximize
C: close
S: shade (roll up/down)
D: omnipresent (on all desktops).
-->
<keepBorder>yes</keepBorder>
<animateIconify>yes</animateIconify>
<font place="ActiveWindow">
<name>sans</name>
<size>10</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="InactiveWindow">
<name>sans</name>
<size>10</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="MenuHeader">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>normal</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="MenuItem">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>normal</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="ActiveOnScreenDisplay">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="InactiveOnScreenDisplay">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
</theme>
<desktops>
<!-- this stuff is only used at startup, pagers allow you to change them
during a session
these are default values to use when other ones are not already set
by other applications, or saved in your session
use obconf if you want to change these without having to log out
and back in -->
<number>2</number>
<firstdesk>1</firstdesk>
<names>
<!-- set names up here if you want to, like this:
<name>desktop 1</name>
<name>desktop 2</name>
-->
</names>
<popupTime>875</popupTime>
<!-- The number of milliseconds to show the popup for when switching
desktops. Set this to 0 to disable the popup. -->
</desktops>
<resize>
<drawContents>yes</drawContents>
<popupShow>Nonpixel</popupShow>
<!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
<popupPosition>Center</popupPosition>
<!-- 'Center', 'Top', or 'Fixed' -->
<popupFixedPosition>
<!-- these are used if popupPosition is set to 'Fixed' -->
<x>10</x>
<!-- positive number for distance from left edge, negative number for
distance from right edge, or 'Center' -->
<y>10</y>
<!-- positive number for distance from top edge, negative number for
distance from bottom edge, or 'Center' -->
</popupFixedPosition>
</resize>
<!-- You can reserve a portion of your screen where windows will not cover when
they are maximized, or when they are initially placed.
Many programs reserve space automatically, but you can use this in other
cases. -->
<margins>
<top>0</top>
<bottom>0</bottom>
<left>0</left>
<right>0</right>
</margins>
<dock>
<position>TopLeft</position>
<!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
<floatingX>0</floatingX>
<floatingY>0</floatingY>
<noStrut>no</noStrut>
<stacking>Above</stacking>
<!-- 'Above', 'Normal', or 'Below' -->
<direction>Vertical</direction>
<!-- 'Vertical' or 'Horizontal' -->
<autoHide>no</autoHide>
<hideDelay>300</hideDelay>
<!-- in milliseconds (1000 = 1 second) -->
<showDelay>300</showDelay>
<!-- in milliseconds (1000 = 1 second) -->
<moveButton>Middle</moveButton>
<!-- 'Left', 'Middle', 'Right' -->
</dock>
<keyboard>
<chainQuitKey>C-g</chainQuitKey>
<!-- Keybindings for desktop switching -->
<keybind key="C-A-Left">
<action name="GoToDesktop"><to>left</to><wrap>no</wrap></action>
</keybind>
<keybind key="C-A-Right">
<action name="GoToDesktop"><to>right</to><wrap>no</wrap></action>
</keybind>
<keybind key="C-A-Up">
<action name="GoToDesktop"><to>up</to><wrap>no</wrap></action>
</keybind>
<keybind key="C-A-Down">
<action name="GoToDesktop"><to>down</to><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Left">
<action name="SendToDesktop"><to>left</to><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Right">
<action name="SendToDesktop"><to>right</to><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Up">
<action name="SendToDesktop"><to>up</to><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Down">
<action name="SendToDesktop"><to>down</to><wrap>no</wrap></action>
</keybind>
<keybind key="W-F1">
<action name="GoToDesktop"><to>1</to></action>
</keybind>
<keybind key="W-F2">
<action name="GoToDesktop"><to>2</to></action>
</keybind>
<keybind key="W-F3">
<action name="GoToDesktop"><to>3</to></action>
</keybind>
<keybind key="W-F4">
<action name="GoToDesktop"><to>4</to></action>
</keybind>
<keybind key="W-d">
<action name="ToggleShowDesktop"/>
</keybind>
<!-- Keybindings for windows -->
<keybind key="A-F4">
<action name="Close"/>
</keybind>
<keybind key="A-Escape">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</keybind>
<keybind key="A-space">
<action name="ShowMenu"><menu>client-menu</menu></action>
</keybind>
<!-- Keybindings for window switching -->
<keybind key="A-Tab">
<action name="NextWindow">
<finalactions>
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</finalactions>
</action>
</keybind>
<keybind key="A-S-Tab">
<action name="PreviousWindow">
<finalactions>
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</finalactions>
</action>
</keybind>
<keybind key="C-A-Tab">
<action name="NextWindow">
<panels>yes</panels><desktop>yes</desktop>
<finalactions>
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</finalactions>
</action>
</keybind>
<!-- Keybindings for window switching with the arrow keys -->
<keybind key="W-S-Right">
<action name="DirectionalCycleWindows">
<direction>right</direction>
</action>
</keybind>
<keybind key="W-S-Left">
<action name="DirectionalCycleWindows">
<direction>left</direction>
</action>
</keybind>
<keybind key="W-S-Up">
<action name="DirectionalCycleWindows">
<direction>up</direction>
</action>
</keybind>
<keybind key="W-S-Down">
<action name="DirectionalCycleWindows">
<direction>down</direction>
</action>
</keybind>
<!-- Keybindings for running applications.
Commented out as application shortcuts should be handled by lxqt-globalkeys in LXQt sessions.
<keybind key="W-q">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>Qupzilla</name>
</startupnotify>
<command>qupzilla</command>
</action>
</keybind> -->
</keyboard>
<mouse>
<dragThreshold>1</dragThreshold>
<!-- number of pixels the mouse must move before a drag begins -->
<doubleClickTime>500</doubleClickTime>
<!-- in milliseconds (1000 = 1 second) -->
<screenEdgeWarpTime>400</screenEdgeWarpTime>
<!-- Time before changing desktops when the pointer touches the edge of the
screen while moving a window, in milliseconds (1000 = 1 second).
Set this to 0 to disable warping -->
<screenEdgeWarpMouse>false</screenEdgeWarpMouse>
<!-- Set this to TRUE to move the mouse pointer across the desktop when
switching due to hitting the edge of the screen -->
<context name="Frame">
<mousebind button="A-Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="A-Left" action="Click">
<action name="Unshade"/>
</mousebind>
<mousebind button="A-Left" action="Drag">
<action name="Move"/>
</mousebind>
<mousebind button="A-Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="A-Right" action="Drag">
<action name="Resize"/>
</mousebind>
<mousebind button="A-Middle" action="Press">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="C-A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="C-A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="A-S-Up" action="Click">
<action name="SendToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-S-Down" action="Click">
<action name="SendToDesktop"><to>next</to></action>
</mousebind>
</context>
<context name="Titlebar">
<mousebind button="Left" action="Drag">
<action name="Move"/>
</mousebind>
<mousebind button="Left" action="DoubleClick">
<action name="ToggleMaximize"/>
</mousebind>
<mousebind button="Up" action="Click">
<action name="if">
<shaded>no</shaded>
<then>
<action name="Shade"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
<action name="Lower"/>
</then>
</action>
</mousebind>
<mousebind button="Down" action="Click">
<action name="if">
<shaded>yes</shaded>
<then>
<action name="Unshade"/>
<action name="Raise"/>
</then>
</action>
</mousebind>
</context>
<context name="Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
</context>
<context name="Top">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>top</edge></action>
</mousebind>
</context>
<context name="Left">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>left</edge></action>
</mousebind>
</context>
<context name="Right">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>right</edge></action>
</mousebind>
</context>
<context name="Bottom">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>bottom</edge></action>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
</context>
<context name="TRCorner BRCorner TLCorner BLCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize"/>
</mousebind>
</context>
<context name="Client">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
</context>
<context name="Icon">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
</context>
<context name="AllDesktops">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleOmnipresent"/>
</mousebind>
</context>
<context name="Shade">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleShade"/>
</mousebind>
</context>
<context name="Iconify">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="Iconify"/>
</mousebind>
</context>
<context name="Maximize">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleMaximize"/>
</mousebind>
<mousebind button="Middle" action="Click">
<action name="ToggleMaximize"><direction>vertical</direction></action>
</mousebind>
<mousebind button="Right" action="Click">
<action name="ToggleMaximize"><direction>horizontal</direction></action>
</mousebind>
</context>
<context name="Close">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="Close"/>
</mousebind>
</context>
<context name="Desktop">
<mousebind button="Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="C-A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="C-A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
</context>
<context name="Root">
<!-- Menus -->
<mousebind button="Middle" action="Press">
<action name="ShowMenu"><menu>client-list-combined-menu</menu></action>
</mousebind>
<mousebind button="Right" action="Press">
<action name="ShowMenu"><menu>root-menu</menu></action>
</mousebind>
</context>
<context name="MoveResize">
<mousebind button="Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
</context>
</mouse>
<menu>
<!-- You can specify more than one menu file in here and they are all loaded,
just don't make menu ids clash or, well, it'll be kind of pointless -->
<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
<file>menu.xml</file>
<hideDelay>200</hideDelay>
<!-- if a press-release lasts longer than this setting (in milliseconds), the
menu is hidden again -->
<middle>no</middle>
<!-- center submenus vertically about the parent entry -->
<submenuShowDelay>100</submenuShowDelay>
<!-- time to delay before showing a submenu after hovering over the parent
entry.
if this is a negative value, then the delay is infinite and the
submenu will not be shown until it is clicked on -->
<submenuHideDelay>400</submenuHideDelay>
<!-- time to delay before hiding a submenu when selecting another
entry in parent menu
if this is a negative value, then the delay is infinite and the
submenu will not be hidden until a different submenu is opened -->
<showIcons>yes</showIcons>
<!-- controls if icons appear in the client-list-(combined-)menu -->
<manageDesktops>yes</manageDesktops>
<!-- show the manage desktops section in the client-list-(combined-)menu -->
</menu>
<applications>
<!--
# this is an example with comments through out. use these to make your
# own rules, but without the comments of course.
# you may use one or more of the name/class/role/title/type rules to specify
# windows to match
<application name="the window's _OB_APP_NAME property (see obxprop)"
class="the window's _OB_APP_CLASS property (see obxprop)"
groupname="the window's _OB_APP_GROUP_NAME property (see obxprop)"
groupclass="the window's _OB_APP_GROUP_CLASS property (see obxprop)"
role="the window's _OB_APP_ROLE property (see obxprop)"
title="the window's _OB_APP_TITLE property (see obxprop)"
type="the window's _OB_APP_TYPE property (see obxprob)..
(if unspecified, then it is 'dialog' for child windows)">
# you may set only one of name/class/role/title/type, or you may use more
# than one together to restrict your matches.
# the name, class, role, and title use simple wildcard matching such as those
# used by a shell. you can use * to match any characters and ? to match
# any single character.
# the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
# or desktop
# when multiple rules match a window, they will all be applied, in the
# order that they appear in this list
# each rule element can be left out or set to 'default' to specify to not
# change that attribute of the window
<decor>yes</decor>
# enable or disable window decorations
<shade>no</shade>
# make the window shaded when it appears, or not
<position force="no">
# the position is only used if both an x and y coordinate are provided
# (and not set to 'default')
# when force is "yes", then the window will be placed here even if it
# says you want it placed elsewhere. this is to override buggy
# applications who refuse to behave
<x>center</x>
# a number like 50, or 'center' to center on screen. use a negative number
# to start from the right (or bottom for <y>), ie -50 is 50 pixels from
# the right edge (or bottom). use 'default' to specify using value
# provided by the application, or chosen by openbox, instead.
<y>200</y>
<monitor>1</monitor>
# specifies the monitor in a xinerama setup.
# 1 is the first head, or 'mouse' for wherever the mouse is
</position>
<size>
# the size to make the window.
<width>20</width>
# a number like 20, or 'default' to use the size given by the application.
# you can use fractions such as 1/2 or percentages such as 75% in which
# case the value is relative to the size of the monitor that the window
# appears on.
<height>30%</height>
</size>
<focus>yes</focus>
# if the window should try be given focus when it appears. if this is set
# to yes it doesn't guarantee the window will be given focus. some
# restrictions may apply, but Openbox will try to
<desktop>1</desktop>
# 1 is the first desktop, 'all' for all desktops
<layer>normal</layer>
# 'above', 'normal', or 'below'
<iconic>no</iconic>
# make the window iconified when it appears, or not
<skip_pager>no</skip_pager>
# asks to not be shown in pagers
<skip_taskbar>no</skip_taskbar>
# asks to not be shown in taskbars. window cycling actions will also
# skip past such windows
<fullscreen>yes</fullscreen>
# make the window in fullscreen mode when it appears
<maximized>true</maximized>
# 'Horizontal', 'Vertical' or boolean (yes/no)
</application>
# end of the example
-->
</applications>
</openbox_config>

@ -0,0 +1,24 @@
[General]
window_manager=openbox
leave_confirmation=true
[Environment]
GTK_CSD=0
GTK_OVERLAY_SCROLLING=0
[Mouse]
cursor_size=18
cursor_theme=whiteglass
acc_factor=20
acc_threshold=10
left_handed=false
[Keyboard]
delay=500
interval=30
beep=false
[Font]
antialias=true
hinting=true
dpi=96

@ -0,0 +1,26 @@
[KnownManagers]
openbox/Name=Openbox
openbox/Comment=Light-weight window manager
kwin/Name=KWin
kwin/Comment=Window manager of the KDE Software Compilation
kwin_x11/Name=KWin
kwin_x11/Comment=Window manager of the KDE Software Compilation
metacity/Name=Metacity
metacity/Comment=Window manager of the GNOME desktop environment
windowmaker/Name=Windowmaker
windowmaker/Comment=A classical lightweight window manager
e16/Name=Enlightenement 16
fvwm2/Name=Fvwm2
fvwm2/Comment=A classical lightweight window manager
xfwm4/Name=Xfwm4
xfwm4/Comment=A window manager for the Xfce desktop environment
sawfish/Name=Sawfish
sawfish/Comment="A lightweight, flexible window manager"

11
debian/changelog vendored

@ -1,3 +1,14 @@
lxqt-session (0.12.0-1) experimental; urgency=medium
* Cherry-picking upstream release 0.12.0.
* Switched to experimental
* Bumped Standards to 4.1.1 - no changes needed
* Bumped liblxqt dependency to >= 0.12.0
* Breaks and Replaces lxqt-common << 0.12.0
* Added dependency to lxqt-themes | lxqt-theme instead
-- Alf Gaida <agaida@siduction.org> Tue, 24 Oct 2017 21:17:51 +0200
lxqt-session (0.11.1-6) unstable; urgency=medium lxqt-session (0.11.1-6) unstable; urgency=medium
* Moved lxqt-qtplugin to dependencies (Closes: #870138) * Moved lxqt-qtplugin to dependencies (Closes: #870138)

12
debian/control vendored

@ -7,22 +7,22 @@ Section: x11
Priority: optional Priority: optional
Build-Depends: debhelper (>= 10), Build-Depends: debhelper (>= 10),
libkf5windowsystem-dev, libkf5windowsystem-dev,
liblxqt0-dev (>= 0.11.1), liblxqt0-dev (>= 0.12.0),
libqt5svg5-dev, libqt5svg5-dev,
libqt5x11extras5-dev, libqt5x11extras5-dev,
libudev-dev [linux-any], libudev-dev [linux-any],
libx11-dev, libx11-dev,
xdg-user-dirs xdg-user-dirs
Standards-Version: 4.0.0 Standards-Version: 4.1.1
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-session.git/?h=debian/sid Vcs-Browser: https://anonscm.debian.org/cgit/pkg-lxqt/lxqt-session.git/?h=debian/experimental
Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-session.git -b debian/sid Vcs-Git: https://anonscm.debian.org/git/pkg-lxqt/lxqt-session.git -b debian/experimental
Homepage: https://github.com/lxde/lxqt-session Homepage: https://github.com/lxde/lxqt-session
Package: lxqt-session Package: lxqt-session
Architecture: any Architecture: any
Depends: ${misc:Depends}, Depends: ${misc:Depends},
${shlibs:Depends}, ${shlibs:Depends},
lxqt-common, lxqt-themes | lxqt-theme,
lxqt-qtplugin, lxqt-qtplugin,
x11-xkb-utils x11-xkb-utils
Recommends: lxqt-session-l10n, Recommends: lxqt-session-l10n,
@ -36,6 +36,8 @@ Recommends: lxqt-session-l10n,
qps [linux-any], qps [linux-any],
xscreensaver | gnome-screensaver | light-locker | i3lock | suckless-tools xscreensaver | gnome-screensaver | light-locker | i3lock | suckless-tools
Provides: x-session-manager Provides: x-session-manager
Breaks: lxqt-common (<< 0.12.0)
Replaces: lxqt-common (<< 0.12.0)
Description: session manager component for LXQt Description: session manager component for LXQt
LXQt is an advanced, easy-to-use, and fast desktop environment based on LXQt is an advanced, easy-to-use, and fast desktop environment based on
Qt technologies. It has been tailored for users who value simplicity, Qt technologies. It has been tailored for users who value simplicity,

@ -29,12 +29,24 @@
#include <XdgIcon> #include <XdgIcon>
#include <LXQt/Settings> #include <LXQt/Settings>
#include <QCommandLineParser>
#include "sessionconfigwindow.h" #include "sessionconfigwindow.h"
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
LXQt::SingleApplication a(argc, argv); LXQt::SingleApplication a(argc, argv);
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QCommandLineParser parser;
parser.setApplicationDescription(QStringLiteral("LXQt Config Session"));
const QString VERINFO = QStringLiteral(LXQT_SESSION_VERSION
"\nliblxqt " LXQT_VERSION
"\nQt " QT_VERSION_STR);
a.setApplicationVersion(VERINFO);
parser.addVersionOption();
parser.addHelpOption();
parser.process(a);
SessionConfigWindow w; SessionConfigWindow w;
a.setActivationWindow(&w); a.setActivationWindow(&w);

@ -1,4 +1,4 @@
# Translations # Translations
Comment[eu]=Konfiguratu LXQt saioaren modulua Comment[eu]=LXQt saioen konfigurazioa
GenericName[eu]=LXQt saioaren konfiguratzailea GenericName[eu]=LXQt saioaren ezarpenak
Name[eu]=LXQt saioaren konfiguratzailea Name[eu]=Saioaren ezarpenak

@ -1,4 +1,4 @@
# Translations # Translations
Comment[lt]=Konfigūruoti LXQt sesijų modulį Comment[lt]=LXQt seansų konfigūravimas
GenericName[lt]=LXQt sesijų konfigūravimas GenericName[lt]=LXQt seansų nustatymai
Name[lt]=LXQt sesijų konfigūravimas Name[lt]=Seanso nustatymai

@ -3,10 +3,12 @@ project(lxqt-leave)
set(CPP_FILES set(CPP_FILES
main.cpp main.cpp
leavedialog.cpp leavedialog.cpp
listwidget.cpp
) )
set(H_FILES set(H_FILES
leavedialog.h leavedialog.h
listwidget.h
) )
set(UI_FILES set(UI_FILES

@ -26,6 +26,7 @@
* END_COMMON_COPYRIGHT_HEADER */ * END_COMMON_COPYRIGHT_HEADER */
#include "leavedialog.h" #include "leavedialog.h"
#include <QListWidgetItem>
LeaveDialog::LeaveDialog(QWidget* parent) LeaveDialog::LeaveDialog(QWidget* parent)
: QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint), : QDialog(parent, Qt::Dialog | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint),
@ -46,47 +47,76 @@ LeaveDialog::LeaveDialog(QWidget* parent)
setWindowFlags((Qt::CustomizeWindowHint | Qt::FramelessWindowHint | setWindowFlags((Qt::CustomizeWindowHint | Qt::FramelessWindowHint |
Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint)); Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint));
ui->logoutButton->setEnabled(mPower->canAction(LXQt::Power::PowerLogout)); // populate the items
ui->rebootButton->setEnabled(mPower->canAction(LXQt::Power::PowerReboot)); QListWidgetItem * item = new QListWidgetItem{QIcon::fromTheme(QStringLiteral("system-log-out")), tr("Logout")};
ui->shutdownButton->setEnabled(mPower->canAction(LXQt::Power::PowerShutdown)); item->setData(Qt::UserRole, LXQt::Power::PowerLogout);
ui->suspendButton->setEnabled(mPower->canAction(LXQt::Power::PowerSuspend)); if (!mPower->canAction(LXQt::Power::PowerLogout))
ui->hibernateButton->setEnabled(mPower->canAction(LXQt::Power::PowerHibernate)); item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
ui->listWidget->addItem(item);
item = new QListWidgetItem{QIcon::fromTheme(QStringLiteral("system-shutdown")), tr("Shutdown")};
item->setData(Qt::UserRole, LXQt::Power::PowerShutdown);
if (!mPower->canAction(LXQt::Power::PowerShutdown))
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
ui->listWidget->addItem(item);
item = new QListWidgetItem{QIcon::fromTheme(QStringLiteral("system-suspend")), tr("Suspend")};
item->setData(Qt::UserRole, LXQt::Power::PowerSuspend);
if (!mPower->canAction(LXQt::Power::PowerSuspend))
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
ui->listWidget->addItem(item);
item = new QListWidgetItem{QIcon::fromTheme(QStringLiteral("system-lock-screen")), tr("Lock screen")};
item->setData(Qt::UserRole, -1);
ui->listWidget->addItem(item);
item = new QListWidgetItem{QIcon::fromTheme(QStringLiteral("system-reboot")), tr("Reboot")};
item->setData(Qt::UserRole, LXQt::Power::PowerReboot);
if (!mPower->canAction(LXQt::Power::PowerReboot))
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
ui->listWidget->addItem(item);
item = new QListWidgetItem{QIcon::fromTheme(QStringLiteral("system-suspend-hibernate")), tr("Hibernate")};
item->setData(Qt::UserRole, LXQt::Power::PowerHibernate);
if (!mPower->canAction(LXQt::Power::PowerHibernate))
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
ui->listWidget->addItem(item);
/* ui->listWidget->setRows(2);
* Make all the buttons have equal widths ui->listWidget->setColumns(3);
*/
QVector<QToolButton*> buttons(6);
buttons[0] = ui->logoutButton;
buttons[1] = ui->lockscreenButton;
buttons[2] = ui->suspendButton;
buttons[3] = ui->hibernateButton;
buttons[4] = ui->rebootButton;
buttons[5] = ui->shutdownButton;
int maxWidth = 0; connect(ui->listWidget, &QAbstractItemView::activated, this, [this] (const QModelIndex & index) {
const int N = buttons.size(); bool ok = false;
for (int i = 0; i < N; ++i) { const int action = index.data(Qt::UserRole).toInt(&ok);
// Make sure that the button size is adjusted to the text width if (!ok)
buttons.at(i)->adjustSize(); {
maxWidth = qMax(maxWidth, buttons.at(i)->width()); qWarning("Invalid internal logic, no UserRole set!?");
return;
} }
for (int i = 0; i < N; ++i)
buttons.at(i)->setMinimumWidth(maxWidth);
connect(ui->logoutButton, &QPushButton::clicked, [&] { close(); mPowerManager->logout(); });
connect(ui->rebootButton, &QPushButton::clicked, [&] { close(); mPowerManager->reboot(); });
connect(ui->shutdownButton, &QPushButton::clicked, [&] { close(); mPowerManager->shutdown(); });
connect(ui->suspendButton, &QPushButton::clicked, [&] { close(); mPowerManager->suspend(); });
connect(ui->hibernateButton, &QPushButton::clicked, [&] { close(); mPowerManager->hibernate(); });
connect(ui->cancelButton, &QPushButton::clicked, [&] { close(); });
connect(ui->lockscreenButton, &QPushButton::clicked, [&] {
close(); close();
switch (action)
{
case LXQt::Power::PowerLogout:
mPowerManager->logout();
break;
case LXQt::Power::PowerShutdown:
mPowerManager->shutdown();
break;
case LXQt::Power::PowerSuspend:
mPowerManager->suspend();
break;
case -1:
{
QEventLoop loop; QEventLoop loop;
connect(mScreensaver, &LXQt::ScreenSaver::done, &loop, &QEventLoop::quit); connect(mScreensaver, &LXQt::ScreenSaver::done, &loop, &QEventLoop::quit);
mScreensaver->lockScreen(); mScreensaver->lockScreen();
loop.exec(); loop.exec();
}
break;
case LXQt::Power::PowerReboot:
mPowerManager->reboot();
break;
case LXQt::Power::PowerHibernate:
mPowerManager->hibernate();
break;
}
}); });
connect(ui->cancelButton, &QAbstractButton::clicked, this, [this] { close(); });
} }
LeaveDialog::~LeaveDialog() LeaveDialog::~LeaveDialog()
@ -94,7 +124,7 @@ LeaveDialog::~LeaveDialog()
delete ui; delete ui;
} }
void LeaveDialog::resizeEvent(QResizeEvent* event) void LeaveDialog::resizeEvent(QResizeEvent* /*event*/)
{ {
QRect screen = QApplication::desktop()->screenGeometry(); QRect screen = QApplication::desktop()->screenGeometry();
move((screen.width() - this->width()) / 2, move((screen.width() - this->width()) / 2,

@ -49,7 +49,7 @@ public:
~LeaveDialog(); ~LeaveDialog();
protected: protected:
virtual void resizeEvent(QResizeEvent* event); virtual void resizeEvent(QResizeEvent* event) override;
private: private:
Ui::LeaveDialog *ui; Ui::LeaveDialog *ui;

@ -20,7 +20,16 @@
<string>Leave</string> <string>Leave</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0"> <property name="bottomMargin">
<number>9</number>
</property>
<property name="horizontalSpacing">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>18</number>
</property>
<item row="3" column="0">
<widget class="QWidget" name="widget_2" native="true"> <widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
@ -37,7 +46,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="cancelButton"> <widget class="QToolButton" name="cancelButton">
<property name="text"> <property name="text">
<string>Cancel</string> <string>Cancel</string>
</property> </property>
@ -45,6 +54,9 @@
<iconset theme="dialog-cancel"> <iconset theme="dialog-cancel">
<normaloff>.</normaloff>.</iconset> <normaloff>.</normaloff>.</iconset>
</property> </property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -67,80 +79,37 @@
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QWidget" name="buttonsWidget" native="true"> <widget class="ListWidget" name="listWidget">
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>12</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<item alignment="Qt::AlignHCenter">
<widget class="QToolButton" name="logoutButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum> <enum>Qt::NoContextMenu</enum>
</property> </property>
<property name="text"> <property name="styleSheet">
<string>Logout</string> <string notr="true">#listWidget { background-color: palette(window); }
QAbstractItemView { activate-on-singleclick: 1; }</string>
</property> </property>
<property name="icon"> <property name="frameShape">
<iconset theme="system-log-out"> <enum>QFrame::NoFrame</enum>
<normaloff>.</normaloff>.</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property> </property>
</widget> <property name="verticalScrollBarPolicy">
</item> <enum>Qt::ScrollBarAlwaysOff</enum>
<item alignment="Qt::AlignHCenter">
<widget class="QToolButton" name="lockscreenButton">
<property name="text">
<string>Lock screen</string>
</property> </property>
<property name="icon"> <property name="horizontalScrollBarPolicy">
<iconset theme="system-lock-screen"> <enum>Qt::ScrollBarAlwaysOff</enum>
<normaloff>.</normaloff>.</iconset>
</property> </property>
<property name="iconSize"> <property name="sizeAdjustPolicy">
<size> <enum>QAbstractScrollArea::AdjustToContents</enum>
<width>64</width>
<height>64</height>
</size>
</property> </property>
<property name="toolButtonStyle"> <property name="autoScroll">
<enum>Qt::ToolButtonTextUnderIcon</enum> <bool>false</bool>
</property> </property>
</widget> <property name="editTriggers">
</item> <set>QAbstractItemView::NoEditTriggers</set>
</layout>
</item>
<item row="0" column="4">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>6</number>
</property> </property>
<item alignment="Qt::AlignHCenter"> <property name="tabKeyNavigation">
<widget class="QToolButton" name="suspendButton"> <bool>true</bool>
<property name="text">
<string>Suspend</string>
</property> </property>
<property name="icon"> <property name="selectionMode">
<iconset theme="system-suspend"> <enum>QAbstractItemView::NoSelection</enum>
<normaloff>.</normaloff>.</iconset>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -148,111 +117,35 @@
<height>64</height> <height>64</height>
</size> </size>
</property> </property>
<property name="toolButtonStyle"> <property name="textElideMode">
<enum>Qt::ToolButtonTextUnderIcon</enum> <enum>Qt::ElideNone</enum>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QToolButton" name="hibernateButton">
<property name="text">
<string>Hibernate</string>
</property>
<property name="icon">
<iconset theme="system-suspend-hibernate">
<normaloff>.</normaloff>.</iconset>
</property> </property>
<property name="iconSize"> <property name="flow">
<size> <enum>QListView::LeftToRight</enum>
<width>64</width>
<height>64</height>
</size>
</property> </property>
<property name="toolButtonStyle"> <property name="isWrapping" stdset="0">
<enum>Qt::ToolButtonTextUnderIcon</enum> <bool>true</bool>
</property> </property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>7</number>
</property> </property>
<item alignment="Qt::AlignHCenter"> <property name="uniformItemSizes">
<widget class="QToolButton" name="shutdownButton"> <bool>true</bool>
<property name="text">
<string>Shutdown</string>
</property> </property>
<property name="icon">
<iconset theme="system-shutdown">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QToolButton" name="rebootButton">
<property name="text">
<string>Reboot</string>
</property>
<property name="icon">
<iconset theme="system-reboot">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>
<zorder>label</zorder> <zorder>label</zorder>
<zorder>buttonsWidget</zorder> <zorder>listWidget</zorder>
<zorder>widget_2</zorder> <zorder>widget_2</zorder>
</widget> </widget>
<tabstops> <customwidgets>
<tabstop>cancelButton</tabstop> <customwidget>
<tabstop>logoutButton</tabstop> <class>ListWidget</class>
<tabstop>lockscreenButton</tabstop> <extends>QListWidget</extends>
<tabstop>shutdownButton</tabstop> <header>listwidget.h</header>
<tabstop>rebootButton</tabstop> </customwidget>
<tabstop>suspendButton</tabstop> </customwidgets>
<tabstop>hibernateButton</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

@ -0,0 +1,241 @@
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXQt - a lightweight, Qt based, desktop toolset
* http://lxqt.org/
*
* Copyright: 2017 LXQt team
* Authors:
* Palo Kisa <palo.kisa@gmail.com>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#include "listwidget.h"
#include <QItemDelegate>
#include <QApplication>
#include <QKeyEvent>
/*!
* This private delegate does:
* - returns unified sizeHint() -> maximum of all items in (list) model
* - cahes the sizeHint() to not iterate over all items and checking their size
* - overrides decoration position to Qt::Top
* - gives the items margins (increasing sizeHint()) ~~and mimics Button visual~~
* - overrides painting the focus around the whole item (with the decoration)
*
* \note It is a single purpose delegate and expects, that the model
* never changes (cached sizeHint() is never invalidated).
*/
class ItemDelegate : public QItemDelegate
{
public:
static constexpr QMargins MARGINS{5, 5, 5, 5};
public:
using QItemDelegate::QItemDelegate;
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
if (mItemSize.isValid())
return mItemSize;
// compute maximum item size
QStyleOptionViewItem opt = option;
opt.decorationPosition = QStyleOptionViewItem::Top;
QAbstractListModel const * model = qobject_cast<QAbstractListModel const *>(index.model());
for (QModelIndex i = model->index(0); i.isValid(); i = model->index(i.row() + 1))
{
mItemSize = mItemSize.expandedTo(QItemDelegate::sizeHint(opt, i));
}
mItemSize += {MARGINS.left() + MARGINS.right(), MARGINS.top() + MARGINS.bottom()}; // add some margins
return mItemSize;
}
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
/*
// mimic the button visual
QStyleOption button_option;
button_option.initFrom(option.widget);
button_option.rect = option.rect;
if (!(option.state & QStyle::State_HasFocus))
button_option.state &= ~QStyle::State_HasFocus;
QStyle * style = option.widget->style() ? option.widget->style() : QApplication::style();
style->drawPrimitive(QStyle::PE_PanelButtonTool, &button_option, painter, option.widget);
*/
QStyleOptionViewItem opt = option;
opt.decorationPosition = QStyleOptionViewItem::Top;
opt.displayAlignment = Qt::AlignHCenter | Qt::AlignTop;
return QItemDelegate::paint(painter, opt, index);
}
protected:
// Note: We want to paint the focus rectangle around the whole (text+icon)
// (default in QItemDelegate is to draw the focus only in text rectangle)
virtual void drawFocus(QPainter *painter
, const QStyleOptionViewItem &option
, const QRect &/*rect*/) const override
{
// don't override the rectangle to the text-only
return QItemDelegate::drawFocus(painter, option, option.rect);
}
virtual void drawDisplay(QPainter *painter
, const QStyleOptionViewItem &option
, const QRect &rect
, const QString &text) const override
{
// shrink (and move to bottom) the text rectangle
QRect r = rect.adjusted(0, MARGINS.top(), 0, 0);
return QItemDelegate::drawDisplay(painter, option, r, text);
}
virtual void drawDecoration(QPainter *painter
, const QStyleOptionViewItem &option
, const QRect &rect
, const QPixmap &pixmap) const override
{
// move to bottom the pixmap rectangle
QRect r = rect.translated(0, MARGINS.top());
return QItemDelegate::drawDecoration(painter, option, r, pixmap);
}
private:
mutable QSize mItemSize; //!< the cached (unified/max) item size
};
constexpr QMargins ItemDelegate::MARGINS;
ListWidget::ListWidget(QWidget * parent/* = nullptr*/)
: QListWidget{parent}
, mRows(3)
, mColumns(3)
{
ItemDelegate * delegate = new ItemDelegate{this};
{
QScopedPointer<QAbstractItemDelegate> old_del{itemDelegate()};
setItemDelegate(delegate);
}
}
void ListWidget::setRows(int rows)
{
mRows = rows;
}
void ListWidget::setColumns(int columns)
{
mColumns = columns;
}
QSize ListWidget::viewportSizeHint() const
{
QSize size = sizeHintForIndex(model()->index(0, 0));
size.rwidth() = size.width() * mColumns + spacing() * mColumns * 2 + 1;
size.rheight() = size.height() * mRows + spacing() * mRows * 2 + 1;
return size;
}
QModelIndex ListWidget::moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers/* modifiers*/)
{
QModelIndex index = currentIndex();
int count = model()->rowCount(rootIndex());
int current = 0;
if (index.isValid())
{
current = index.row();
index = QModelIndex{}; // setting to invalid to get inside the for loop (move the position)
} else
{
current = cursorAction == MovePrevious ? count - 1 : 0;
index = model()->index(current, 0, rootIndex());
}
// if not enabled, try to find any next enabled
for (int tries = 1; tries < count && 0 == (model()->flags(index) & Qt::ItemIsEnabled); ++tries)
{
int next;
switch (cursorAction)
{
case MoveUp:
case MovePageUp:
next = (current - mColumns) % count;
break;
case MoveDown:
case MovePageDown:
next = (current + mColumns) % count;
break;
case MoveLeft:
if (0 == (current % mColumns))
current += mColumns;
// fall through
case MovePrevious:
if (current == 0)
return QModelIndex{};
next = (current - 1) % count;
break;
case MoveRight:
if ((mColumns - 1) == (current % mColumns))
current -= mColumns;
// fall through
case MoveNext:
if (current == count - 1)
return QModelIndex{};
next = (current + 1) % count;
break;
case MoveHome:
next = 0;
break;
case MoveEnd:
next = count - 1;
break;
}
if (next < 0)
next += count;
index = model()->index(next, 0, rootIndex());
current = next;
}
return index;
}
void ListWidget::keyPressEvent(QKeyEvent * event)
{
if (event->key() == Qt::Key_Space)
{
// mimic the "enter" to fire activated
QKeyEvent k{event->type(), Qt::Key_Enter, event->modifiers(), event->text(), event->isAutoRepeat(), static_cast<ushort>(event->count())};
QListWidget::keyPressEvent(&k);
event->setAccepted(k.isAccepted());
return;
}
return QListWidget::keyPressEvent(event);
}
void ListWidget::focusInEvent(QFocusEvent * event)
{
switch (event->reason())
{
case Qt::TabFocusReason:
setCurrentIndex(model()->index(0, 0, rootIndex()));
break;
case Qt::BacktabFocusReason:
setCurrentIndex(model()->index(model()->rowCount(rootIndex()) - 1, 0, rootIndex()));
break;
default:
break;
}
return QListWidget::focusInEvent(event);
}

@ -0,0 +1,52 @@
/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXQt - a lightweight, Qt based, desktop toolset
* http://lxqt.org/
*
* Copyright: 2017 LXQt team
* Authors:
* Palo Kisa <palo.kisa@gmail.com>
*
* This program or library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* END_COMMON_COPYRIGHT_HEADER */
#include <QListWidget>
/*!
* Single purpose QListWidget with unified item sizes (based on the
* biggest item) and showing rows x columns items.
*
* \note It expects that items aren't ever changed after show().
*/
class ListWidget : public QListWidget
{
public:
ListWidget(QWidget * parent = nullptr);
void setRows(int rows);
void setColumns(int columns);
protected:
virtual QSize viewportSizeHint() const override;
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
virtual void keyPressEvent(QKeyEvent * event) override;
virtual void focusInEvent(QFocusEvent * event) override;
private:
int mRows;
int mColumns;
};

@ -38,13 +38,20 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
LXQt::SingleApplication a(argc, argv); LXQt::SingleApplication a(argc, argv);
a.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
LXQt::Translator::translateApplication(); LXQt::Translator::translateApplication();
LXQt::PowerManager powermanager(&a); LXQt::PowerManager powermanager(&a);
LXQt::ScreenSaver screensaver(&a); LXQt::ScreenSaver screensaver(&a);
QCommandLineParser parser; QCommandLineParser parser;
parser.setApplicationDescription(QStringLiteral("lxqt-leave")); parser.setApplicationDescription(QStringLiteral("LXQt Leave"));
const QString VERINFO = QStringLiteral(LXQT_SESSION_VERSION
"\nliblxqt " LXQT_VERSION
"\nQt " QT_VERSION_STR);
a.setApplicationVersion(VERINFO);
parser.addHelpOption(); parser.addHelpOption();
parser.addVersionOption(); parser.addVersionOption();

@ -0,0 +1,4 @@
#Translations
Name[eu]=Hibernatu
GenericName[eu]=Hibernatu
Comment[eu]=Hibernatu ordenagailua

@ -0,0 +1,3 @@
Name[lt]=Užmigdyti
GenericName[lt]=Užmigdyti
Comment[lt]=Užmigdyti kompiuterį

@ -0,0 +1,4 @@
#Translation
Name[eu]=Utzi
GenericName[eu]=Utzi
Comment[eu]=Utzi elkarrizketa-koadroa

@ -0,0 +1,3 @@
Name[lt]=Išeiti
GenericName[lt]=Išeiti
Comment[lt]=Išėjimo dialogas

@ -0,0 +1,4 @@
#Translation
Name[eu]=Blokeatu pantaila
GenericName[eu]=Blokeatu pantaila
Comment[eu]=Blokeatu uneko saioa

@ -0,0 +1,3 @@
Name[lt]=Užrakinti ekraną
GenericName[lt]=Užrakinti ekraną
Comment[lt]=Užrakinti esamą seansą

@ -0,0 +1,4 @@
#Translation
Name[eu]=Itxi saioa
GenericName[eu]=Itxi saioa
Comment[eu]=Itxi uneko saioa

@ -0,0 +1,4 @@
#Translation
Name[lt]=Atsijungti
GenericName[lt]=Atsijungti
Comment[lt]=Atsijungti iš esamo seanso

@ -0,0 +1,4 @@
#Translation
Name[eu]=Berrabiarazi
GenericName[eu]=Berrabiarazi
Comment[eu]=Berrabiarazi ordenagailua

@ -0,0 +1,4 @@
#Translation
Name[lt]=Paleisti iš naujo
GenericName[lt]=Paleisti iš naujo
Comment[lt]=Paleisti kompiuterį iš naujo

@ -0,0 +1,4 @@
#Translation
Name[eu]=Itzali
GenericName[eu]=Itzali
Comment[eu]=Itzali ordenagailua

@ -0,0 +1,4 @@
#Translation
Name[lt]=Išjungti
GenericName[lt]=Išjungti
Comment[lt]=Išjungti kompiuterį

@ -0,0 +1,4 @@
#Translation
Name[eu]=Eseki
GenericName[eu]=Eseki
Comment[eu]=Eseki ordenagailua

@ -0,0 +1,4 @@
#Translation
Name[lt]=Pristabdyti
GenericName[lt]=Pristabdyti
Comment[lt]=Pristabdyti kompiuterį

@ -52,7 +52,7 @@ UdevNotifier::UdevNotifier(QString const & subsystem, QObject * parent/* = nullp
return; return;
} }
int ret = udev_monitor_filter_add_match_subsystem_devtype(d->monitor, subsystem.toUtf8().constData(), nullptr); int ret = udev_monitor_filter_add_match_subsystem_devtype(d->monitor, subsystem.toLatin1().constData(), nullptr);
if (0 != ret) if (0 != ret)
qCWarning(SESSION) << QStringLiteral("UdevNotifier: unable to add match subsystem, monitor will receive all devices"); qCWarning(SESSION) << QStringLiteral("UdevNotifier: unable to add match subsystem, monitor will receive all devices");
@ -75,7 +75,7 @@ UdevNotifier::~UdevNotifier()
udev_unref(d->udev); udev_unref(d->udev);
} }
void UdevNotifier::eventReady(int socket) void UdevNotifier::eventReady(int /*socket*/)
{ {
struct udev_device * dev; struct udev_device * dev;
while (nullptr != (dev = udev_monitor_receive_device(d->monitor))) while (nullptr != (dev = udev_monitor_receive_device(d->monitor)))

@ -34,6 +34,7 @@
LockScreenManager::LockScreenManager(QObject *parent) : LockScreenManager::LockScreenManager(QObject *parent) :
QObject(parent) QObject(parent)
, mProvider{nullptr}
{ {
} }

@ -57,9 +57,8 @@ using namespace LXQt;
/** /**
* @brief the constructor, needs a valid modules.conf * @brief the constructor, needs a valid modules.conf
*/ */
LXQtModuleManager::LXQtModuleManager(const QString & windowManager, QObject* parent) LXQtModuleManager::LXQtModuleManager(QObject* parent)
: QObject(parent), : QObject(parent),
mWindowManager(windowManager),
mWmProcess(new QProcess(this)), mWmProcess(new QProcess(this)),
mThemeWatcher(new QFileSystemWatcher(this)), mThemeWatcher(new QFileSystemWatcher(this)),
mWmStarted(false), mWmStarted(false),
@ -72,6 +71,11 @@ LXQtModuleManager::LXQtModuleManager(const QString & windowManager, QObject* par
qApp->installNativeEventFilter(this); qApp->installNativeEventFilter(this);
} }
void LXQtModuleManager::setWindowManager(const QString & windowManager)
{
mWindowManager = windowManager;
}
void LXQtModuleManager::startup(LXQt::Settings& s) void LXQtModuleManager::startup(LXQt::Settings& s)
{ {
// The lxqt-confupdate can update the settings of the WM, so run it first. // The lxqt-confupdate can update the settings of the WM, so run it first.
@ -277,7 +281,7 @@ void LXQtModuleManager::startConfUpdate()
startProcess(desktop); startProcess(desktop);
} }
void LXQtModuleManager::restartModules(int exitCode, QProcess::ExitStatus exitStatus) void LXQtModuleManager::restartModules(int /*exitCode*/, QProcess::ExitStatus exitStatus)
{ {
LXQtModule* proc = qobject_cast<LXQtModule*>(sender()); LXQtModule* proc = qobject_cast<LXQtModule*>(sender());
if (nullptr == proc) { if (nullptr == proc) {
@ -347,7 +351,7 @@ LXQtModuleManager::~LXQtModuleManager()
/** /**
* @brief this logs us out by terminating our session * @brief this logs us out by terminating our session
**/ **/
void LXQtModuleManager::logout() void LXQtModuleManager::logout(bool doExit)
{ {
// modules // modules
ModulesMapIterator i(mNameMap); ModulesMapIterator i(mNameMap);
@ -377,6 +381,7 @@ void LXQtModuleManager::logout()
mWmProcess->kill(); mWmProcess->kill();
} }
if (doExit)
QCoreApplication::exit(0); QCoreApplication::exit(0);
} }
@ -396,7 +401,7 @@ void LXQtModuleManager::resetCrashReport()
mCrashReport.clear(); mCrashReport.clear();
} }
bool LXQtModuleManager::nativeEventFilter(const QByteArray & eventType, void * message, long * result) bool LXQtModuleManager::nativeEventFilter(const QByteArray & eventType, void * /*message*/, long * /*result*/)
{ {
if (eventType != "xcb_generic_event_t") // We only want to handle XCB events if (eventType != "xcb_generic_event_t") // We only want to handle XCB events
return false; return false;

@ -72,9 +72,12 @@ class LXQtModuleManager : public QObject, public QAbstractNativeEventFilter
public: public:
//! \brief Construct LXQtModuleManager //! \brief Construct LXQtModuleManager
LXQtModuleManager(const QString& windowManager, QObject* parent = 0); LXQtModuleManager(QObject* parent = 0);
virtual ~LXQtModuleManager(); virtual ~LXQtModuleManager();
//! \brief Set the window manager (e.g. "/usr/bin/openbox")
void setWindowManager(const QString & windowManager);
//! \brief Start a module given its file name (e.g. "lxqt-panel.desktop") //! \brief Start a module given its file name (e.g. "lxqt-panel.desktop")
void startProcess(const QString& name); void startProcess(const QString& name);
@ -96,7 +99,7 @@ public slots:
gracefully (to kill it if it is not possible). Then the session gracefully (to kill it if it is not possible). Then the session
exits - it returns to the kdm/gdm in most cases. exits - it returns to the kdm/gdm in most cases.
*/ */
void logout(); void logout(bool doExit);
signals: signals:
void moduleStateChanged(QString moduleName, bool state); void moduleStateChanged(QString moduleName, bool state);

@ -26,6 +26,7 @@
* END_COMMON_COPYRIGHT_HEADER */ * END_COMMON_COPYRIGHT_HEADER */
#include "sessionapplication.h" #include "sessionapplication.h"
#include <QCommandLineParser>
/** /**
* @file main.cpp * @file main.cpp
@ -48,6 +49,22 @@ int main(int argc, char **argv)
{ {
SessionApplication app(argc, argv); SessionApplication app(argc, argv);
//qDebug() << "LXQt Session start"; //qDebug() << "LXQt Session start";
QCommandLineParser parser;
parser.setApplicationDescription(QStringLiteral("LXQt Session"));
const QString VERINFO = QStringLiteral(LXQT_SESSION_VERSION
"\nliblxqt " LXQT_VERSION
"\nQt " QT_VERSION_STR);
app.setApplicationVersion(VERINFO);
const QCommandLineOption config_opt{{"c", "config"}, SessionApplication::tr("Configuration file path."), SessionApplication::tr("file")};
const QCommandLineOption wm_opt{{"w", "window-manager"}, SessionApplication::tr("Window manager to use."), SessionApplication::tr("file")};
const auto version_opt = parser.addVersionOption();
const auto help_opt = parser.addHelpOption();
parser.addOptions({config_opt, wm_opt});
parser.process(app);
app.setConfigName(parser.value(config_opt));
app.setWindowManager(parser.value(wm_opt));
app.setQuitOnLastWindowClosed(false); app.setQuitOnLastWindowClosed(false);
return app.exec(); return app.exec();
} }

@ -38,7 +38,7 @@
/* the XKB stuff is based on code created by Oswald Buddenhagen <ossi@kde.org> */ /* the XKB stuff is based on code created by Oswald Buddenhagen <ossi@kde.org> */
static unsigned int xkb_mask_modifier(Display* dpy, XkbDescPtr xkb, const char *name ) static unsigned int xkb_mask_modifier(Display* /*dpy*/, XkbDescPtr xkb, const char *name )
{ {
int i; int i;
if( !xkb || !xkb->names ) if( !xkb || !xkb->names )

@ -38,30 +38,9 @@ SessionApplication::SessionApplication(int& argc, char** argv) :
lockScreenManager(new LockScreenManager(this)) lockScreenManager(new LockScreenManager(this))
{ {
listenToUnixSignals({SIGINT, SIGTERM, SIGQUIT, SIGHUP}); listenToUnixSignals({SIGINT, SIGTERM, SIGQUIT, SIGHUP});
char* winmanager = NULL;
int c;
while ((c = getopt (argc, argv, "c:w:")) != -1)
{
if (c == 'c')
{
configName = optarg;
break;
}
else if (c == 'w')
{
winmanager = optarg;
break;
}
}
if(configName.isEmpty())
configName = "session";
// tell the world which config file we're using.
qputenv("LXQT_SESSION_CONFIG", configName.toUtf8());
modman = new LXQtModuleManager(winmanager); modman = new LXQtModuleManager;
connect(this, &LXQt::Application::unixSignal, modman, &LXQtModuleManager::logout); connect(this, &LXQt::Application::unixSignal, modman, [this] { modman->logout(true); });
new SessionDBusAdaptor(modman); new SessionDBusAdaptor(modman);
// connect to D-Bus and register as an object: // connect to D-Bus and register as an object:
QDBusConnection::sessionBus().registerService("org.lxqt.session"); QDBusConnection::sessionBus().registerService("org.lxqt.session");
@ -76,6 +55,20 @@ SessionApplication::~SessionApplication()
delete modman; delete modman;
} }
void SessionApplication::setWindowManager(const QString& windowManager)
{
modman->setWindowManager(windowManager);
}
void SessionApplication::setConfigName(const QString& configName)
{
if(configName.isEmpty())
this->configName = "session";
// tell the world which config file we're using.
qputenv("LXQT_SESSION_CONFIG", this->configName.toLocal8Bit());
}
bool SessionApplication::startup() bool SessionApplication::startup()
{ {
LXQt::Settings settings(configName); LXQt::Settings settings(configName);
@ -135,7 +128,7 @@ void SessionApplication::loadEnvironmentSettings(LXQt::Settings& settings)
Q_FOREACH (QString i, settings.childKeys()) Q_FOREACH (QString i, settings.childKeys())
{ {
envVal = settings.value(i).toByteArray(); envVal = settings.value(i).toByteArray();
lxqt_setenv(i.toUtf8().constData(), envVal); lxqt_setenv(i.toLocal8Bit().constData(), envVal);
} }
settings.endGroup(); settings.endGroup();
} }

@ -32,6 +32,8 @@ class SessionApplication : public LXQt::Application
public: public:
SessionApplication(int& argc, char** argv); SessionApplication(int& argc, char** argv);
~SessionApplication(); ~SessionApplication();
void setWindowManager(const QString & windowManager);
void setConfigName(const QString & configName);
private Q_SLOTS: private Q_SLOTS:
bool startup(); bool startup();

@ -29,6 +29,7 @@
#define SESSIONDBUS_H #define SESSIONDBUS_H
#include <QtDBus> #include <QtDBus>
#include <LXQt/Power>
#include "lxqtmodman.h" #include "lxqtmodman.h"
@ -46,7 +47,8 @@ class SessionDBusAdaptor : public QDBusAbstractAdaptor
public: public:
SessionDBusAdaptor(LXQtModuleManager * manager) SessionDBusAdaptor(LXQtModuleManager * manager)
: QDBusAbstractAdaptor(manager), : QDBusAbstractAdaptor(manager),
m_manager(manager) m_manager(manager),
m_power(false/*don't use ourself, just all other power providers*/)
{ {
connect(m_manager, SIGNAL(moduleStateChanged(QString,bool)), SIGNAL(moduleStateChanged(QString,bool))); connect(m_manager, SIGNAL(moduleStateChanged(QString,bool)), SIGNAL(moduleStateChanged(QString,bool)));
} }
@ -63,9 +65,33 @@ public slots:
return true; return true;
} }
bool canReboot()
{
return m_power.canReboot();
}
bool canPowerOff()
{
return m_power.canShutdown();
}
Q_NOREPLY void logout() Q_NOREPLY void logout()
{ {
m_manager->logout(); m_manager->logout(true);
}
Q_NOREPLY void reboot()
{
m_manager->logout(false);
m_power.reboot();
QCoreApplication::exit(0);
}
Q_NOREPLY void powerOff()
{
m_manager->logout(false);
m_power.shutdown();
QCoreApplication::exit(0);
} }
QDBusVariant listModules() QDBusVariant listModules()
@ -85,6 +111,7 @@ public slots:
private: private:
LXQtModuleManager * m_manager; LXQtModuleManager * m_manager;
LXQt::Power m_power;
}; };
#endif #endif

@ -107,7 +107,7 @@ void WmSelectDialog::addWindowManager(const WindowManager &wm)
} }
void WmSelectDialog::selectFileDialog(const QModelIndex &index) void WmSelectDialog::selectFileDialog(const QModelIndex &/*index*/)
{ {
QTreeWidget *wmList = ui->wmList; QTreeWidget *wmList = ui->wmList;
QTreeWidgetItem *item = wmList->currentItem(); QTreeWidgetItem *item = wmList->currentItem();
@ -130,7 +130,7 @@ void WmSelectDialog::selectFileDialog(const QModelIndex &index)
ui->wmList->setCurrentItem(wmItem); ui->wmList->setCurrentItem(wmItem);
} }
void WmSelectDialog::changeBtnStatus(const QModelIndex &index) void WmSelectDialog::changeBtnStatus(const QModelIndex &/*index*/)
{ {
QString wm = windowManager(); QString wm = windowManager();
ui->buttonBox->setEnabled(!wm.isEmpty() && findProgram(wm)); ui->buttonBox->setEnabled(!wm.isEmpty() && findProgram(wm));

@ -0,0 +1,48 @@
.TH STARTLXQT 1 2015-11-03 "LXQt 0.10.0" "LXQt session management"
.SH NAME
startlxqt \- script to initialize and launch LXQt sessions
.SH SYNOPSIS
.B startlxqt
.SH DESCRIPTION
\fBstartlxqt\fR is a shell script meant to initialize and launch LXQt sessions.
It is as such similar to counterparts of other desktop environments like startlxde in
LXDE or startkde in KDE.
.P
It's main tasks are exporting environment variables, partly after performing
corresponding checks, and launching \fBlxqt-session\fR, the LXQt session manager.
.P
It is not meant to be run by users.
Rather, it is invoked as backend, e. g. by script \fBstartx\fR on virtual terminals or display
managers like SDDM or LightDM, see section \fIEXAMPLE\fR.
.SH FILES
.I $XDG_DATA_DIRS/xsessions/lxqt.desktop
.RS 5
Desktop entry file stating startlxqt as binary needed to start LXQt sessions. Sourced e. g.
by display managers.
.RE
.SH BUGS
None at the time of this writing. Bugs can be reported on https://github.com/lxde/lxqt/issues.
.SH EXAMPLE
To start an LXQt session from a virtual terminal (virtual console) add a line
.P
.RS 5
exec startlxqt
.RE
.P
to file \fI~/.xinitrc\fR. An LXQt session will then be launched by running \fBstartx\fR.
.P
Display managers are making use of scripts like \fBstartlxqt\fR automatically. Information about
available desktop environments is provided by files \fI$XDG_DATA_DIRS/xsessions/*.desktop\fR, typically
\fI/usr/share/xessions/*.desktop\fR.
.br
File \fIlxqt.desktop\fR provided by LXQt is stating \fBstartlxqt\fR in key \fIExec\fR while making sure the session
manager \fBlxqt-session\fR does exist by stating it in key \fITryExec\fR.
.SH SEE ALSO
.BR lxqt-session (1)
.BR startx (1)
.BR sddm (1)
.P
.B http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/
.RS 5
Desktop Entry Specification defining desktop entry files (*.desktop).
.RE

@ -0,0 +1,99 @@
#!/bin/sh
contains()
{
local str="$1" substr="$2"
[ "$str" = "$substr" -o -z "${str##$substr:*}" -o -z "${str##*:$substr:*}" -o -z "${str%%*:$substr}" ]
}
if [ -z "$XDG_DATA_HOME" ]; then
export XDG_DATA_HOME="$HOME/.local/share"
fi
if [ -z "$XDG_CONFIG_HOME" ]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi
if [ -z "$XDG_DATA_DIRS" ]; then
XDG_DATA_DIRS="@PREDEF_XDG_DATA_DIRS@"
else
if ! contains "$XDG_DATA_DIRS" "@LXQT_DATA_DIR@"; then
XDG_DATA_DIRS="$XDG_DATA_DIRS:@LXQT_DATA_DIR@"
fi
fi
export XDG_DATA_DIRS
if [ -z "$XDG_CONFIG_DIRS" ]; then
export XDG_CONFIG_DIRS="@LXQT_ETC_XDG_DIR@"
else
if ! contains "$XDG_CONFIG_DIRS" '@LXQT_ETC_XDG_DIR@'; then
XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS:@LXQT_ETC_XDG_DIR@"
fi
fi
if [ -z "$XDG_CACHE_HOME" ]; then
export XDG_CACHE_HOME="$HOME/.cache"
fi
# Ensure the existance of the 'Desktop' folder
if [ -e "$XDG_CONFIG_HOME/user-dirs.dirs" ]; then
. "$XDG_CONFIG_HOME/user-dirs.dirs"
else
XDG_DESKTOP_DIR="$HOME/Desktop"
fi
mkdir -p "$XDG_DESKTOP_DIR"
# Clean up after GDM (GDM sets the number of desktops to one)
xprop -root -remove _NET_NUMBER_OF_DESKTOPS -remove _NET_DESKTOP_NAMES -remove _NET_CURRENT_DESKTOP 2> /dev/null
# Enable Qt integration for OpenOffice.org, if available.
if [ -z "$SAL_USE_VCLPLUGIN" ]; then
export SAL_USE_VCLPLUGIN=kde4
fi
# Launch DBus if needed
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
if [ -z "$XDG_RUNTIME_DIR" ] || ! [ -S "$XDG_RUNTIME_DIR/bus" ] || ! [ -O "$XDG_RUNTIME_DIR/bus" ]; then
eval "$(dbus-launch --sh-syntax --exit-with-session)" || echo "startlxqt: error executing dbus-launch" >&2
fi
fi
# Copy default settings of openbox
if [ ! -e "$XDG_CONFIG_HOME/openbox/lxqt-rc.xml" ] ; then
ob_config_copied=0
for considered_file in 'lxde-rc.xml' 'rc.xml'; do
if [ -e "$XDG_CONFIG_HOME/openbox/$considered_file" ]; then
#copy existing configuration of openbox
cp "$XDG_CONFIG_HOME/openbox/$considered_file" "$XDG_CONFIG_HOME/openbox/lxqt-rc.xml"
message="Your existing configuration for openbox '$XDG_CONFIG_HOME/openbox/$considered_file' was used to
fill the LXQt's openbox configuration '$XDG_CONFIG_HOME/openbox/lxqt-rc.xml'.
If you want to use the predefined LXQt's openbox configuration, run:
cp '@LXQT_ETC_XDG_DIR@/openbox/lxqt-rc.xml' '$XDG_CONFIG_HOME/openbox'"
echo "$message" >&2
xmessage -center -title "LXQt Openbox configuration" "$message" &
ob_config_copied=1
break
fi
done
if [ 0 -eq "$ob_config_copied" ]; then
#copy predefined configuration
mkdir -p "$XDG_CONFIG_HOME/openbox"
#user/distribution can change the default configuration via LXQT_DEFAULT_OPENBOX_CONFIG
[ -r "$LXQT_DEFAULT_OPENBOX_CONFIG" ] || LXQT_DEFAULT_OPENBOX_CONFIG='@LXQT_ETC_XDG_DIR@/openbox/lxqt-rc.xml'
cp "$LXQT_DEFAULT_OPENBOX_CONFIG" "$XDG_CONFIG_HOME/openbox"
fi
fi
# Qt4 platform plugin
export QT_PLATFORM_PLUGIN=lxqt
# Qt5 platform plugin
export QT_QPA_PLATFORMTHEME=lxqt
# use lxqt-applications.menu for main app menu
export XDG_MENU_PREFIX="lxqt-"
export XDG_CURRENT_DESKTOP="LXQt"
# Start the LXQt session
exec lxqt-session

@ -0,0 +1,29 @@
# TODO/FIXME: install kdm/gdm files too
# this file should be enough but it needs testing...
file(GLOB SESSION_FILES_IN *.desktop.in)
# Translations **********************************
lxqt_translate_desktop(SESSION_FILES
SOURCES
${SESSION_FILES_IN}
)
add_custom_target(xsession_desktop_files ALL DEPENDS ${SESSION_FILES})
#************************************************
MACRO(INSTALL_SESSION_FILES directory)
# if(EXISTS ${directory})
install(FILES
${SESSION_FILES}
DESTINATION "${directory}"
COMPONENT Runtime
)
# endif()
ENDMACRO(INSTALL_SESSION_FILES)
#INSTALL_SESSION_FILES("/etc/X11/sessions")
#INSTALL_SESSION_FILES("/usr/share/sessions")
INSTALL_SESSION_FILES("${CMAKE_INSTALL_DATAROOTDIR}/xsessions")
INSTALL_SESSION_FILES("${CMAKE_INSTALL_DATAROOTDIR}/kdm/sessions")
#INSTALL_SESSION_FILES("/usr/local/share/apps/kdm/sessions")
#INSTALL_SESSION_FILES("/usr/share/config/kdm/sessions")
#INSTALL_SESSION_FILES("/usr/local/share/config/kdm/sessions")

@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Exec=startlxqt
TryExec=lxqt-session
Name=LXQt Desktop
Comment=Lightweight Qt Desktop
#TRANSLATIONS_DIR=translations

@ -0,0 +1,3 @@
# Translations
Name[ar]=سطح المكتب ريزر
Comment[ar]=سطح المكتب كيوت٤

@ -0,0 +1,3 @@
# Translations
Name[cs]=Plocha LXQt
Comment[cs]=Pracovní plocha na Qt

@ -0,0 +1,3 @@
# Translations
Name[cs_CZ]=Pracovní plocha LXQt
Comment[cs_CZ]=Pracovní plocha Qt

@ -0,0 +1,3 @@
# Translations
Name[da]=LXQt-skrivebord
Comment[da]=Letvægts Qt-skrivebord

@ -0,0 +1,3 @@
# Translations
Name[de]=LXQt Arbeitsumgebung
Comment[de]=Leichtgewichtige Qt Arbeitsumgebung

@ -0,0 +1,3 @@
# Translations
Name[el]=Επιφάνεια εργασίας LXQt
Comment[el]=Ελαφριά επιφάνεια εργασίας Qt

@ -0,0 +1,3 @@
# Translations
Name[eo]=LXQta labortablo
Comment[eo]=Qt-labortablo

@ -0,0 +1,3 @@
# Translations
Name[es]=Escritorio LXQt
Comment[es]=Escritorio Qt

@ -0,0 +1,3 @@
# Translations
Name[es_VE]=Escritorio LXQt
Comment[es_VE]=Escritorio Qt

@ -0,0 +1,3 @@
# Translations
Name[eu]=LXQt mahaigaina
Comment[eu]=Qt mahaigaina

@ -0,0 +1,3 @@
# Translations
Name[fi]=LXQt-työpöytä
Comment[fi]=Qt-työpöytä

@ -0,0 +1,3 @@
# Translations
Name[fr]=Bureau LXQt
Comment[fr]=Bureau léger pour Qt

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save