[Kde-hardware-devel] Fw:KScreen OSD
Leslie Zhai
xiang.zhai at i-soft.com.cn
Tue Jul 28 02:01:37 UTC 2015
On 2015年07月27日 10:23, Leslie Zhai wrote:
>
> On 2015年07月24日 19:34, Daniel Vrátil wrote:
>> On Friday, July 24, 2015 05:35:49 PM 翟翔 wrote:
>>>> ------------------ Original ------------------
>>>> *From: * "Daniel Vráti"<dvratil at kde.org>;
>>>> *Date: * Fri, Jul 24, 2015 04:55 PM
>>>> *To: * "xiang.zhai"<xiang.zhai at i-soft.com.cn>;
>>>> "kde-hardware-devel"<kde-hardware-devel at kde.org>;
>>>> *Subject: * KScreen OSD
>>>> Hi Leslie,
>>>>
>>>> I noticed today that you started working on KScreen OSD. Although I'm
>>>> glad
>>>> someone stepped up to start working on it, it's unfortunate that you
>>>> did not
>>>> contact the maintainers (me or Alex Fiestas) nor mentioned your
>>>> intentions
>>>> anywhere on a mailing list (CC'ed kde-hardware-devel) so that we could
>>>> coordinate the works and discuss how it should be properly
>>>> implemented.
>>> I am so sorry that I have not contacted kscreen project`s
>>> maintainers ;-(
>>>
>>> The same story about plasma-desktop/applets/kickoff and
>>> plasma-desktop/kcms/useraccount
>>> http://quickgit.kde.org/?p=plasma-desktop.git&a=shortlog&h=c2b7a63e54375d49d
>>>
>>> 0204e97fc521ea27caec719
>>>
>>> And plasma-workspace/ksmserver/kscreenlocker
>>> http://quickgit.kde.org/?p=plasma-workspace.git&a=shortlog&h=69b966a0fea255e
>>>
>>> f3eb0f2f581567777f50e8e75
>>>
>>> I want to add AccountsService support for kickoff, useraccount and
>>> kscreenlocker https://twitter.com/xiangzhai/status/624509473734823936
>>>
>>> plfiorini, sddm core developer https://github.com/sddm/sddm/
>>> he merged my migration for AccountsService Qt binding
>>> https://github.com/hawaii-desktop/qtaccountsservice/commits/master
>>>
>>> So I just start my work without mentioned us, I am so sorry for that!
>> Awesome! I recommend that you contact the respective developers for
>> those
>> projects as well (generally mailing to plasma-devel mailing list
>> would be
>> fine, all the relevant devs read it).
> Thanks for your advice ;-) I have subscribed kde-hardware-devel and
> plasma-devel mailing list with my working email, I will contact with
> these projects` core developers && maintainers via mailing list ASAP.
>
>>
>>
>>>> I just went through the code briefly, but unfortunatelly the way it is
>>>> done
>>>> right now is absolutely unmergeable and does not align at all with our
>>>> plans.
>>> I will 100% use libkscreen!
>>>
>>> Recently it is skeleton, so I simply use xrandr, I will use
>>> libkscreen`s
>>> SetConfigOperation ;-)
>> Yes, that was one of the major concerns :) The other major concern of
>> mine is
>> that you hardcode some of the things (like detecting laptop screen by
>> using
>> "LVDS" is wrong, some laptop screens are called "eDP" for example -
>> you want
>> to use KScreen::Output::type() and check for KScreen::Output::Panel)
> I am reading libkscreen source code more carefully, try to be familiar
> with it, and I added log info for Config`s canBeApplied, it helps me
> to know what configuration tring to set is wrong.
>
>>
>>>> Would you mind describing your intentions, what functionality are you
>>>> planning
>>>> and what's the general usecase for your OSD? We could then discuss
>>>> how to
>>>> implement it in a way that will be possible to merge into main
>>>> branches and
>>>> get into releases?
>>> I just copy the Windows 8 right side hot zone for multiply outputs
>>> settings usecase.
>> Yes, we wanted to do something like that too, because it's really nice.
>>
>> The plan we had in mind was to use the same thing that "Add Widget" or
>> "Activities" panels in Plasma use or what KWin is using when you
>> press Alt+Tab
>> to show list of windows. I was told that the panel a simple Plasma
>> Dialog -
>> which means we could easily implement that in QML. I also think there
>> is no
>> need to have a standalone application for that, instead we could
>> just show
>> the dialog from the KDED module.
> kscreen`s plasma is for KDE4, I want to migrate it to KF5, please
> count me in ;-)
>
> And I am familiar with QML https://github.com/xiangzhai/qwx the UI of
> WeChat client is 100% QML, I will use QML to implement the osd (simple
> Plasma Dialog).
>
> I tried to add 'the dialog' OsdWidget from the kded module
> http://quickgit.kde.org/?p=kscreen.git&a=commit&h=164a874aae80a7c6b4163ea0c33822797072ea8a
>
> but sorry for my poor unstanding of the usage of libkscreen, I
> directly use xrandr in kded/osd, for example, xrandr --output LVDS1
> --off --output VGA1 --auto, then the kded && plasama segfault ;-( the
> backtrace info is about xcb relative!
Application: kdeinit5 (kdeinit5), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f8929d36880 (LWP 4314))]
Thread 3 (Thread 0x7f88d946b700 (LWP 4599)):
#0 0x00007f89258ad96f in pthread_cond_wait@@GLIBC_2.3.2 () at
/usr/lib/libpthread.so.0
#1 0x00007f88e0f2dd03 in () at /usr/lib/xorg/modules/dri/swrast_dri.so
#2 0x00007f88e0f2db67 in () at /usr/lib/xorg/modules/dri/swrast_dri.so
#3 0x00007f89258a8354 in start_thread () at /usr/lib/libpthread.so.0
#4 0x00007f8928205bfd in clone () at /usr/lib/libc.so.6
Thread 2 (Thread 0x7f88d8c6a700 (LWP 4600)):
#0 0x00007f89258ad96f in pthread_cond_wait@@GLIBC_2.3.2 () at
/usr/lib/libpthread.so.0
#1 0x00007f88e0f2dd03 in () at /usr/lib/xorg/modules/dri/swrast_dri.so
#2 0x00007f88e0f2db67 in () at /usr/lib/xorg/modules/dri/swrast_dri.so
#3 0x00007f89258a8354 in start_thread () at /usr/lib/libpthread.so.0
#4 0x00007f8928205bfd in clone () at /usr/lib/libc.so.6
Thread 1 (Thread 0x7f8929d36880 (LWP 4314)):
[KCrash Handler]
#6 0x00007f8913dea37c in QXcbScreen::mapFromNative(QPoint const&) const
() at /usr/lib/libQt5XcbQpa.so.5
#7 0x00007f8913df19bd in QXcbWindow::handleButtonPressEvent(int, int,
int, int, int, QFlags<Qt::KeyboardModifier>, unsigned int) () at
/usr/lib/libQt5XcbQpa.so.5
#8 0x00007f8913df1f2a in
QXcbWindow::handleXIMouseEvent(xcb_ge_event_t*) () at
/usr/lib/libQt5XcbQpa.so.5
#9 0x00007f8913e04f29 in
QXcbConnection::xi2HandleEvent(xcb_ge_event_t*) () at
/usr/lib/libQt5XcbQpa.so.5
#10 0x00007f8913dddbd5 in
QXcbConnection::handleXcbEvent(xcb_generic_event_t*) () at
/usr/lib/libQt5XcbQpa.so.5
#11 0x00007f8913dde073 in QXcbConnection::processXcbEvents() () at
/usr/lib/libQt5XcbQpa.so.5
#12 0x00007f892878aeb1 in QObject::event(QEvent*) () at
/usr/lib/libQt5Core.so.5
#13 0x00007f8926f0f00c in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () at /usr/lib/libQt5Widgets.so.5
#14 0x00007f8926f144e6 in QApplication::notify(QObject*, QEvent*) () at
/usr/lib/libQt5Widgets.so.5
#15 0x00007f892875b89b in QCoreApplication::notifyInternal(QObject*,
QEvent*) () at /usr/lib/libQt5Core.so.5
#16 0x00007f892875dc96 in
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
() at /usr/lib/libQt5Core.so.5
#17 0x00007f89287b1e33 in () at /usr/lib/libQt5Core.so.5
#18 0x00007f892423e987 in g_main_context_dispatch
(context=0x7f890c0016f0) at gmain.c:3122
#19 0x00007f892423e987 in g_main_context_dispatch
(context=context at entry=0x7f890c0016f0) at gmain.c:3737
#20 0x00007f892423ebb8 in g_main_context_iterate
(context=context at entry=0x7f890c0016f0, block=block at entry=1,
dispatch=dispatch at entry=1, self=<optimized out>) at gmain.c:3808
#21 0x00007f892423ec5c in g_main_context_iteration
(context=0x7f890c0016f0, may_block=1) at gmain.c:3869
#22 0x00007f89287b223f in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() at /usr/lib/libQt5Core.so.5
#23 0x00007f892875926a in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at
/usr/lib/libQt5Core.so.5
#24 0x00007f892876120c in QCoreApplication::exec() () at
/usr/lib/libQt5Core.so.5
#25 0x00007f8914299aa4 in kdemain () at /usr/lib/libkdeinit5_kded5.so
#26 0x000000000040856a in ()
#27 0x000000000040585f in main ()
>
> so I just move the osd out of kded
> http://quickgit.kde.org/?p=kscreen.git&a=shortlog&h=827aa545ba32562dedfb2034d2a90d5786eabe02
>
> when new monitor plugged in, if there are 2 outputs connected, the osd
> show, so it does not need to press Qt::Key_Display hot key grabbed in
> kded module.
> if more than 2 outputs, then advanced kcm_kscreen show.
>
> The same situation - I have to read libkscreen source code more
> carefully ;-)
>
>>
>> The KDED module already implements the logic for switching between
>> mirror
>> (clone), extend left, extend right, laptop only, so you would only
>> have to
>> implement to show the OSD when something changes, saving you lots of
>> work :)
> Yes, there is display switch implementation in kded
> https://projects.kde.org/projects/kde/workspace/kscreen/repository/revisions/master/entry/kded/generator.cpp#L148
>
> It is a good example for me to use libkscreen SetConfigOperation
> correctly!
>
> and it is easy to change the switch mode to meet Windows 8 alike
> usecase: PC screen (laptop) only, mirror (clone), extend right, Second
> screen only.
>
>>
>> For the icons, I don't know where they came from :) but they don't
>> follow the
>> Breeze icon set very much. I am on Akademy (the annual KDE conference
>> )right
>> now, so I can try to talk to someone from Visual Design Group to
>> design the
>> icons for us if you want.
> My colleague, a UI designer, did that ;-) I will let him join in the
> VDG to learn how to follow the Breeze theme standard.
>
> Hooray! happy Akademy! my sincere thanks goes to you and VDG`s
> designer ;-)
>
>>
>> Also for future reference, please avoid hardcoding colors into code -
>> it may
>> look OK on your computer, but people who use different color theme
>> for KDE
>> will have it look ugly and may end up with dark text on dark
>> background or
>> vice-versa :-)
> I am removing the setStyleSheet, the UI design part, instead follow
> the current Breeze theme
> https://projects.kde.org/projects/kde/workspace/kscreen/repository/revisions/osd/entry/osd/osdwidget.cpp#L81
>
>>
>>> There are PC screen only, mirror, extend and second screen only for
>>> Laptop users.
>>>
>>> I want to be merged into master branch, I learn how to contact with
>>> other developers, sorry for my poor English ;P
>> Awesome! Let me know what you think about what I suggested above, I'm of
>> course opened to discussion :-)
> Thanks again for your advice ;-)
>
>>
>> Daniel
>>
>>>> Cheers,
>>>> Daniel
>>> Regards,
>>> Leslie Zhai - a KDE developer
>
>
--
Regards,
Leslie Zhai
More information about the Kde-hardware-devel
mailing list