Comments (22)
It will also crash if the resolution used by FreeRDP isn't the same as the one in the directfbrc file if there is one
are you sure that generating a default file is the way to go? DirectFB is not meant for everyday users
from freerdp-old.
That's true but when someone does use it it shouldn't crash on them first thing.
If there is no default resource file the app should output one and log it on the console.
And the app should also check the resolutions and just error out with a message if they are not compatible.
from freerdp-old.
2011/6/3, g-reno
[email protected]:
DirectFB UI will crash if you don't have a ~/.directfbrc file in place.
FreeRDP should automatically create a default ~/.directfbrc file if one is
not found.Reply to this email directly or view it on GitHub:
FreeRDP/FreeRDP#32
Gesendet von meinem Mobilgerät
from freerdp-old.
The dfbfreerdp could update the file depending on the comand line args.
from freerdp-old.
Here is a patch that adds auto creating a default ~/.directfbrc resource file:
<script></script>
from freerdp-old.
This patch seems a good start but we need to handle the system backend someway. You're using x11 but people need to be able to use other and I can think of the need of not overwrite the .directfbrc file et all (specially for debugging and like).
from freerdp-old.
I can change system=X11 to system=fbdev (still Linux)
Not sure about allowable values but I guess that would be fbdev, opengl, directx, sdl. Anything special for mac?
How do we query for the graphic system that is being used?
I guess we can just pick one based on the OS, after all this is just for creating a 'default' resource file.
And as long as a ~/.directfbrc file exists the code will not overwrite it. See the code comment.
from freerdp-old.
I'd say to overwrite it except in case you use an option to forbid it. I also think fbdev ought to be used by default and you could have an option to overwrite it to use other (in case x11 for testing).
from freerdp-old.
No overwriting. That makes things very complicated.
All that is necessary is to create a 'default' resource file for the particular OS if one does not already exist.
If a resource file already exists we do nothing.
So for testing you just create whatever ~/.directfbrc you want for your testing and then it will not get overwritten.
from freerdp-old.
In theory, this works. But I think this is not user friendly.
from freerdp-old.
Well, it's a whole lot more user friendly than having the system crash on them which is exactly what happens today.
And I mean it can lock up their workstation currently.
It is not necessary to have a bunch of controlling command line options or anything like that.
You create resource files using an editor not the app.
This is just to make sure that there is at least a default ~/.directfbrc in place so the user does not experience a crash.
from freerdp-old.
I agree that it is more user friendly but FreeRDP can handle with it more properly IMO and even tought you don't use the command line options it seems more user friendly to me and easier to understand by new users.
I won't merge this patch this way. If someone else wants to do that, feels free.
from freerdp-old.
Updated patch for setting default graphics system in the default ~/.directfbrc resource file:
<script> #include "gdi.h" +#if defined(_WIN32) \ + || defined(WIN32) \ + || defined(__CYGWIN__) \ + || defined(__MINGW32__) \ + || defined(__BORLANDC__) +#define OS_WIN +#endif + +#if defined(__unix) \ + || defined(__linux) +#define OS_UNIX_LINUX +#endif + #define SET_DFBI(_inst, _dfbi) (_inst)->param1 = _dfbi #define GET_DFBI(_inst) ((dfbInfo *) ((_inst)->param1)) ============================]]></script>
from freerdp-old.
@otavio: I disagree with the idea of overwriting the file, or adding command-line options to tune how this default file is generated
I think the only acceptable action regarding the directfbrc file is to generate a default one if no such file exists. The rest can be modified with a text editor.
AFAIC, DirectFB is not available on Windows, and it has been broken on Mac OS X for a while. I think we can dumb it down to just Linux, so no need to detect Windows or Mac OS X. In any case, the DirectFB port is not really something meant to be used by end users, mostly by people developing systems to be used by others, where those users usually don't even know they're using software that runs on top of DirectFB.
My main concern is when DirectFB is used with a real framebuffer device, and when it is used with the X11 backend. Your code seem to already check for that, so keep that part, but ditch the OS detection part which I guess you haven't tested anyway because I doubt it would work even if we get to compile dfbfreerdp on those platforms.
For comments, use /* */ instead of // as instructed in the coding guidelines: http://www.freerdp.com/wiki/doku.php?id=coding_guidelines
Also, why do something like this:
static char resourcefile[512];
strncat(resourcefile, home, strlen(home));
resourcefile[512-1] = (char)0;
I see that you want to make the last character of that array a null character, but that doesn't do much. strncat adds a null-terminating character according to this page: http://www.cplusplus.com/reference/clibrary/cstring/strncat/
Plus, if strncat wasn't adding a null terminating character, then you'd still have a problem because you would like you null character to be at the end of the string, not at the end of the full array.
from freerdp-old.
@awakecoding in this case I think the software ought to warn the user that it is using the file and that he/she needs to change it if need.
from freerdp-old.
what if it generates a file with default values, warning the user about which values it is using, and that they might manual adjustements later on?
from freerdp-old.
OS detection:
Windows was added because I found references of people attempts to port DirectFB to Windows. I can remove Windows. But, there is also X11 available on Mac. I don't have a Mac right now but I think some detection should be kept here. I'll make some changes and then maybe someone with Mac could test them.
Commenting:
I'll change comment style.
Is there some particular reason that C++ style '//' comments are not allowable? You find them almost everywhere now.
strncat will bite you hard if you happen to cat in more than the buffer size. Then you will not have a terminating null. That is why I force a terminating null just in case. It's just there in case you've filled the whole buffer.
The server puts out this message that alerts the user that a default resource file was created:
$ dfb/dfbfreerdp -a 16 --gdi sw 192.168.2.49 INFO: created default resource file: /home/greno/.directfbrc starting thread 1 to 192.168.2.49:3389 run_dfbfreerdp: DBG main (767): main thread, waiting for all threads to exit keyboard_layout: 0 connecting to 192.168.2.49:3389 connecting to 192.168.2.49:3389 connecting to 192.168.2.49:3389 Standard RDP encryption negotiated
DirectFB does not output any information about what resource file(s) it is using. Fairly typical.
.
from freerdp-old.
comments: you said it yourself, those are C++ style comments, while this is pure C. Plus, these are in the coding guidelines, which have been discussed already.
As for Mac OS X, I do have a Mac, and if it were to compile the backend would most likely be "x11", not opengl, to run on the Mac OS X X11 server (X11.app).
The DirectFB port doesn't work on Mac simply because DirectFB doesn't work on Mac, at least not recently. I tried getting it to work, but apparently it used to work on Mac OS X and nobody maintained it for a while.
from freerdp-old.
For me it works. I am experienced enough to look into code and understand what's going on.
I am unsure if this is how it ought to work for general users. I'd say, no; but ... it doesn't matter for me et all.
from freerdp-old.
@awakecoding: Yes while working on this patch I saw your post about Mac OS X not compiling DirectFB. It looks like you ran into the recursive mutex pthreads macro problem that bit BSD and OS X. That was fixed a couple years ago I thought but looks like maybe there was a regression in pthreads. That affects more than just Mac OS X w/DirectFB so I would think it will get fixed again.
.
from freerdp-old.
Third patch update for setting default graphics system in the default ~/.directfbrc resource file:
<script></script>
from freerdp-old.
FreeRDP/FreeRDP#40 Patch merged in this pull-request issue.
from freerdp-old.
Related Issues (20)
- Make install is broken
- DirectFB UI: incorrect cursor tracking behavior HOT 2
- DirectFB UI: needs thread control HOT 2
- Unknown keycodes 129 (numeric '.') and 97 ('?' or '/') HOT 6
- Certificate Validation and Storage HOT 4
- make dist fails HOT 2
- support for compose key HOT 8
- DirectFB: Improve performance of event handling HOT 9
- Client fails with pa_operation_get_state() with no sound card HOT 2
- cursor rendering on Xdmx HOT 1
- Release keyboard grab with Ctrl-Alt HOT 16
- dead code fragments HOT 1
- dead code fragments HOT 2
- rdpdr serial,using serial printer for test
- Undefined reference to `freerdp_usleep' HOT 4
- Keyboard input not working under OSX HOT 2
- Unable to connect to Virtualbox RDP server HOT 1
- Audio Choppy
- about freerdp_mitm
- Copy Paste not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freerdp-old.