Re: [Tigervnc-devel] [PATCH] add resolutions to the default randr resolutions

2011-06-04 Thread DRC
On 5/19/11 4:56 AM, Sebastiaan Breedveld wrote:
 Here is another patch. It adds a -resolutions argument with a list of
 resolutions to add to the default list:
 Xvnc -resolutions 1264x900 1400x1500

After looking at this, it seems like a reasonable feature to add to
trunk.  I would rewrite the argument parser a bit so that it tokenizes
the resolutions and allows them to be separated by both commas and
spaces (this should fix the inetd problem.)

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
___
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel


Re: [Tigervnc-devel] [PATCH] add resolutions to the default randr resolutions

2011-05-19 Thread Pierre Ossman
On Fri, 04 Mar 2011 10:07:09 +0100
Sebastiaan Breedveld s.breedv...@erasmusmc.nl wrote:

 On 03/03/2011 09:34 PM, Sebastiaan Breedveld wrote:
  Hi,
 
  Here is another patch. It adds a -resolutions argument with a list of 
  resolutions to add to the default list:
  Xvnc -resolutions 1264x900 1400x1500
 

Hi Sebastiaan,

It seems this didn't provoke any major interest from the rest of the
community. This is probably a good idea though, and it would be a shame
if your efforts were wasted. Could you add a feature request entry in
the Sourceforge tracker for this? Please include you patch as an
attachment.

Thanks
-- 
Pierre OssmanOpenSource-based Thin Client Technology
System Developer Telephone: +46-13-21 46 00
Cendio ABWeb: http://www.cendio.com

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


signature.asc
Description: PGP signature
--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay___
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel


Re: [Tigervnc-devel] [PATCH] add resolutions to the default randr resolutions

2011-05-19 Thread Sebastiaan Breedveld
On 05/19/2011 11:46 AM, Pierre Ossman wrote:
 On Fri, 04 Mar 2011 10:07:09 +0100
 Sebastiaan Breedvelds.breedv...@erasmusmc.nl  wrote:

 On 03/03/2011 09:34 PM, Sebastiaan Breedveld wrote:
 Hi,

 Here is another patch. It adds a -resolutions argument with a list of
 resolutions to add to the default list:
 Xvnc -resolutions 1264x900 1400x1500

 Hi Sebastiaan,

 It seems this didn't provoke any major interest from the rest of the
 community. This is probably a good idea though, and it would be a shame
 if your efforts were wasted. Could you add a feature request entry in
 the Sourceforge tracker for this? Please include you patch as an
 attachment.

 Thanks
There weren't much hurray's :(

I was already planning to submit the patches on SF, but I wanted to 
check if they still apply well in the current version. Which is the 
(preferred) tree I should patch it against?

I hope to have time in the next 2 weeks to look after TigerVNC again.

Thanks!
Sebastiaan


--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
___
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel


Re: [Tigervnc-devel] [PATCH] add resolutions to the default randr resolutions

2011-05-19 Thread Pierre Ossman
On Thu, 19 May 2011 11:56:38 +0200
Sebastiaan Breedveld s.breedv...@erasmusmc.nl wrote:

 There weren't much hurray's :(
 

We're still a small community. Don't take the lack of response as a
complete lack of interest. It probably just means that people are too
busy with their own things right now. :)

 I was already planning to submit the patches on SF, but I wanted to 
 check if they still apply well in the current version. Which is the 
 (preferred) tree I should patch it against?
 

Trunk is always the preferred tree. If it's an important bug fix then
we might also apply it to the current stable branch.

 I hope to have time in the next 2 weeks to look after TigerVNC again.

Looking forward to it.

Rgds
-- 
Pierre OssmanOpenSource-based Thin Client Technology
System Developer Telephone: +46-13-21 46 00
Cendio ABWeb: http://www.cendio.com

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


signature.asc
Description: PGP signature
--
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay___
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel


Re: [Tigervnc-devel] [PATCH] add resolutions to the default randr resolutions

2011-03-04 Thread Sebastiaan Breedveld

On 03/03/2011 09:34 PM, Sebastiaan Breedveld wrote:

Hi,

Here is another patch. It adds a -resolutions argument with a list of 
resolutions to add to the default list:

Xvnc -resolutions 1264x900 1400x1500

Of course this is a more flexible approach than specifying only 1 with 
the -geometry. Also, window managers tend to resize to the users' 
specified resolution (at least xfce does). It also allows adding odd 
screen resolutions (maybe someone frequently uses vnc viewer on his 
cell phone?).


My main purpose for this is that I want to add a list of pseudo 
resolutions, which gives the user a screen-filling window approach 
which does not hide the task bar: e.g. 1264x900 fits on a 1280x1024 
display.


Of course this can be done by using cvt and xrandr a couple of times, 
but that is quite a hassle.


I have 2 questions about this:
1) are there any restrictions on the resolutions? (e.g. divisable by 2 
or so?)
2) How can one use quotation marks in inetd? When called from inetd, 
the quotation marks are ignored.


Ok, answers come after a good nights sleep. In stead of a quotated 
string, supply the resolutions in a comma separated list:

Xvnc -resolutions 1264x900,1400x1500

so the inetd issue is resolved (although I am still interested in the 
answer).


There also does not seem to be much limitations on the resolutions, but 
the server crashes for anything smaller than 4x4 pixels.


Using 'cvt 1 1' forces the resolution to 8x1, which seems to be ok. 
Nevertheless, I guess it is a good choice to set the minumum to 64x64.



One more thing: the action is now to add these resolutions to the 
default (hard coded) list. Would it maybe more interesting to replace 
the whole list?


Greetings,
Sebastiaan



--- ../../../../unix/xserver/hw/vnc/xvnc.cc2011-02-21 
16:05:15.0 +0100

+++ xvnc.cc2011-03-04 10:00:16.798650722 +0100
@@ -78,6 +78,11 @@
 #include inputstr.h
 #ifdef RANDR
 #include randrstr.h
+/* Set default resolutions */
+#define RANDRMAXDISPLAYS 100
+static int RandRwidths[RANDRMAXDISPLAYS] =  { 1920, 1920, 1600, 1680, 
1400, 1360, 1280, 1280, 1280, 1280, 1024, 800, 640};
+static int RandRheights[RANDRMAXDISPLAYS] = { 1200, 1080, 1200, 1050, 
1050,  768, 1024,  960,  800,  720,  768, 600, 480};

+static int RandRNumDisplays = 13;
 #endif /* RANDR */
 #include X11/keysym.h
   extern char buildtime[];
@@ -170,7 +175,6 @@

 char *listenaddr = NULL;

-
 static void
 vfbInitializePixmapDepths(void)
 {
@@ -292,6 +296,7 @@
 ErrorF(-inetd has been launched from inetd\n);
 ErrorF(-interface IP_address  listen on specified interface\n);
 ErrorF(-noclipboard   disable clipboard settings 
modification via vncconfig utility\n);
+ErrorF(-resolutions X1xY1,X2xY2,... additional screen resolutions 
for RandR\n);

 ErrorF(\nVNC parameters:\n);

 fprintf(stderr,\n
@@ -575,6 +580,54 @@
 noclipboard = true;
 return 1;
 }
+
+if (strcmp(argv[i], -resolutions) == 0) {
+if (++i = argc) {
+UseMsg();
+return 2;
+}
+#ifdef RANDR
+/* Read the resolution string in pieces */
+int width, height, offset = 0;
+char ResString[20];
+
+while (offsetstrlen(argv[i])  sscanf(argv[i]+offset, 
%19[^','], ResString) == 1)

+{
+/* Read width and height */
+if (sscanf(ResString, %dx%d, width, height)==2 )
+{
+/* Offset + 1 to skip the space */
+offset = offset + strlen(ResString) + 1;
+
+/* Check if resolutions are sane */
+if (width64  height64)
+{
+/* Add resolution to list */
+if ( (RandRNumDisplays+1)RANDRMAXDISPLAYS )
+{
+RandRwidths[RandRNumDisplays] = width;
+RandRheights[RandRNumDisplays] = height;
+RandRNumDisplays++;
+} else
+{
+ErrorF(Too many resolutions specified!\n);
+}
+} else
+{
+ErrorF(Insane resolution of %d x %d specified!\n, 
width, height);

+return 2;
+}
+} else
+{
+ErrorF(Malformed resolution string at: %s , argv[i]+offset);
+ErrorF(Ignoring remainder!);
+return 2;
+}
+}
+#endif
+return 2;
+}
+

 if (rfb::Configuration::setParam(argv[i]))
 return 1;
@@ -846,13 +899,10 @@
   Bool ret, gotCurrent = FALSE;
   int i;

-  const int widths[] =  { 1920, 1920, 1600, 1680, 1400, 1360, 1280, 
1280, 1280, 1280, 1024, 800, 640 };
-  const int heights[] = { 1200, 1080, 1200, 1050, 1050,  768, 1024,  
960,  800,  720,  768, 600, 480 };

-
-  for (i = 0;i  sizeof(widths)/sizeof(*widths);i++) {
+  for (i = 0;i  RandRNumDisplays; i++) {
 RRScreenSizePtr pSize;

-pSize = RRRegisterSize(pScreen, widths[i], heights[i],
+pSize = RRRegisterSize(pScreen, RandRwidths[i], RandRheights[i],