--- rpl/src/encart.c 2017/08/23 20:29:29 1.63 +++ rpl/src/encart.c 2018/02/07 17:02:30 1.67 @@ -84,15 +84,14 @@ encart(struct_processus *s_etat_processu int y_max; int y_min; - Pixel couleur_arriere_plan; - Pixel couleur_avant_plan; - Pixmap pixmap_rpl; Pixmap pixmap_rpl_masque; Position hauteur_popup; Position largeur_popup; + Screen *screen; + String *argv; struct timespec attente; @@ -147,6 +146,21 @@ encart(struct_processus *s_etat_processu xmFormWidgetClass, objet_principal, NULL); + XtVaGetValues(objet_principal, + XmNmwmDecorations, &decor, + XmNmwmFunctions, &fonctions, + NULL); + + decor &= ~(MWM_DECOR_ALL + MWM_DECOR_MAXIMIZE + MWM_DECOR_RESIZEH + + MWM_DECOR_TITLE + MWM_DECOR_MENU + MWM_DECOR_BORDER); + fonctions &= ~(MWM_FUNC_ALL + MWM_FUNC_RESIZE + MWM_FUNC_CLOSE + + MWM_FUNC_MINIMIZE + MWM_FUNC_MAXIMIZE); + + XtVaSetValues(objet_principal, + XmNmwmDecorations, decor, + XmNmwmFunctions, fonctions, + NULL); + cadre = XtVaCreateManagedWidget("rplExternalFrame", xmFrameWidgetClass, form, XmNtopAttachment, XmATTACH_FORM, @@ -161,14 +175,9 @@ encart(struct_processus *s_etat_processu XmNmarginHeight, 5, NULL); - XtVaGetValues(form, - XmNforeground, &couleur_avant_plan, - XmNbackground, &couleur_arriere_plan, - NULL); - if ((erreur = XpmCreatePixmapFromData(XtDisplay(form), DefaultRootWindow(XtDisplay(form)), rpl_xpm, - &pixmap_rpl, &pixmap_rpl_masque, NULL)) != 0) + &pixmap_rpl, &pixmap_rpl_masque, NULL)) != XpmSuccess) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; @@ -180,21 +189,6 @@ encart(struct_processus *s_etat_processu XmNlabelPixmap, pixmap_rpl, NULL); - XtVaGetValues(objet_principal, - XmNmwmDecorations, &decor, - XmNmwmFunctions, &fonctions, - NULL); - - decor &= ~(MWM_DECOR_ALL + MWM_DECOR_MAXIMIZE + MWM_DECOR_RESIZEH - + MWM_DECOR_TITLE + MWM_DECOR_MENU + MWM_DECOR_BORDER); - fonctions &= ~(MWM_FUNC_ALL + MWM_FUNC_RESIZE + MWM_FUNC_CLOSE - + MWM_FUNC_MINIMIZE + MWM_FUNC_MAXIMIZE); - - XtVaSetValues(objet_principal, - XmNmwmDecorations, decor, - XmNmwmFunctions, fonctions, - NULL); - if (XineramaIsActive(display) == True) { // Récupération de la localisation des différents écrans @@ -348,14 +342,6 @@ encart(struct_processus *s_etat_processu XtUnrealizeWidget(objet_principal); - XmDestroyPixmap(XtScreen(form), pixmap_rpl); - XmDestroyPixmap(XtScreen(form), pixmap_rpl_masque); - - XtDestroyWidget(pixmap); - XtDestroyWidget(cadre); - XtDestroyWidget(form); - XtDestroyWidget(objet_principal); - while(XtAppPending(app) == 0) { nanosleep(&attente, NULL); @@ -368,9 +354,19 @@ encart(struct_processus *s_etat_processu nanosleep(&attente, NULL); } - XCloseDisplay(display); + screen = XtScreen(form); + + XtDestroyWidget(pixmap); + XtDestroyWidget(cadre); + XtDestroyWidget(form); + XtDestroyWidget(objet_principal); + + XmDestroyPixmap(screen, pixmap_rpl); + XmDestroyPixmap(screen, pixmap_rpl_masque); + XtAppSetWarningHandler(app, old_message_handler); XtDestroyApplicationContext(app); + XCloseDisplay(display); } # endif