--- rpl/src/encart.c 2017/08/24 06:59:03 1.64 +++ rpl/src/encart.c 2017/08/24 08:26:43 1.66 @@ -84,9 +84,6 @@ 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; @@ -147,6 +144,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,11 +173,7 @@ encart(struct_processus *s_etat_processu XmNmarginHeight, 5, NULL); - XtVaGetValues(form, - XmNforeground, &couleur_avant_plan, - XmNbackground, &couleur_arriere_plan, - NULL); - +uprintf("0\n"); if ((erreur = XpmCreatePixmapFromData(XtDisplay(form), DefaultRootWindow(XtDisplay(form)), rpl_xpm, &pixmap_rpl, &pixmap_rpl_masque, NULL)) != 0) @@ -180,21 +188,7 @@ 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); - +uprintf("1\n"); if (XineramaIsActive(display) == True) { // Récupération de la localisation des différents écrans @@ -287,6 +281,7 @@ encart(struct_processus *s_etat_processu offset_x = 0; offset_y = 0; } +uprintf("2\n"); #if 0 XtRealizeWidget(objet_principal); @@ -313,8 +308,10 @@ encart(struct_processus *s_etat_processu XtRealizeWidget(objet_principal); #endif +uprintf("3\n"); XFlush(XtDisplay(form)); +uprintf("3a\n"); attente.tv_sec = 0; attente.tv_nsec = 1000; @@ -323,11 +320,16 @@ encart(struct_processus *s_etat_processu do { +uprintf("3b\n"); if (XtAppPending(app) != 0) { +uprintf("3c\n"); XtAppNextEvent(app, &evenement); +uprintf("3d\n"); XtDispatchEvent(&evenement); +uprintf("3e\n"); } +uprintf("3f\n"); nanosleep(&attente, NULL); gettimeofday(&horodatage_final, NULL); @@ -346,12 +348,9 @@ encart(struct_processus *s_etat_processu + ((double) temps_ecoule.tv_sec)) < (((double) duree) / ((double) 1000000))); +uprintf("4\n"); XtUnrealizeWidget(objet_principal); - - XtDestroyWidget(pixmap); - XtDestroyWidget(cadre); - XtDestroyWidget(form); - XtDestroyWidget(objet_principal); +uprintf("5\n"); while(XtAppPending(app) == 0) { @@ -365,12 +364,19 @@ encart(struct_processus *s_etat_processu nanosleep(&attente, NULL); } + XtDestroyWidget(pixmap); + XtDestroyWidget(cadre); + XtDestroyWidget(form); + XtDestroyWidget(objet_principal); + +uprintf("6\n"); XmDestroyPixmap(XtScreen(form), pixmap_rpl); XmDestroyPixmap(XtScreen(form), pixmap_rpl_masque); - XCloseDisplay(display); XtAppSetWarningHandler(app, old_message_handler); XtDestroyApplicationContext(app); + XCloseDisplay(display); +uprintf("7\n"); } # endif