Re: [cdesktopenv-devel] dtlogin & sound

2014-02-17 Thread ibid . ag
On Mon, Feb 17, 2014 at 12:05:12AM +0200, Antonis Tsolomitis wrote:
> 
> If CDE starts through dtlogin immediately after reboot the sound does
> not work.
> This is because dtlogin has no instructions to start the pulse system.
> 
> But what is the proper way to start the pulse system for the user?
> 
> If we login to CDE with lightdm then stop lightdm, start dtlogin and
> login CDE the sound works.
> 
> So what is the correct way to fix this?
> 
> Antonis.

Definitely not by always starting pulse.
I use OSS4 because the ALSA drivers do not work here, so have some strong 
feelings in that regard.

Questions:
-When does lightdm start pulse? On start, or on login?
(If you stop lightdm from VT1 without logging in, is pulse started?)

-Is pulse running as a system daemon or as a user daemon?
(look at ps -ef, field 1)

-If pusle is a system daemon, is pulse configured to autostart 
when lightdm starts?
(This is my guess for what happens, just because of the nature of
upstart...look in /etc/init/)

HTH,
Isaac Dunham


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
___
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel


Re: [cdesktopenv-devel] [PATCH] Bugfix for: #8 xorg-xkb partially freezes dtwm when keyboard layout is changed.

2014-02-17 Thread Jon Trulson

On Fri, 14 Feb 2014, Eugene Doudine wrote:


---
cde/programs/dtwm/WmGlobal.h |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cde/programs/dtwm/WmGlobal.h b/cde/programs/dtwm/WmGlobal.h
index 0995c7e..944b4b3 100644
--- a/cde/programs/dtwm/WmGlobal.h
+++ b/cde/programs/dtwm/WmGlobal.h
@@ -2367,7 +2367,9 @@ typedef struct _WmGlobalData
#define ACTIVE_ROOT (wmGD.pActiveSD->rootWindow)
#define ACTIVE_ICON_TEXT_WIN (wmGD.pActiveSD->activeIconTextWin)

-#define NOLOCKMOD(state)  ((state) & ~wmGD.lockingModMask)
+/* According to the xkb protocol bits 13 and 14 are interpreted as a  */
+/* two-bit unsigned numeric value and report the state keyboard group */
+#define NOLOCKMOD(state)  ((state) & ~wmGD.lockingModMask & ~(3 << 13))
#ifdef WSM
/* absent map behavior policy values (absentMapBehavior): */
#define AMAP_BEHAVIOR_ADD   0



Ok, I manually appied this patch.  I could not find a proper #define
in XKB.h, so we'll will just stick with the 3<<13.

Please, in the future, use git's 'format-patch' facility to submit
patches to the mailing list.  It makes my job a lot easier.


--
Jon Trulson

 "It is a truism that almost any sect, cult, or religion will
  legislate its creed into law if it acquires the political power to do
  so."   —Robert A. Heinlein, science-fiction author (1907-1988)
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk___
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel


[cdesktopenv-devel] [PATCH] Bugfix for #9 Cut off fonts in titles

2014-02-17 Thread Eugene
Hi

The cause of the cut-off is as follows:

The cut off happens because dtwm fails to get default font 
(that is one from an entry with XmFONTLIST_DEFAULT_TAG )
when using compound font sets in UTF-8 locales.

This failure is detected and then  the fallback code gets executed
(see patch 
https://sourceforge.net/p/cdesktopenv/code/ci/a26b73a1a64caadf029473342b7d42a7158b7461/
by Frederic Koehler), 
which always uses the "fixed" font as default font.

After that the default font is used to calculate heights of window
titles. This usually causes the cut off, because the "fixed" font on
most systems is pretty small. 

Note, that the default font is just used to calculate geometry, 
the actuals letters are rendered using proper fontList.


This patch enhances the workaround of Frederic:

In the case when XmeRenderTableGetDefaultFont() fails to get font, it
uses XExtentsOfFontSet() to get extents of the entire font set.

I regard this patch just as a temporary workaround, because in the
proper fix, I think, we probably should get rid of usage of
XmeRenderTableGetDefaultFont() and default fonts at all throughout the
program, because titles and messages could be in any language or in mix
of languages, so it's just not right to use one of the fonts to
calculate title height and geometry of messages.

Eugene
>From 34523cdfb38cdd680edaccc75c5080b0809b01a0 Mon Sep 17 00:00:00 2001
From: Eugene Doudine 
Date: Tue, 18 Feb 2014 00:12:19 +0200
Subject: [PATCH] Bugfix for #9 Cut off fonts in titles

---
 cde/programs/dtwm/WmResource.c |   99 +++-
 1 file changed, 87 insertions(+), 12 deletions(-)

diff --git a/cde/programs/dtwm/WmResource.c b/cde/programs/dtwm/WmResource.c
index a92d8aa..d51d6a4 100644
--- a/cde/programs/dtwm/WmResource.c
+++ b/cde/programs/dtwm/WmResource.c
@@ -4391,6 +4391,70 @@ ProcessAppearanceResources (WmScreenData *pSD)
 
 } /* END OF FUNCTION ProcessAppearanceResources */
 
+
+
+/*<->*
+ *
+ *  FallbackMakeTitleHeight (pAData)
+ *
+ *
+ *  Description:
+ *  ---
+ *  This function makes title hight for AppearanceData 
+ *  (using XExtentsOfFontSet on pAData->fontList)
+ *
+ *  Inputs:
+ *  --
+ *
+ *  pAData = pointer to appearance data structure containing resource info
+ *
+ * 
+ *  Outputs:
+ *  ---
+ *  *pAData - pAData->titleHeight is updated
+ *  return = 1 on success, 0 on failure (pAData->titleHeight is intact)
+ *
+ *<->***/
+
+int 
+FallbackMakeTitleHeight (AppearanceData *pAData) {
+  XmFontContext   fc;
+  XmFontType  type;
+  XmFontListEntry entry;
+  XtPointer   pFont;
+  XFontSetExtents *pExtents;
+  int result = 0;
+  
+  XmFontListInitFontContext ( &fc, pAData->fontList);
+  pAData->titleHeight = 0;
+  entry = XmFontListNextEntry (fc);
+  while (entry) 
+  {
+pFont = XmFontListEntryGetFont (entry, &type);
+switch (type) 
+{
+case XmFONT_IS_FONT:
+  /* does not really happen since XmeRenderTableGetDefaultFont
+	 seems to fail only on fontsets */
+  break;
+case XmFONT_IS_FONTSET:
+  if (!(pExtents = XExtentsOfFontSet ((XFontSet) pFont))) {
+	break;
+  }
+  if (WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height > pAData->titleHeight) {
+	pAData->titleHeight = WM_TITLE_BAR_PADDING + pExtents->max_logical_extent.height;
+	result = 1;
+  }
+  break;
+default:
+  break;
+}
+entry = XmFontListNextEntry (fc);
+  }
+  XmFontListFreeFontContext (fc);
+  return result;
+}
+
 
 /*<->*
  *
@@ -4433,24 +4497,35 @@ MakeAppearanceResources (WmScreenData *pSD, AppearanceData *pAData, Boolean make
 	Warning((char *)wmGD.tmpBuffer);
 #if defined(CSRG_BASED) || defined(linux)
 	/* HACK to try get _some_ font anyway (fontList seems to end up as an empty list on
- * some modern systems; investigate) */
-pAData->font = XLoadQueryFont(wmGD.display, "fixed");
-	if (pAData->font == NULL) {
-	ExitWM(WM_ERROR_EXIT_VALUE);
+	 * some modern systems; investigate) */
+	pAData->font = XLoadQueryFont(wmGD.display, "fixed");
+	if (pAData->font == NULL) 
+	{
+	  ExitWM(WM_ERROR_EXIT_VALUE);
+	}
+	/* try to get right title hight using XExtentsOfFontSet: on UTF-8
+	 * locales XmeRenderTableGetDefaultFont does not return anything
+	 * when font is a compound fontset*/
+	if (!FallbackMakeTitleHeight(pAData)) 
+	{
+	  /* failed to get height from fontList - falling back to fixed */
+	  pAData->titleHeight = (pAData->font)->ascent + (pAData->font)->descent
+	+ WM_TITLE_BAR_PADDING;
 	}
 #else
 	ExitWM(WM_ERROR_EXIT_VALUE);
 #endif
-
-}
-
+} else { 
+	/* got default font successfully, hack was not needed */
 #ifndef NO_MULTIBYTE
-/*
- *  Calculate title bar's height and store it in pAData.
- */
-pAData-

Re: [cdesktopenv-devel] [PATCH] Bugfix for #9 Cut off fonts in titles

2014-02-17 Thread Jon Trulson

On Tue, 18 Feb 2014, Eugene wrote:


Hi

The cause of the cut-off is as follows:

The cut off happens because dtwm fails to get default font
(that is one from an entry with XmFONTLIST_DEFAULT_TAG )
when using compound font sets in UTF-8 locales.


[...]

Thanks Eugene, applied.

--
Jon Trulson

 "It is a truism that almost any sect, cult, or religion will
  legislate its creed into law if it acquires the political power to do
  so."   —Robert A. Heinlein, science-fiction author (1907-1988)
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk___
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel