Author Topic: Dooble releases-Qt6  (Read 28440 times)

Remy

  • Hero Member
  • *****
  • Posts: 778
  • Karma: +12/-1
    • View Profile
Re: Dooble releases-Qt6
« Reply #120 on: November 29, 2024, 11:16:33 am »
An other issue (older one)

Suppr key not working (always have to put the cursor after the char to delete and use backward key)
It would be nice been able to have suppr key operational as expected. 

Other:
Doing a copy of a text or link (e.g. link from link field).
When doing the past into an editor while Dooble is running works but if Dooble is closed before doing the past, clipboard is put empty and past didn't work (lost of copied field)   

Regards
Rémy
« Last Edit: November 29, 2024, 07:40:30 pm by Remy »

TeLLie

  • Sr. Member
  • ****
  • Posts: 256
  • Karma: +14/-0
    • View Profile
Re: Dooble releases-Qt6
« Reply #121 on: November 29, 2024, 08:04:43 pm »
Tellie,

  You probably need to use 'Highmem' to get the DLL's to load into high memory... from a command prompt like this:

highmem -c qt6weben.dll

 Highmem is available from ANPM.

Regards,


Thankz David,

Totaly forgotten this :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2361
  • Karma: +181/-0
    • View Profile
Re: Dooble releases-Qt6
« Reply #122 on: November 29, 2024, 10:29:30 pm »
Thanks.... potentially an issue with toLocal8Bit - https://github.com/psmedley/qt6-base-os2/blob/734fce3e5beabf48094bf3b1db2145fc0279b977/src/plugins/platforms/os2/qos2window.cpp#L810

This calls qt_convert_to_local_8bit() which in qt5 is:
https://github.com/bitwiseworks/qtbase-os2/blob/0a7d641039e9e482cccdeecd4934ac8ec3790eb0/src/corelib/text/qstring.cpp#L5325

& qt6:
https://github.com/psmedley/qt6-base-os2/blob/734fce3e5beabf48094bf3b1db2145fc0279b977/src/corelib/text/qstring.cpp#L5212

Narrowing this down further..... I created a testcase:
Code: [Select]
#include <iostream>
#include <string>
#include <QDebug>
#include <QString>
int main()
{
    QString s = QString::fromUtf8("\u20AC");
    qDebug() << s.toLocal8Bit();
    qDebug() << s.toLocal8Bit().data();
    qDebug() << s.toLatin1();
    qDebug() << s.toUtf8();
    qDebug() << s.toUtf8().data();

    return 0;
}

On Linux, I get:
Code: [Select]
"\xE2\x82\xAC"

"?"
"\xE2\x82\xAC"


On OS/2, I get:
Code: [Select]
"\xE2\x82\xAC"
€
"?"
"\xE2\x82\xAC"
€

This could be a codepage issue on my box, I have NFI about this stuff. Testcase is at https://smedley.id.au/tmp/test.zip - needs qt6core.dll

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5161
  • Karma: +118/-1
    • View Profile
Re: Dooble releases-Qt6
« Reply #123 on: November 30, 2024, 03:27:20 am »
I get,
Code: [Select]
[H:\tmp]test
"\xE2\x82\xAC"
Ôé¼
"?"
"\xE2\x82\xAC"
Ôé¼

Remember that the command shell has no knowledge of unicode. At that, I'm not aware of any cmd line utility that does have knowledge of UTF.
BTW, your updated qt6code.dll didn't seem to help here, just changing the glyphs in a wrong way.

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 380
  • Karma: +26/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Dooble releases-Qt6
« Reply #124 on: November 30, 2024, 03:41:25 am »
I have NFI about this stuff.

Let me be immodest and tell you that I _do_ have an idea about this stuff - and a solution.

The basic issue is that the browser's titlebar should be able to correctly display thousands of different characters - just like the browser itself - but that ain't going to happen if the titlebar is using a codepage that's limited to 256 codepoints. Screwing around to get it to display a question mark rather than the 3-byte UTF8 encoding for a typographic dash accomplishes virtually nothing.

The solution is to set the codepage for the browser's primary thread to CP1208, i.e. UTF8, so the titlebar can render the untranslated UTF8 bytestream correctly. The attached screenshots demonstrate this (for the Chinese example, I had to change the titlebar font from WarpSans to one that includes Chinese glyphs).

Using CP1208 is something I would never otherwise recommend because it normally slows PM text handling down to a crawl. However, in the case of Dooble, the titlebar and system menu are the only places in the entire app that PM renders the text itself. In my limited testing, it appeared to have no noticable impact on performance.

Given all this, I would strongly, strongly recommend implementing this fix in Dooble itself and *not* in QT6 since other QT6-based apps may handle their titlebars differently. To do so, add the following code to Dooble early in its processing: probably right after it initializes the QT6 framework and no later than after it creates its first window (the primary thread's message queue has to exist for this to have any effect). This should only be used on the very first thread.

Code: [Select]
WinSetCp(HMQ_CURRENT, 1208);

FYI... to create my examples, I used my 'CpPal' util to switch the CP to 1208 on the fly. If you have it, set the CP to 1208, then drag from the "Set" icon and drop on the browser.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5161
  • Karma: +118/-1
    • View Profile
Re: Dooble releases-Qt6
« Reply #125 on: November 30, 2024, 04:44:32 am »
I have NFI about this stuff.
Given all this, I would strongly, strongly recommend implementing this fix in Dooble itself and *not* in QT6 since other QT6-based apps may handle their titlebars differently. To do so, add the following code to Dooble early in its processing: probably right after it initializes the QT6 framework and no later than after it creates its first window (the primary thread's message queue has to exist for this to have any effect). This should only be used on the very first thread.

Code: [Select]
WinSetCp(HMQ_CURRENT, 1208);

OK, tried putting this just before the splash screen, earlier used
Code: [Select]
#ifdef Q_OS_OS2
#define INCL_WINCOUNTRY
#include <os2.h>
HMQ hmq;
#endif
Dies with,
Code: [Select]
K:/work/dooble-dry/Source/dooble_main.cc: In function 'int main(int, char**)':
K:/work/dooble-dry/Source/dooble_main.cc:432:12: error: 'HMQ_CURRENT' was not declared in this scope; did you mean 'FILE_CURRENT'?
  432 |   WinSetCp(HMQ_CURRENT, 1208);
Found this in pmwin.h,
Code: [Select]
#define HMQ_CURRENT          ((HMQ)1)
which dies with,
Code: [Select]
K:/work/dooble-dry/Source/dooble_main.cc:55:36: error: use of old-style cast to
'HMQ' {aka 'long unsigned int'} [-Werror=old-style-cast]
   55 | #define HMQ_CURRENT          ((HMQ)1)
      |                                    ^
K:/work/dooble-dry/Source/dooble_main.cc:432:12: note: in expansion of macro 'HM
Q_CURRENT'
  432 |   WinSetCp(HMQ_CURRENT, 1208);
      |            ^~~~~~~~~~~
cc1plus.exe: all warnings being treated as errors

How to set this up?


Dave Yeo

  • Hero Member
  • *****
  • Posts: 5161
  • Karma: +118/-1
    • View Profile
Re: Dooble releases-Qt6
« Reply #126 on: November 30, 2024, 04:48:04 am »
I get,
Code: [Select]
[H:\tmp]test
"\xE2\x82\xAC"
Ôé¼
"?"
"\xE2\x82\xAC"
Ôé¼

Redirecting stderr to a file then loading it in qe with utf8  encoding gives,
Code: [Select]
"\xE2\x82\xAC"

"?"
"\xE2\x82\xAC"

[/quote]
« Last Edit: November 30, 2024, 04:54:20 am by Dave Yeo »

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 380
  • Karma: +26/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Dooble releases-Qt6
« Reply #127 on: November 30, 2024, 05:12:13 am »
How to set this up?

OK, if HMQ_CURRENT resolves to the number '1', try plugging in a '1' for now, i.e.:  WinSetCp(1, 1208);

(I should know how to do a new-style cast but that bit of knowledge escapes me currently.)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2361
  • Karma: +181/-0
    • View Profile
Re: Dooble releases-Qt6
« Reply #128 on: November 30, 2024, 05:22:10 am »
Once we get this working, we should patch simplebrowser.exe too - I assume it has the same issue...

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5161
  • Karma: +118/-1
    • View Profile
Re: Dooble releases-Qt6
« Reply #129 on: November 30, 2024, 06:16:07 am »
How to set this up?

OK, if HMQ_CURRENT resolves to the number '1', try plugging in a '1' for now, i.e.:  WinSetCp(1, 1208);

(I should know how to do a new-style cast but that bit of knowledge escapes me currently.)

Well, I've tried adding the code in various places that seemed early enough in the process, mostly in dooble_main.cc and even right after QApplication::processEvents(); in dooble.cc and no luck.
Guess going to have to read up on how Qt initializes unless Paul has an idea.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5161
  • Karma: +118/-1
    • View Profile
Re: Dooble releases-Qt6
« Reply #130 on: November 30, 2024, 06:18:50 am »
I also wonder if it should be in the webengine, which is basically chromium.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2361
  • Karma: +181/-0
    • View Profile
Re: Dooble releases-Qt6
« Reply #131 on: November 30, 2024, 06:57:24 am »
How to set this up?

OK, if HMQ_CURRENT resolves to the number '1', try plugging in a '1' for now, i.e.:  WinSetCp(1, 1208);

(I should know how to do a new-style cast but that bit of knowledge escapes me currently.)

Well, I've tried adding the code in various places that seemed early enough in the process, mostly in dooble_main.cc and even right after QApplication::processEvents(); in dooble.cc and no luck.
Guess going to have to read up on how Qt initializes unless Paul has an idea.
dooble_main.cc was my guess....

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 380
  • Karma: +26/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Dooble releases-Qt6
« Reply #132 on: November 30, 2024, 09:38:59 am »
Well, I've tried adding the code in various places that seemed early enough in the process, mostly in dooble_main.cc and even right after QApplication::processEvents(); in dooble.cc and no luck.
Guess going to have to read up on how Qt initializes unless Paul has an idea.

I'm sorry to see that this isn't the slam-dunk I hoped it would be. After the splash screen and before the main window is created should have worked. I've attached 'cppal030.zip' so you can confirm that changing the codepage manually works for you.

OK... just noticed something odd: using CpPal to drop the new CP on the main part of the window has no effect. I have to release MB2 while over the titlebar to get it to change. I looked at my notes for CpPal and discovered that it requires a bit more hack-ery to get this to work. CpPal has to fake a font-change in the window where you dropped to get it to notice and do an update.

Let's put this on hold for a bit while I figure out how and where to do this stuff. I'm quite certain that once we get the kinks worked out, just a few lines of code will give us a titlebar that isn't filled with question marks and wierdness :)

Meanwhile, Dave, can you give me a URL that points to your dooble_main.cc?

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2361
  • Karma: +181/-0
    • View Profile
Re: Dooble releases-Qt6
« Reply #133 on: November 30, 2024, 10:18:04 am »

David McKenna

  • Hero Member
  • *****
  • Posts: 837
  • Karma: +26/-0
    • View Profile
Re: Dooble releases-Qt6
« Reply #134 on: November 30, 2024, 01:33:32 pm »
 Looks like he has a fork at https:\\www.github.com\dryeo\dooble