| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org A099E3858023 |
| DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
| s=default; t=1699457079; | |
| bh=u6qj1E3KDNVWTSNKWt0XjlTOlUaXhuFg4xFMXHuhXrA=; | |
| h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: | |
| List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: | |
| From; | |
| b=akWwt6kpnOEYIotoMOuFfjwll5HJP1xbx19wav58jxJzmKW7kvyrYQwcPGrARmRBV | |
| F7TTnksCo5ZBxRvsKrGaxVRb3RBWVxhfNqzd1EX3lYW3nYGk1XV/Vi62AokJi0dEFE | |
| 2V5tDhMcqmrWwlHvpvsFs55Hvf1rKNecQCc4uWq0= | |
| X-Original-To: | cygwin AT cygwin DOT com |
| Delivered-To: | cygwin AT cygwin DOT com |
| DMARC-Filter: | OpenDMARC Filter v1.4.2 sourceware.org 922E63858D3C |
| ARC-Filter: | OpenARC Filter v1.0.0 sourceware.org 922E63858D3C |
| ARC-Seal: | i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699457044; cv=none; |
| b=DqYAhW6Lx2uuLo+hjN3y7drFOd/nXAs2+sXXKFneJj+Y2WXnBSgRPvXnRqkc+aNwN9SPyGAtWw1WfkbZPNWaF/p2MsNXKPtQ+sB2naIAVh5VZ//AMHjIigaqkMCFmt9nLjKiPUoe1RvwVh8mJ9W7ykniYM5oi5ny8W5HZfuvOOQ= | |
| ARC-Message-Signature: | i=1; a=rsa-sha256; d=sourceware.org; s=key; |
| t=1699457044; c=relaxed/simple; | |
| bh=+LKQUyg22rcuvMSBWTBJ0pYP6324A84r6zeh7Tt3Tww=; | |
| h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; | |
| b=e5loOQ56zwK1TTgWKFYa5NXBdsAnDZvLkFwBVeVBFVzZwNM6iVDGL2Hrwzker9SdellNIvZKEJUuaKdTGDKlGq2/BTYG4CypuZ1lZMJRlhUfK0jhJXBBKA6jO3Nl8KOMFUbH23DB9CtFflFpUOasfV5NPkRsxAiycUamuSQ/USY= | |
| ARC-Authentication-Results: | i=1; server2.sourceware.org |
| To: | "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com> |
| Subject: | RE: [EXT] Re: XWin copy/paste succeeds on Windows 7, crashes on |
| Windows 11 Enterprise. | |
| Thread-Topic: | [EXT] Re: XWin copy/paste succeeds on Windows 7, crashes on |
| Windows 11 Enterprise. | |
| Thread-Index: | AdoOkZldZkaI/m/oSRiHM2QwVvHrlwAwP1KAAGK0UJAAC8zygAAKLbIA//+0CACAAEugYP//Lyyw//zsZ1A= |
| Date: | Wed, 8 Nov 2023 15:24:00 +0000 |
| Message-ID: | <9972254cab724b11a337507a379a1792@ida.org> |
| References: | <242d35130d84418d934265782064690b AT ida DOT org> |
| <18fd5519-180d-4d48-95d1-994f7c5e36f5 AT dronecode DOT org DOT uk> | |
| <474496f4a2e94e3c8ba06e1a2eaa1d75 AT ida DOT org> | |
| <7166752f-e08e-4595-8915-d8eaec920718 AT Shaw DOT ca> | |
| <af765413f9df4a0790339f7c27d76c31 AT ida DOT org> | |
| <ab909be4-f56a-4bef-9931-e10193162967 AT Shaw DOT ca> | |
| <963e0be7a77b4e849cfbca73c209abb4 AT ida DOT org> | |
| <bf868d8832604b32b11c63e8f9cdb10d AT ida DOT org> | |
| In-Reply-To: | <bf868d8832604b32b11c63e8f9cdb10d@ida.org> |
| Accept-Language: | en-US |
| X-MS-Has-Attach: | |
| X-MS-TNEF-Correlator: | |
| x-originating-ip: | [10.0.14.18] |
| MIME-Version: | 1.0 |
| X-Spam-Status: | No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, |
| DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, SPF_HELO_NONE, | |
| SPF_PASS, TXREP, | |
| T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 | |
| X-Spam-Checker-Version: | SpamAssassin 3.4.6 (2021-04-09) on |
| server2.sourceware.org | |
| X-Content-Filtered-By: | Mailman/MimeDel 2.1.30 |
| X-BeenThere: | cygwin AT cygwin DOT com |
| X-Mailman-Version: | 2.1.30 |
| List-Id: | General Cygwin discussions and problem reports <cygwin.cygwin.com> |
| List-Archive: | <https://cygwin.com/pipermail/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-request AT cygwin DOT com?subject=help> |
| List-Subscribe: | <https://cygwin.com/mailman/listinfo/cygwin>, |
| <mailto:cygwin-request AT cygwin DOT com?subject=subscribe> | |
| From: | "Stone, Timothy M via Cygwin" <cygwin AT cygwin DOT com> |
| Reply-To: | "Stone, Timothy M" <tstone AT ida DOT org> |
| Sender: | "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com> |
I have made an important discovery here. I've been using "release" mode when compiling, and had the following results:
On Windows 11 enterprise (release):
When using "translations_ignore", it correctly just prints "Ignoring" every time I cut/copy/paste.
When using "translations_copypaste", the program crashes.
On Windows 7 professional (release):
When using "translations_ignore", it correctly just prints "Ignoring" every time I cut/copy/paste.
When using "translations_copypaste", it correctly cuts/copies/pastes.
I have now compiled and run the program in "debug" mode and have noticed an important difference.
Instead of crashing on Windows 11 when trying to copy/paste, the program prints an error message and actually exits.
The error message is:
"Error: Error - registered format name must be nonnull"
Does anyone know where this error message is coming from?
I am starting to suspect that Windows clipboard integration routines have changed since Windows 7 and are not being used correctly internally.
I see there are some functions (which I presume are used internally) that sound a lot like this error message.
"RegisterClipboardFormat()" and "GetClipboardFormatName()", for instance.
Hopefully this new information can help the experts help me determine why my program is working on Windows 7 and crashing on Windows 11.
thanks!
From: Stone, Timothy M
Sent: Tuesday, November 7, 2023 12:21 PM
To: cygwin AT cygwin DOT com
Subject: RE: [EXT] Re: XWin copy/paste succeeds on Windows 7, crashes on Windows 11 Enterprise.
I have created an entire program to test this. It's only 40 lines. The program pops up a type in window...then you can type something in it and test the copy/paste.
On Windows 11 enterprise:
When using "translations_ignore", it correctly just prints "Ignoring" every time I cut/copy/paste.
When using "translations_copypaste", the program crashes.
On Windows 7 professional:
When using "translations_ignore", it correctly just prints "Ignoring" every time I cut/copy/paste.
When using "translations_copypaste", it correctly cuts/copies/pastes.
Of course, you'll need to link with X/Motif libraries, and possibly change the one line to point at your XKeysymDB, but this 40 line program shows the whole problem:
#include <stdio.h>
#include <stdlib.h>
#include <Xm/RowColumn.h>
#include <Xm/TextF.h>
void ignore_cut_paste(Widget widget, XEvent *event, String *args, int *num_args)
{
printf("Ignoring\n");
}
int main(int argc, char **argv)
{
Widget W,thewin,rowcol,textarea;
XtAppContext app_context;
XtActionsRec actions2;
_putenv("display=127.0.0.1:0.0");
_putenv("xkeysymdb=.\\XKeysymDB");
W = XtAppInitialize(&app_context, (String)"Test",NULL,(Cardinal)0,&argc,argv,NULL,NULL,(Cardinal)0);
actions2.string = "ignore_cut_paste";
actions2.proc = (XtActionProc)ignore_cut_paste;
XtAppAddActions (app_context, &actions2, 1);
String translations_copypaste = "#override\n Ctrl<Key>v: paste-clipboard()\n Ctrl<Key>c: copy-clipboard()\n Ctrl<Key>x: cut-clipboard()";
String translations_ignore = "#override\n Ctrl<Key>v: ignore_cut_paste()\n Ctrl<Key>c: ignore_cut_paste()\n Ctrl<Key>x: ignore_cut_paste()";
thewin = XtCreatePopupShell("Test", topLevelShellWidgetClass,W,NULL,0);
rowcol = XtVaCreateWidget ("rowcol",xmRowColumnWidgetClass, thewin, NULL);
textarea = XtVaCreateManagedWidget ("test_area",
xmTextFieldWidgetClass, rowcol,
XmNmaxLength, 80,
XmNtranslations, XtParseTranslationTable ( translations_copypaste ) ,
NULL);
XtManageChild(textarea);
XtManageChild (rowcol);
XtPopup(thewin,XtGrabNone);
XtAppMainLoop(app_context);
}
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |