several fixes
This commit is contained in:
parent
914c00fc53
commit
2d330bdb80
6 changed files with 35 additions and 7 deletions
23
mdm/login.c
23
mdm/login.c
|
|
@ -17,6 +17,8 @@ char* name_line = NULL;
|
||||||
char* try_exec_line = NULL;
|
char* try_exec_line = NULL;
|
||||||
char* exec_line = NULL;
|
char* exec_line = NULL;
|
||||||
char* desktop_names_line = NULL;
|
char* desktop_names_line = NULL;
|
||||||
|
int session_count = 0;
|
||||||
|
int mde_count = -1;
|
||||||
|
|
||||||
static void add_user(const char* name, void* user) {
|
static void add_user(const char* name, void* user) {
|
||||||
MwComboBoxAdd(user, -1, name);
|
MwComboBoxAdd(user, -1, name);
|
||||||
|
|
@ -60,6 +62,11 @@ static void add_session(session_type_t session_type, const char* path, int dir,
|
||||||
if(i == shlen(sessions)) {
|
if(i == shlen(sessions)) {
|
||||||
MwComboBoxAdd(user, -1, name_line);
|
MwComboBoxAdd(user, -1, name_line);
|
||||||
|
|
||||||
|
if(strcmp(name_line, "MDE") == 0) {
|
||||||
|
mde_count = session_count;
|
||||||
|
}
|
||||||
|
session_count++;
|
||||||
|
|
||||||
value->run = exec_line;
|
value->run = exec_line;
|
||||||
value->try_run = try_exec_line;
|
value->try_run = try_exec_line;
|
||||||
value->session_type = session_type;
|
value->session_type = session_type;
|
||||||
|
|
@ -199,11 +206,11 @@ void login_window(void) {
|
||||||
pic = MwVaCreateWidget(MwImageClass, "image", window, 10, 10, 80, 137,
|
pic = MwVaCreateWidget(MwImageClass, "image", window, 10, 10, 80, 137,
|
||||||
MwNhasBorder, 1,
|
MwNhasBorder, 1,
|
||||||
NULL);
|
NULL);
|
||||||
userlabel = MwVaCreateWidget(MwLabelClass, "userlabel", window, 95, 10, MwTextWidth(window, "User:"), 16,
|
userlabel = MwVaCreateWidget(MwLabelClass, "userlabel", window, 95, 10, MwTextWidth(window, NULL, "User:"), 16,
|
||||||
MwNtext, "User:",
|
MwNtext, "User:",
|
||||||
NULL);
|
NULL);
|
||||||
usercombo = MwCreateWidget(MwComboBoxClass, "usercombo", window, 95, 10 + 16 + 5, 265, 18);
|
usercombo = MwCreateWidget(MwComboBoxClass, "usercombo", window, 95, 10 + 16 + 5, 265, 18);
|
||||||
passlabel = MwVaCreateWidget(MwLabelClass, "passlabel", window, 95, 10 + 16 + 5 + 18 + 5, MwTextWidth(window, "Password:"), 16,
|
passlabel = MwVaCreateWidget(MwLabelClass, "passlabel", window, 95, 10 + 16 + 5 + 18 + 5, MwTextWidth(window, NULL, "Password:"), 16,
|
||||||
MwNtext, "Password:",
|
MwNtext, "Password:",
|
||||||
NULL);
|
NULL);
|
||||||
passentry = MwVaCreateWidget(MwEntryClass, "passentry", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5, 265, 18,
|
passentry = MwVaCreateWidget(MwEntryClass, "passentry", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5, 265, 18,
|
||||||
|
|
@ -212,7 +219,7 @@ void login_window(void) {
|
||||||
mainsep = MwVaCreateWidget(MwSeparatorClass, "mainsep", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5 + 18, 265, 10,
|
mainsep = MwVaCreateWidget(MwSeparatorClass, "mainsep", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5 + 18, 265, 10,
|
||||||
MwNorientation, MwHORIZONTAL,
|
MwNorientation, MwHORIZONTAL,
|
||||||
NULL);
|
NULL);
|
||||||
sesslabel = MwVaCreateWidget(MwLabelClass, "sesslabel", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5 + 18 + 10, MwTextWidth(window, "Session Type:"), 16,
|
sesslabel = MwVaCreateWidget(MwLabelClass, "sesslabel", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5 + 18 + 10, MwTextWidth(window, NULL, "Session Type:"), 16,
|
||||||
MwNtext, "Session Type:",
|
MwNtext, "Session Type:",
|
||||||
NULL);
|
NULL);
|
||||||
sesscombo = MwCreateWidget(MwComboBoxClass, "sesscombo", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5 + 18 + 10 + 16 + 5, 265, 18);
|
sesscombo = MwCreateWidget(MwComboBoxClass, "sesscombo", window, 95, 10 + 16 + 5 + 18 + 5 + 16 + 5 + 18 + 10 + 16 + 5, 265, 18);
|
||||||
|
|
@ -243,11 +250,21 @@ void login_window(void) {
|
||||||
shfree(sessions);
|
shfree(sessions);
|
||||||
sh_new_strdup(sessions);
|
sh_new_strdup(sessions);
|
||||||
shdefault(sessions, NULL);
|
shdefault(sessions, NULL);
|
||||||
|
|
||||||
|
mde_count = -1;
|
||||||
|
session_count = 0;
|
||||||
|
|
||||||
MDEDirectoryScan(DATAROOTDIR "/xsessions", add_session_x, sesscombo);
|
MDEDirectoryScan(DATAROOTDIR "/xsessions", add_session_x, sesscombo);
|
||||||
MDEDirectoryScan("/usr/share/xsessions", add_session_x, sesscombo);
|
MDEDirectoryScan("/usr/share/xsessions", add_session_x, sesscombo);
|
||||||
MDEDirectoryScan(DATAROOTDIR "/wayland-sessions", add_session_wayland, sesscombo);
|
MDEDirectoryScan(DATAROOTDIR "/wayland-sessions", add_session_wayland, sesscombo);
|
||||||
MDEDirectoryScan("/usr/share/wayland-sessions", add_session_wayland, sesscombo);
|
MDEDirectoryScan("/usr/share/wayland-sessions", add_session_wayland, sesscombo);
|
||||||
|
|
||||||
|
if(mde_count != -1) {
|
||||||
|
MwVaApply(sesscombo,
|
||||||
|
MwNvalue, mde_count,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock(&xmutex);
|
pthread_mutex_unlock(&xmutex);
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ void rehash(int sig) {
|
||||||
int main() {
|
int main() {
|
||||||
int st;
|
int st;
|
||||||
|
|
||||||
|
MwLibraryInit();
|
||||||
|
|
||||||
wm_config_init();
|
wm_config_init();
|
||||||
wm_config_read();
|
wm_config_read();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,6 @@ void loop_wm(void) {
|
||||||
|
|
||||||
pthread_mutex_lock(&xmutex);
|
pthread_mutex_lock(&xmutex);
|
||||||
|
|
||||||
MwLibraryInit();
|
|
||||||
|
|
||||||
root = MwVaCreateWidget(NULL, "root", NULL, 0, 0, 0, 0,
|
root = MwVaCreateWidget(NULL, "root", NULL, 0, 0, 0, 0,
|
||||||
COMMON_LOOK,
|
COMMON_LOOK,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
||||||
|
|
@ -661,8 +661,8 @@ void loop_x(void) {
|
||||||
if(ret) continue;
|
if(ret) continue;
|
||||||
if(i != arrlen(windows)) {
|
if(i != arrlen(windows)) {
|
||||||
XWindowAttributes xwa;
|
XWindowAttributes xwa;
|
||||||
int rev;
|
int rev;
|
||||||
Window cfocus;
|
Window cfocus;
|
||||||
|
|
||||||
if(!XGetWindowAttributes(xdisplay, windows[i].client, &xwa)) {
|
if(!XGetWindowAttributes(xdisplay, windows[i].client, &xwa)) {
|
||||||
wm_destroy(windows[i].frame);
|
wm_destroy(windows[i].frame);
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,8 @@ install(
|
||||||
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/startmde
|
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/startmde
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/mde.desktop
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xsessions
|
||||||
|
)
|
||||||
|
|
|
||||||
6
startmde/mde.desktop
Normal file
6
startmde/mde.desktop
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=MDE
|
||||||
|
Comment=Milk Desktop Experience
|
||||||
|
Exec=startmde
|
||||||
|
Type=Application
|
||||||
|
Keywords=desktop
|
||||||
Loading…
Add table
Add a link
Reference in a new issue